Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Android service compilation error


This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 5 - Last Post: Dec 2, 2016 3:30 PM Last Post By: Dave Nottage
Fuandi Hartanto

Posts: 18
Registered: 1/12/15
Android service compilation error  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 29, 2016 8:42 PM
I created a new multidevice platform project, then after that created an android service project. Both saved in different folder.

When I tried to build the service. I got this error below.

[Exec Error] The command ""C:\Program Files\Java\jdk1.8.0_101\bin\javac" -d javaclasses -Xlint:deprecation -classpath "C:\Users\Public\Documents\Embarcadero\Studio\17.0\PlatformSDKs\android-sdk-windows\platforms\android-22\android.jar";"c:\program files (x86)\embarcadero\studio\17.0\lib\Android\Debug\fmx.jar" -bootclasspath "C:\Users\Public\Documents\Embarcadero\Studio\17.0\PlatformSDKs\android-sdk-windows\platforms\android-22\android.jar" -encoding UTF-8 -target 1.6 -g -source 1.6 .\Android\Debug\Project2.java .\Android\Debug\Project2ProxyInterface.java" exited with code 1.

Anyone can help ?

Dave Nottage

Posts: 1,850
Registered: 1/7/00
Re: Android service compilation error  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 30, 2016 3:23 PM   in response to: Fuandi Hartanto in response to: Fuandi Hartanto
Fuandi Hartanto wrote:

Anyone can help ?

Please provide the details from the Output tab of the messages Window.

--
Dave Nottage [MVP, TeamB]
Hints, tips and tricks at: http://www.delphiworlds.com/blog
Fuandi Hartanto

Posts: 18
Registered: 1/12/15
Re: Android service compilation error  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 30, 2016 7:47 PM   in response to: Dave Nottage in response to: Dave Nottage
Compiling TruckCommBackground.dproj (Debug, Android)
brcc32 command line for "TruckCommBackground.vrc"
c:\program files (x86)\embarcadero\studio\17.0\bin\cgrc.exe -c65001 TruckCommBackground.vrc -foTruckCommBackground.res
[Exec Error] The command ""C:\Program Files\Java\jdk1.8.0_101\bin\javac" -d javaclasses -Xlint:deprecation -classpath "C:\Users\Public\Documents\Embarcadero\Studio\17.0\PlatformSDKs\android-sdk-windows\platforms\android-22\android.jar";"c:\program files (x86)\embarcadero\studio\17.0\lib\Android\Debug\fmx.jar" -bootclasspath "C:\Users\Public\Documents\Embarcadero\Studio\17.0\PlatformSDKs\android-sdk-windows\platforms\android-22\android.jar" -encoding UTF-8 -target 1.6 -g -source 1.6 .\Android\Debug\TruckCommBackground.java .\Android\Debug\TruckCommBackgroundProxyInterface.java" exited with code 1.
Failed
Elapsed time: 00:00:00.8
Dave Nottage

Posts: 1,850
Registered: 1/7/00
Re: Android service compilation error  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 30, 2016 8:48 PM   in response to: Fuandi Hartanto in response to: Fuandi Hartanto
Fuandi Hartanto wrote:

Elapsed time: 00:00:00.8

That's not from the Output tab of the Messages window; that is from the Build tab. The Output tab has more detailed
information about what is happening.

--
Dave Nottage [MVP, TeamB]
Hints, tips and tricks at: http://www.delphiworlds.com/blog
Fuandi Hartanto

Posts: 18
Registered: 1/12/15
Re: Android service compilation error  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 1, 2016 11:07 PM   in response to: Dave Nottage in response to: Dave Nottage
Build
Checking project dependencies...
Building TruckCommBackground.dproj (Debug, Android)
brcc32 command line for "TruckCommBackground.vrc"
c:\program files (x86)\embarcadero\studio\17.0\bin\cgrc.exe -c65001 TruckCommBackground.vrc -foTruckCommBackground.res
[Exec Error] The command ""C:\Program Files\Java\jdk1.8.0_101\bin\javac" -d javaclasses -Xlint:deprecation -classpath "C:\Users\Public\Documents\Embarcadero\Studio\17.0\PlatformSDKs\android-sdk-windows\platforms\android-22\android.jar";"c:\program files (x86)\embarcadero\studio\17.0\lib\Android\Debug\fmx.jar" -bootclasspath "C:\Users\Public\Documents\Embarcadero\Studio\17.0\PlatformSDKs\android-sdk-windows\platforms\android-22\android.jar" -encoding UTF-8 -target 1.6 -g -source 1.6 .\Android\Debug\TruckCommBackground.java .\Android\Debug\TruckCommBackgroundProxyInterface.java" exited with code 1.
Failed
Elapsed time: 00:00:00.9
Output
Build started 02/12/2016 15:05:46.
__________________________________________________
Project "C:\Users\admin\Documents\Embarcadero\Studio\Projects\TruckCommBackground.dproj" (Build target(s)):
Target BuildVersionResource:
c:\program files (x86)\embarcadero\studio\17.0\bin\cgrc.exe -c65001 TruckCommBackground.vrc -foTruckCommBackground.res
CodeGear Resource Compiler/Binder
Version 1.2.2 Copyright (c) 2008-2012 Embarcadero Technologies Inc.

Microsoft (R) Windows (R) Resource Compiler Version 6.0.5724.0

Copyright (C) Microsoft Corporation. All rights reserved.

