Some errors I have experienced when renaming service projects and or changing Delphi Versions for a project. You may need to parse [PAClient Error] to understand the problem.
Missing Deploy Files
The xxxx.dproj and or xxx.deployproj may have left over references to files not cleared out when changing the the location or name of the service files. "Remove Android Service" may not remove all references
<DeployFile Include="C:\Delphi\DCus\18.0\AndroidSvc\Android\Debug\libForegroundBackgroundService.so" Condition="'$(Config)'=='Debug'">
<RemoteDir>FBProjBerlin\library\lib\armeabi-v7a\</RemoteDir>
<RemoteName>libForegroundBackgroundService.so</RemoteName>
<DeployClass>AndroidServiceOutput</DeployClass>
<Operation>1</Operation>
<LocalCommand/>
<RemoteCommand/>
<Overwrite>True</Overwrite>
</DeployFile>
<JavaReference Include="..\FBServiceSydney\Android\Debug\ForegroundBackgroundService.jar">
<JavaReference Include="..\Service\Android\Debug\ForegroundBackgroundService.jar">
<Disabled/>
</JavaReference>
<JavaReference Include="..\Service\Android\Debug\ForegroundBackgroundSampleService.jar">
<Disabled/>
</JavaReference>
A token from another Version of Delphi
in XML Template eg <%provider%> is not removed by current version resulting in
[PAClient Error] Error: E2312 C:\Delphi\DCus\18.0\AndroidSvcApp\Android\Debug\FBProjBerlin\AndroidManifest.xml:36:
error: Error parsing XML: not well-formed (invalid token)
:36 Given the line of the error in the
Fix :Search for <% in the output AndriodMainfest.xml Files >> Typically >>>>.Debug.AndriodMainfest.xml
Then remove the tokens from the Projects AndriodMainfestTemplate.xml
Eg <%provider%> and <%uses-libraries%> are editable fields in Sydney not handled by Berlin.
Alternate : Do not copy AndriodMainfestTemplate.xml when making a project file for a different Delphi Version.
Requires that you recode any modifications made to this file in the original project
A permission supported by a later version of the SDK
eg. android:resizeableActivity="false" android:requestLegacyExternalStorage="true">
[PAClient Error] Error: E2312 Unable to execute '"C:\Users\Public\Documents\Embarcadero\Studio\18.0\CatalogRepository\AndroidSDK-24.3.3\build-tools\22.0.1\aapt.exe" package -f -M "C:\Delphi\DCus\18.0\AndroidSvcApp\Android\Debug\FBProjBerlin\AndroidManifest.xml" -F "C:\Delphi\DCus\18.0\AndroidSvcApp\Android\Debug\FBProjBerlin\bin\FBProjBerlin-unsigned.apk" -I "C:\Users\Public\Documents\Embarcadero\Studio\18.0\CatalogRepository\AndroidSDK-24.3.3\platforms\android-22\android.jar" -S "C:\Delphi\DCus\18.0\AndroidSvcApp\Android\Debug\FBProjBerlin\res" -A "C:\Delphi\DCus\18.0\AndroidSvcApp\Android\Debug\FBProjBerlin\assets" "C:\Delphi\DCus\18.0\AndroidSvcApp\Android\Debug\FBProjBerlin\library" "C:\Delphi\DCus\18.0\AndroidSvcApp\Android\Debug\FBProjBerlin\classes"' (Error 1)
[PAClient Error] Error: E2312 C:\Delphi\DCus\18.0\AndroidSvcApp\Android\Debug\FBProjBerlin\AndroidManifest.xml:24: error: No resource identifier found for attribute 'resizeableActivity' in package 'android'
[PAClient Error] Error: E2312 C:\Delphi\DCus\18.0\AndroidSvcApp\Android\Debug\FBProjBerlin\AndroidManifest.xml:24: error: No resource identifier found for attribute 'requestLegacyExternalStorage' in package 'android'
Fix : Remove Reference android:resizeableActivity="false" From the AndriodMainfestTemplate.xml