cocos 2d-x-3.15.1 项目在android studio 编译时出现错误
Error occurs when cocos 2d-x-3.15.1 project compiling in android studio
不知道如何解决cocos 2d-x-3.15.1
的这个问题
Warning:android-validator: Suspicious module dependency proj.android -> android: Android application module depends on other application module. Possibly, you should change type of module 'android' to 'Library' or change the dependency scope to 'Provided'.
Error:Android Pre Dex: [EngineDataManager.jar] at org.jetbrains.android.compiler.tools.AndroidDxRunner.runDex(AndroidDxRunner.java:139)
Error:Android Pre Dex: [EngineDataManager.jar] Exception in thread "main" java.lang.NullPointerException
Error:Android Pre Dex: [EngineDataManager.jar] at org.jetbrains.android.compiler.tools.AndroidDxRunner.main(AndroidDxRunner.java:336)
Error:Android Pre Dex: [EngineDataManager.jar] at org.jetbrains.android.compiler.tools.AndroidDxRunner.loadDex(AndroidDxRunner.java:80)
Error:Android Pre Dex: [EngineDataManager.jar] at org.jetbrains.android.compiler.tools.AndroidDxRunner.runDex(AndroidDxRunner.java:136)
Error:Android Pre Dex: [EngineDataManager.jar] at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
Error:Android Pre Dex: [EngineDataManager.jar] at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
Error:Android Pre Dex: [EngineDataManager.jar] at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
Error:Android Pre Dex: [EngineDataManager.jar] at java.security.AccessController.doPrivileged(Native Method)
Error:Android Pre Dex: [EngineDataManager.jar] at java.net.URLClassLoader.run(URLClassLoader.java:361)
Error:Android Pre Dex: [EngineDataManager.jar] at java.net.URLClassLoader.run(URLClassLoader.java:372)
Error:Android Pre Dex: [EngineDataManager.jar] Failed to load dx.jar
Error:Android Pre Dex: [EngineDataManager.jar] java.lang.ClassNotFoundException: com.android.dx.command.DxConsole
正在安装 android studio 2.3.3,但仍然显示与 android studio 2.1.1 相同的一些错误。我不明白其中有什么问题..请帮我解决这个问题!!
Error:Android Pre Dex: [httpclient-4.4.1.1.jar] Failed to load dx.jar
Error:Android Pre Dex: [httpclient-4.4.1.1.jar] at org.jetbrains.android.compiler.tools.AndroidDxRunner.runDex(AndroidDxRunner.java:139)
Error:Android Pre Dex: [httpclient-4.4.1.1.jar] Exception in thread "main" java.lang.NullPointerException
Error:Android Pre Dex: [httpclient-4.4.1.1.jar] at org.jetbrains.android.compiler.tools.AndroidDxRunner.main(AndroidDxRunner.java:336)
Error:Android Pre Dex: [httpclient-4.4.1.1.jar] at org.jetbrains.android.compiler.tools.AndroidDxRunner.runDex(AndroidDxRunner.java:136)
Error:Android Pre Dex: [httpclient-4.4.1.1.jar] at org.jetbrains.android.compiler.tools.AndroidDxRunner.loadDex(AndroidDxRunner.java:80)
Error:Android Pre Dex: [httpclient-4.4.1.1.jar] at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
Error:Android Pre Dex: [httpclient-4.4.1.1.jar] at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
Error:Android Pre Dex: [httpclient-4.4.1.1.jar] at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
Error:Android Pre Dex: [httpclient-4.4.1.1.jar] java.lang.ClassNotFoundException: com.android.dx.command.DxConsole
Error Occur at the time of Compiling the project in android studio. Its showing some dx.jar file error and some error which are unable to understand it. So please help me out from this error!
Error:Android Pre Dex: [annotations.jar] at java.net.URLClassLoader.run(URLClassLoader.java:372)
Error:Android Pre Dex: [annotations.jar] at java.net.URLClassLoader.run(URLClassLoader.java:361)
Information:05/07/2017 12:24 PM - Compilation completed with 13 errors and 0 warnings in 5s 253ms
Error:Android Pre Dex: [annotations.jar] Failed to load dx.jar
Error:Android Pre Dex: [annotations.jar] at java.security.AccessController.doPrivileged(Native Method)
Error:Android Pre Dex: [annotations.jar] java.lang.ClassNotFoundException: com.android.dx.command.DxConsole
Error:Android Pre Dex: [annotations.jar] at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
Error:Android Pre Dex: [annotations.jar] at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
Error:Android Pre Dex: [annotations.jar] at org.jetbrains.android.compiler.tools.AndroidDxRunner.loadDex(AndroidDxRunner.java:80)
Error:Android Pre Dex: [annotations.jar] at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
Error:Android Pre Dex: [annotations.jar] at org.jetbrains.android.compiler.tools.AndroidDxRunner.runDex(AndroidDxRunner.java:136)
Error:Android Pre Dex: [annotations.jar] Exception in thread "main" java.lang.NullPointerException
Error:Android Pre Dex: [annotations.jar] at org.jetbrains.android.compiler.tools.AndroidDxRunner.main(AndroidDxRunner.java:336)
Error:Android Pre Dex: [annotations.jar] at org.jetbrains.android.compiler.tools.AndroidDxRunner.runDex(AndroidDxRunner.java:139)
Information:java: Some input files use unchecked or unsafe operations.
Information:java: Recompile with -Xlint:unchecked for details.
G:\Kunal\Gaming\cocos2d\cocos\platform\android\java\src\org\cocos2dx\lib\Cocos2dxSound.java
我遇到了同样的问题。
遵循 this 解决方案并成功!
该解决方案适用于 Ubuntu 和 OSX,但我相信它也适用于 Windows。
不知道如何解决cocos 2d-x-3.15.1
的这个问题 Warning:android-validator: Suspicious module dependency proj.android -> android: Android application module depends on other application module. Possibly, you should change type of module 'android' to 'Library' or change the dependency scope to 'Provided'.
Error:Android Pre Dex: [EngineDataManager.jar] at org.jetbrains.android.compiler.tools.AndroidDxRunner.runDex(AndroidDxRunner.java:139)
Error:Android Pre Dex: [EngineDataManager.jar] Exception in thread "main" java.lang.NullPointerException
Error:Android Pre Dex: [EngineDataManager.jar] at org.jetbrains.android.compiler.tools.AndroidDxRunner.main(AndroidDxRunner.java:336)
Error:Android Pre Dex: [EngineDataManager.jar] at org.jetbrains.android.compiler.tools.AndroidDxRunner.loadDex(AndroidDxRunner.java:80)
Error:Android Pre Dex: [EngineDataManager.jar] at org.jetbrains.android.compiler.tools.AndroidDxRunner.runDex(AndroidDxRunner.java:136)
Error:Android Pre Dex: [EngineDataManager.jar] at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
Error:Android Pre Dex: [EngineDataManager.jar] at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
Error:Android Pre Dex: [EngineDataManager.jar] at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
Error:Android Pre Dex: [EngineDataManager.jar] at java.security.AccessController.doPrivileged(Native Method)
Error:Android Pre Dex: [EngineDataManager.jar] at java.net.URLClassLoader.run(URLClassLoader.java:361)
Error:Android Pre Dex: [EngineDataManager.jar] at java.net.URLClassLoader.run(URLClassLoader.java:372)
Error:Android Pre Dex: [EngineDataManager.jar] Failed to load dx.jar
Error:Android Pre Dex: [EngineDataManager.jar] java.lang.ClassNotFoundException: com.android.dx.command.DxConsole
正在安装 android studio 2.3.3,但仍然显示与 android studio 2.1.1 相同的一些错误。我不明白其中有什么问题..请帮我解决这个问题!!
Error:Android Pre Dex: [httpclient-4.4.1.1.jar] Failed to load dx.jar
Error:Android Pre Dex: [httpclient-4.4.1.1.jar] at org.jetbrains.android.compiler.tools.AndroidDxRunner.runDex(AndroidDxRunner.java:139)
Error:Android Pre Dex: [httpclient-4.4.1.1.jar] Exception in thread "main" java.lang.NullPointerException
Error:Android Pre Dex: [httpclient-4.4.1.1.jar] at org.jetbrains.android.compiler.tools.AndroidDxRunner.main(AndroidDxRunner.java:336)
Error:Android Pre Dex: [httpclient-4.4.1.1.jar] at org.jetbrains.android.compiler.tools.AndroidDxRunner.runDex(AndroidDxRunner.java:136)
Error:Android Pre Dex: [httpclient-4.4.1.1.jar] at org.jetbrains.android.compiler.tools.AndroidDxRunner.loadDex(AndroidDxRunner.java:80)
Error:Android Pre Dex: [httpclient-4.4.1.1.jar] at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
Error:Android Pre Dex: [httpclient-4.4.1.1.jar] at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
Error:Android Pre Dex: [httpclient-4.4.1.1.jar] at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
Error:Android Pre Dex: [httpclient-4.4.1.1.jar] java.lang.ClassNotFoundException: com.android.dx.command.DxConsole
Error Occur at the time of Compiling the project in android studio. Its showing some dx.jar file error and some error which are unable to understand it. So please help me out from this error!
Error:Android Pre Dex: [annotations.jar] at java.net.URLClassLoader.run(URLClassLoader.java:372)
Error:Android Pre Dex: [annotations.jar] at java.net.URLClassLoader.run(URLClassLoader.java:361)
Information:05/07/2017 12:24 PM - Compilation completed with 13 errors and 0 warnings in 5s 253ms
Error:Android Pre Dex: [annotations.jar] Failed to load dx.jar
Error:Android Pre Dex: [annotations.jar] at java.security.AccessController.doPrivileged(Native Method)
Error:Android Pre Dex: [annotations.jar] java.lang.ClassNotFoundException: com.android.dx.command.DxConsole
Error:Android Pre Dex: [annotations.jar] at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
Error:Android Pre Dex: [annotations.jar] at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
Error:Android Pre Dex: [annotations.jar] at org.jetbrains.android.compiler.tools.AndroidDxRunner.loadDex(AndroidDxRunner.java:80)
Error:Android Pre Dex: [annotations.jar] at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
Error:Android Pre Dex: [annotations.jar] at org.jetbrains.android.compiler.tools.AndroidDxRunner.runDex(AndroidDxRunner.java:136)
Error:Android Pre Dex: [annotations.jar] Exception in thread "main" java.lang.NullPointerException
Error:Android Pre Dex: [annotations.jar] at org.jetbrains.android.compiler.tools.AndroidDxRunner.main(AndroidDxRunner.java:336)
Error:Android Pre Dex: [annotations.jar] at org.jetbrains.android.compiler.tools.AndroidDxRunner.runDex(AndroidDxRunner.java:139)
Information:java: Some input files use unchecked or unsafe operations.
Information:java: Recompile with -Xlint:unchecked for details.
G:\Kunal\Gaming\cocos2d\cocos\platform\android\java\src\org\cocos2dx\lib\Cocos2dxSound.java
我遇到了同样的问题。 遵循 this 解决方案并成功!
该解决方案适用于 Ubuntu 和 OSX,但我相信它也适用于 Windows。