Hi all,

I have another problem with Maven: Android plugins seems to call javac and/or 
dx incorrectly.

After adding Android platform as dependency to Maven project, I am getting long 
message from dx that I am trying to provide own implementation for core 
libraries, and that I should not do it. 

[INFO] trouble processing "java/nio/CharBuffer.class":
[INFO] 
[INFO] Ill-advised or mistaken usage of a core class (java.* or javax.*)
[INFO] when not building a core library. (…)

I have read that this message appears when one tries to pass android.jar to dx 
(instead of passing it just to javac). As workaround, I have removed dependency 
on Android, and added path to android.jar into maven-compiler-plugin 
configuration:
          <compilerArguments>
                
<classpath>${env.ANDROID_HOME}/platforms/android-8/android.jar</classpath>
          </compilerArguments>

This did the trick and allowed me to build working application. But today, 
another problem appeared: as I've probably completely overwritten "-classpath" 
parameter of javac, maven does not passing it paths to other dependencies. In 
result, I see lot of "package (…) does not exist" and "can not find symbol (…)" 
errors. They are saying about libraries which are defined as dependencies.

I was trying to extend "classpath" parameter by adding paths to my dependencies 
manually, but surprisingly, it does not work (and I prefer to force maven to do 
this). Removing "classpath" element make javac complaining that "package 
os.android does not exists". And adding android to dependencies moves me to the 
beginning - dx complains about core classes.

Error message informs about "--core-classes" argument which may be passed to 
dx, but may result in "pain, suffering, grief, and lamentation". I've checked 
that maven-android may be configured to pass it. Do you think this is safe to 
use it? I suppose this message should appear when using libraries incompatible 
with Android (as defining core classes is forbidden on this platform). If I use 
the "--core-classes" switch, I will not be informed about incompatible 
libraries, which may cause many troubles in the future.

I have no idea how to solve it. I was trying to compile with both android.jar 
from Maven Central repository, and with android.jar from SDK - both causes the 
same error.

Is there any other way to do it, instead of passing "--core-classes" argument?

Best regards,
Mariusz Pluciński





---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org

Reply via email to