DelphiWorlds / Playground

Stuff I'm working on that I *may* make public
MIT License
42 stars 16 forks source link

problem compiling #18

Closed lorife closed 1 year ago

lorife commented 1 year ago

Hello, I'm using delphi 11.3. when I compile CrossPlatformLocationD11 I receive the error:

[MSBuild Error] The "CreateAndroidManifestFile" task failed unexpectedly. System.IO.FileNotFoundException: Could not find file 'C:\Users\Lorenzo\Downloads\Kastri-master\Demos\CrossPlatformLocation\Service\Android\Debug\CrossPlatformLocationService.jar'.

When I compile CrossPlatformLocationService I receive the error:

[Exec Error] The command ""C:\Program Files\Java\jdk1.8.0_60\bin\javac" -g -Xlint:deprecation -source 11 -target 11 -encoding UTF-8 -d "C:\Users\Lorenzo\Downloads\Kastri-master\Demos\CrossPlatformLocation\Service\JavaClasses\CrossPlatformLocationService" -classpath "C:\Users\Public\Documents\Embarcadero\Studio\22.0\CatalogRepository\AndroidSDK-2525-22.0.47991.2819\platforms\android-32\android.jar";"c:\program files (x86)\embarcadero\studio\22.0\lib\android\Debug\core-1.5.0-rc02.jar";"c:\program files (x86)\embarcadero\studio\22.0\lib\android\Debug\fmx.jar" --system "C:\Program Files\Java\jdk1.8.0_60" .\Android\Debug\CrossPlatformLocationService.java .\Android\Debug\CrossPlatformLocationServiceProxyInterface.java" exited with code 2.

What can it be?

DelphiWorlds commented 1 year ago

If you have compiled the demo in an earlier version of Delphi before, please delete the .java files in the Service folder, and rebuild.

lorife commented 1 year ago

I deleted all java files and tried to compile again. I sill have an error.

Checking project dependencies...
Building CrossPlatformLocationService.dproj (Debug, Android)
brcc32 command line for "CrossPlatformLocationService.vrc"
  c:\program files (x86)\embarcadero\studio\22.0\bin\cgrc.exe -c65001 CrossPlatformLocationService.vrc -foCrossPlatformLocationService.res 
dccaarm command line for "CrossPlatformLocationService.dpr"
  c:\program files (x86)\embarcadero\studio\22.0\bin\dccaarm.exe -$O- --no-config -B -Q -TX.so -AGenerics.Collections=System.Generics.Collections;
  Generics.Defaults=System.Generics.Defaults -DDEBUG;USE_FUSED_LOCATION;;FRAMEWORK_FMX -E.\Android\Debug -I"c:\program files 
  (x86)\embarcadero\studio\22.0\lib\Android\debug";..\Common;..\..\..\API;..\..\..\Core;..\..\..\Include;..\..\..\Features\Location;"c:\program files 
  (x86)\embarcadero\studio\22.0\lib\Android\Release";C:\Users\Public\Documents\Embarcadero\Studio\22.0\Dcp\Android;"c:\program files 
  (x86)\embarcadero\studio\22.0\RBuilder\Lib\Android32" -LEC:\Users\Public\Documents\Embarcadero\Studio\22.0\Bpl\Android 
  -LNC:\Users\Public\Documents\Embarcadero\Studio\22.0\Dcp\Android -NU.\Android\Debug -NSSystem;Xml;Data;Datasnap;Web;Soap; -O..\Common;..\..\..\API;
  ..\..\..\Core;..\..\..\Include;..\..\..\Features\Location;"c:\program files (x86)\embarcadero\studio\22.0\lib\Android\Release";
  C:\Users\Public\Documents\Embarcadero\Studio\22.0\Dcp\Android;"c:\program files (x86)\embarcadero\studio\22.0\RBuilder\Lib\Android32" -R..\Common;
  ..\..\..\API;..\..\..\Core;..\..\..\Include;..\..\..\Features\Location;"c:\program files (x86)\embarcadero\studio\22.0\lib\Android\Release";
  C:\Users\Public\Documents\Embarcadero\Studio\22.0\Dcp\Android;"c:\program files (x86)\embarcadero\studio\22.0\RBuilder\Lib\Android32" -U"c:\program 
  files (x86)\embarcadero\studio\22.0\lib\Android\debug";..\Common;..\..\..\API;..\..\..\Core;..\..\..\Include;..\..\..\Features\Location;"c:\program 
  files (x86)\embarcadero\studio\22.0\lib\Android\Release";C:\Users\Public\Documents\Embarcadero\Studio\22.0\Dcp\Android;"c:\program files 
  (x86)\embarcadero\studio\22.0\RBuilder\Lib\Android32" 
  --libpath:C:\Users\Public\Documents\Embarcadero\Studio\22.0\CatalogRepository\AndroidNDK-21-22.0.47991.2819\android-ndk-r21\sources\cxx-stl\llvm-libc++\libs\armeabi-v7a;
  C:\Users\Public\Documents\Embarcadero\Studio\22.0\CatalogRepository\AndroidNDK-21-22.0.47991.2819\android-ndk-r21\platforms\android-23\arch-arm\usr\lib 
  --linker:C:\Users\Public\Documents\Embarcadero\Studio\22.0\CatalogRepository\AndroidNDK-21-22.0.47991.2819\android-ndk-r21\toolchains\arm-linux-androideabi-4.9\prebuilt\windows-x86_64\bin\arm-linux-androideabi-ld.exe 
  -V -VN -NO.\Android\Debug  CrossPlatformLocationService.dpr   
[DCC Hint] CPL.ServiceModule.pas(47): H2219 Private symbol 'FTerminatedFlagFileName' declared but never used
[Exec Error] The command ""C:\Program Files\Java\jdk1.8.0_60\bin\javac" -g -Xlint:deprecation -source 11 -target 11 -encoding UTF-8 -d "C:\Users\Lorenzo\Downloads\Kastri-master\Demos\CrossPlatformLocation\Service\JavaClasses\CrossPlatformLocationService" -classpath "C:\Users\Public\Documents\Embarcadero\Studio\22.0\CatalogRepository\AndroidSDK-2525-22.0.47991.2819\platforms\android-32\android.jar";"c:\program files (x86)\embarcadero\studio\22.0\lib\android\Debug\core-1.5.0-rc02.jar";"c:\program files (x86)\embarcadero\studio\22.0\lib\android\Debug\fmx.jar" --system "C:\Program Files\Java\jdk1.8.0_60" .\Android\Debug\CrossPlatformLocationService.java .\Android\Debug\CrossPlatformLocationServiceProxyInterface.java" exited with code 2.
Failed
Elapsed time: 00:00:07.1
DelphiWorlds commented 1 year ago

I just noticed you're using the wrong JDK with Delphi. In Delphi, use Tools | Manage Platforms, select the Additional Options tab, select Eclipse Temurin OpenJDK and click apply:

image

Then go to your Android SDK settings, select the Java tab, and change the settings there to use that JDK:

image

DelphiWorlds commented 1 year ago

Incidentally, you have filed an issue in the wrong repository for this. It should have been here.

lorife commented 1 year ago

it works great!! thank you so much, great project!