Deleting file "TruckCommBackground.vrc".
Target BuildAndroidServiceJarFile:
"C:\Program Files\Java\jdk1.8.0_101\bin\javac" -d javaclasses -Xlint:deprecation -classpath "C:\Users\Public\Documents\Embarcadero\Studio\17.0\PlatformSDKs\android-sdk-windows\platforms\android-22\android.jar";"c:\program files (x86)\embarcadero\studio\17.0\lib\Android\Debug\fmx.jar" -bootclasspath "C:\Users\Public\Documents\Embarcadero\Studio\17.0\PlatformSDKs\android-sdk-windows\platforms\android-22\android.jar" -encoding UTF-8 -target 1.6 -g -source 1.6 .\Android\Debug\TruckCommBackground.java .\Android\Debug\TruckCommBackgroundProxyInterface.java
.\Android\Debug\TruckCommBackground.java:22: error: variable libraryName is already defined in class TruckCommBackground
private String libraryName;
^
.\Android\Debug\TruckCommBackground.java:25: error: cannot reference libraryName before supertype constructor has been called
super(libraryName);
^
.\Android\Debug\TruckCommBackground.java:45: error: cannot assign a value to final variable libraryName
libraryName = getApplicationInfo().nativeLibraryDir + "/lib" + baseLibraryName + ".so";
^
.\Android\Debug\TruckCommBackground.java:45: error: cannot find symbol
libraryName = getApplicationInfo().nativeLibraryDir + "/lib" + baseLibraryName + ".so";
^
symbol: variable baseLibraryName
location: class TruckCommBackground
4 errors
c:\program files (x86)\embarcadero\studio\17.0\bin\CodeGear.Common.Targets(817,5): error MSB3073: The command ""C:\Program Files\Java\jdk1.8.0_101\bin\javac" -d javaclasses -Xlint:deprecation -classpath "C:\Users\Public\Documents\Embarcadero\Studio\17.0\PlatformSDKs\android-sdk-windows\platforms\android-22\android.jar";"c:\program files (x86)\embarcadero\studio\17.0\lib\Android\Debug\fmx.jar" -bootclasspath "C:\Users\Public\Documents\Embarcadero\Studio\17.0\PlatformSDKs\android-sdk-windows\platforms\android-22\android.jar" -encoding UTF-8 -target 1.6 -g -source 1.6 .\Android\Debug\TruckCommBackground.java .\Android\Debug\TruckCommBackgroundProxyInterface.java" exited with code 1.
Done building target "BuildAndroidServiceJarFile" in project "TruckCommBackground.dproj" -- FAILED.
Done building project "TruckCommBackground.dproj" -- FAILED.
Build FAILED.
c:\program files (x86)\embarcadero\studio\17.0\bin\CodeGear.Common.Targets(817,5): error MSB3073: The command ""C:\Program Files\Java\jdk1.8.0_101\bin\javac" -d javaclasses -Xlint:deprecation -classpath "C:\Users\Public\Documents\Embarcadero\Studio\17.0\PlatformSDKs\android-sdk-windows\platforms\android-22\android.jar";"c:\program files (x86)\embarcadero\studio\17.0\lib\Android\Debug\fmx.jar" -bootclasspath "C:\Users\Public\Documents\Embarcadero\Studio\17.0\PlatformSDKs\android-sdk-windows\platforms\android-22\android.jar" -encoding UTF-8 -target 1.6 -g -source 1.6 .\Android\Debug\TruckCommBackground.java .\Android\Debug\TruckCommBackgroundProxyInterface.java" exited with code 1.
0 Warning(s)
1 Error(s)
Time Elapsed 00:00:00.75

Dave Nottage

Posts: 1,850
Registered: 1/7/00
Re: Android service compilation error  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 2, 2016 3:30 PM   in response to: Fuandi Hartanto in response to: Fuandi Hartanto
Fuandi Hartanto wrote:

"C:\Program Files\Java\jdk1.8.0_101\bin\javac" -d javaclasses -Xlint:deprecation -classpath
"C:\Users\Public\Documents\Embarcadero\Studio\17.0\PlatformSDKs\android-sdk-windows\platforms\android-22\android.jar";
"c:\program files (x86)\embarcadero\studio\17.0\lib\Android\Debug\fmx.jar" -bootclasspath
"C:\Users\Public\Documents\Embarcadero\Studio\17.0\PlatformSDKs\android-sdk-windows\platforms\android-22\android.jar"
-encoding UTF-8 -target 1.6 -g -source 1.6 .\Android\Debug\TruckCommBackground.java .
\Android\Debug\TruckCommBackgroundProxyInterface.java .\Android\Debug\TruckCommBackground.java:22: error:
variable libraryName is already defined in class TruckCommBackground private String libraryName;
^

There's a mismatch between the SDK and the JDK. Your SDK settings are pointing to Android API level 22, but it is using
JDK 1.8. You'll need to either "downgrade" the JDK to 1.7, or "upgrade" your SDK to API level 24.

You can use the SDK Manager in C:\Users\Public\Documents\Embarcadero\Studio\17.0\PlatformSDKs\android-sdk-windows to
install the SDK API 24 (if it is not already), and modify your Android SDK paths in Delphi using Tools|Options->SDK
Manager

Alternatively, in Windows, go to Control Panel, Programs & Features and uninstall the Java SE Development Kit 8 (JDK
1.8), and go to:

http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html

To download and install Java SE Development Kit 7 (JDK 1.7), and in Delphi using Tools|Options->SDK Manager, update the
Java paths for the Android SDK

--
Dave Nottage [MVP, TeamB]
Hints, tips and tricks at: http://www.delphiworlds.com/blog
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02