代码之家  ›  专栏  ›  技术社区  ›  Abhijit Gujar

windows 7上的Android studio错误:意外的顶级异常

  •  0
  • Abhijit Gujar  · 技术社区  · 10 年前

    导入osland项目时出错:

    Error:Execution failed for task ':OsmAnd:preDexFreeLegacyArmv5Debug'.
    

    com.android.ide.common.internal.LoggedErrorException:无法运行命令: E: \Android\sdk\build tools\21.1.2\dx.bat--dex--force jumb--output E:\Android_test_projects\Osmand-master2\Osmand-master \Osmand-maint\build\intermediates\pre-redexed\freelegacyarmv5\debug\Osmand-java-Android-9c283cd307dbfef07359ccbde68a116b21f0b4f.jar E:\Andrid_test_pro jects\Osman-master2\Osmand maint\Osmand java\build\libs\Osmand-java-Android.jar 错误代码: 1. 输出: 意外的顶级异常: com.android.dx.cf.iface.Parse异常:错误的类文件magic(cafebabe)或版本(0034.0000) 位于com.android.dx.cf.direct.DirectClassFile.parse0(DirectClassFile.java:472) 位于com.android.dx.cf.direct.DirectClassFile.parse(DirectClassFile.java:406) 位于com.android.dx.cf.direct.DirectClassFile.parseToInterfacesIfNequire(DirectClassFile.java:388) 位于com.android.dx.cf.direct.DirectClassFile.getMagic(DirectClassFile.java:251) 位于com.android.dx.command.dexer.Main.processClass(Main.java:704) 位于com.android.dx.command.dexer.Main.processFileBytes(Main.java:673) 在com.android.dx.command.dexer.Main.access$300(Main.java:83) 在com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:602) 位于com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:284) 位于com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:166) 位于com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:144) 位于com.android.dx.command.dexer.Main.processOne(Main.java:632) 位于com.android.dx.command.dexer.Main.processAllFiles(Main.java:510) 在com.android.dx.command.dexer.Main.runMonoDex(Main.java:280) 在com.android.dx.command.dexer.Main.run(Main.java:246) 在com.android.dx.command.dexer.Main.Main(Main.java:215) 在com.android.dx.command.Main.Main(Main.java:106) …在分析com/google/protobuf/AbstractMessage$1.class时 1个错误;中止

    上述错误的原因是java1.8。将其更改为1.7后,我得到了这个运行时错误

          2-11 10:28:55.160  26327-26327/net.osmand V/Zygote﹕ Switching descriptor 34 to /dev/null
    02-11 10:28:55.160  26327-26327/net.osmand V/Zygote﹕ Switching descriptor 9 to /dev/null
    02-11 10:28:55.160  26327-26327/net.osmand D/dalvikvm﹕ Late-enabling CheckJNI
    02-11 10:28:55.200  26327-26327/net.osmand D/ActivityThread﹕ handleBindApplication:net.osmand
    02-11 10:28:55.200  26327-26327/net.osmand D/ActivityThread﹕ setTargetHeapUtilization:0.75
    02-11 10:28:55.200  26327-26327/net.osmand D/ActivityThread﹕ setTargetHeapMinFree:2097152
    02-11 10:28:55.260  26327-26327/net.osmand I/net.osmand﹕ ResourceManager Tiles to load in memory : 162.0
    02-11 10:28:55.350  26327-26327/net.osmand D/AndroidRuntime﹕ Shutting down VM
    02-11 10:28:55.350  26327-26327/net.osmand W/dalvikvm﹕ threadid=1: thread exiting with uncaught exception (group=0x41653db8)
    02-11 10:28:55.350  26327-26327/net.osmand E/AndroidRuntime﹕ FATAL EXCEPTION: main
        Process: net.osmand, PID: 26327
        java.lang.RuntimeException: Unable to create application net.osmand.plus.OsmandApplication: java.lang.IllegalStateException: java.lang.IllegalArgumentException: is == null
                at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4476)
                at android.app.ActivityThread.access$1500(ActivityThread.java:144)
                at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1265)
                at android.os.Handler.dispatchMessage(Handler.java:102)
                at android.os.Looper.loop(Looper.java:136)
                at android.app.ActivityThread.main(ActivityThread.java:5146)
                at java.lang.reflect.Method.invokeNative(Native Method)
                at java.lang.reflect.Method.invoke(Method.java:515)
                at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:796)
                at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:612)
                at dalvik.system.NativeStart.main(Native Method)
         Caused by: java.lang.IllegalStateException: java.lang.IllegalArgumentException: is == null
                at net.osmand.router.RoutingConfiguration.getDefault(RoutingConfiguration.java:171)
                at net.osmand.plus.helpers.AvoidSpecificRoads.getBuilder(AvoidSpecificRoads.java:44)
                at net.osmand.plus.helpers.AvoidSpecificRoads.<init>(AvoidSpecificRoads.java:38)
                at net.osmand.plus.OsmandApplication.onCreate(OsmandApplication.java:165)
                at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1007)
                at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4473)
                at android.app.ActivityThread.access$1500(ActivityThread.java:144)
                at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1265)
                at android.os.Handler.dispatchMessage(Handler.java:102)
                at android.os.Looper.loop(Looper.java:136)
                at android.app.ActivityThread.main(ActivityThread.java:5146)
                at java.lang.reflect.Method.invokeNative(Native Method)
                at java.lang.reflect.Method.invoke(Method.java:515)
                at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:796)
                at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:612)
                at dalvik.system.NativeStart.main(Native Method)
         Caused by: java.lang.IllegalArgumentException: is == null
                at org.kxml2.io.KXmlParser.setInput(KXmlParser.java:1625)
                at net.osmand.router.RoutingConfiguration.parseFromInputStream(RoutingConfiguration.java:184)
                at net.osmand.router.RoutingConfiguration.getDefault(RoutingConfiguration.java:169)
                at net.osmand.plus.helpers.AvoidSpecificRoads.getBuilder(AvoidSpecificRoads.java:44)
                at net.osmand.plus.helpers.AvoidSpecificRoads.<init>(AvoidSpecificRoads.java:38)
                at net.osmand.plus.OsmandApplication.onCreate(OsmandApplication.java:165)
                at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1007)
                at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4473)
                at android.app.ActivityThread.access$1500(ActivityThread.java:144)
                at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1265)
                at android.os.Handler.dispatchMessage(Handler.java:102)
                at android.os.Looper.loop(Looper.java:136)
                at android.app.ActivityThread.main(ActivityThread.java:5146)
                at java.lang.reflect.Method.invokeNative(Native Method)
                at java.lang.reflect.Method.invoke(Method.java:515)
                at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:796)
                at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:612)
                at dalvik.system.NativeStart.main(Native Method)
            02-11 10:29:42.570  26327-26334/net.osmand D/dalvikvm﹕ null clazz in OP_INSTANCE_OF, single-stepping
            02-11 10:33:27.190  26327-26327/net.osmand I/Process﹕ Sending signal. PID: 26327 SIG: 9
            02-11 10:34:10.670  26873-26873/net.osmand D/ActivityThread﹕ handleBindApplication:net.osmand
            02-11 10:34:10.670  26873-26873/net.osmand D/ActivityThread﹕ setTargetHeapUtilization:0.75
            02-11 10:34:10.670  26873-26873/net.osmand D/ActivityThread﹕ setTargetHeapMinFree:2097152
            02-11 10:34:10.740  26873-26873/net.osmand I/net.osmand﹕ ResourceManager Tiles to load in memory : 162.0
            02-11 10:34:10.840  26873-26873/net.osmand D/AndroidRuntime﹕ Shutting down VM
            02-11 10:34:10.840  26873-26873/net.osmand W/dalvikvm﹕ threadid=1: thread exiting with uncaught exception (group=0x41653db8)
            02-11 10:34:10.840  26873-26873/net.osmand E/AndroidRuntime﹕ FATAL EXCEPTION: main
                Process: net.osmand, PID: 26873
        java.lang.RuntimeException: Unable to create application net.osmand.plus.OsmandApplication: java.lang.IllegalStateException: java.lang.IllegalArgumentException: is == null
                at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4476)
                at android.app.ActivityThread.access$1500(ActivityThread.java:144)
                at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1265)
                at android.os.Handler.dispatchMessage(Handler.java:102)
                at android.os.Looper.loop(Looper.java:136)
                at android.app.ActivityThread.main(ActivityThread.java:5146)
                at java.lang.reflect.Method.invokeNative(Native Method)
                at java.lang.reflect.Method.invoke(Method.java:515)
                at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:796)
                at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:612)
                at dalvik.system.NativeStart.main(Native Method)
         Caused by: java.lang.IllegalStateException: java.lang.IllegalArgumentException: is == null
                at net.osmand.router.RoutingConfiguration.getDefault(RoutingConfiguration.java:171)
                at net.osmand.plus.helpers.AvoidSpecificRoads.getBuilder(AvoidSpecificRoads.java:44)
                at net.osmand.plus.helpers.AvoidSpecificRoads.<init>(AvoidSpecificRoads.java:38)
                at net.osmand.plus.OsmandApplication.onCreate(OsmandApplication.java:165)
                at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1007)
                at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4473)
                at android.app.ActivityThread.access$1500(ActivityThread.java:144)
                at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1265)
                at android.os.Handler.dispatchMessage(Handler.java:102)
                at android.os.Looper.loop(Looper.java:136)
                at android.app.ActivityThread.main(ActivityThread.java:5146)
                at java.lang.reflect.Method.invokeNative(Native Method)
                at java.lang.reflect.Method.invoke(Method.java:515)
                at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:796)
                at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:612)
                at dalvik.system.NativeStart.main(Native Method)
         Caused by: java.lang.IllegalArgumentException: is == null
                at org.kxml2.io.KXmlParser.setInput(KXmlParser.java:1625)
                at net.osmand.router.RoutingConfiguration.parseFromInputStream(RoutingConfiguration.java:184)
                at net.osmand.router.RoutingConfiguration.getDefault(RoutingConfiguration.java:169)
                at net.osmand.plus.helpers.AvoidSpecificRoads.getBuilder(AvoidSpecificRoads.java:44)
                at net.osmand.plus.helpers.AvoidSpecificRoads.<init>(AvoidSpecificRoads.java:38)
                at net.osmand.plus.OsmandApplication.onCreate(OsmandApplication.java:165)
                at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1007)
                at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4473)
                at android.app.ActivityThread.access$1500(ActivityThread.java:144)
                at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1265)
                at android.os.Handler.dispatchMessage(Handler.java:102)
                at android.os.Looper.loop(Looper.java:136)
                at android.app.ActivityThread.main(ActivityThread.java:5146)
                at java.lang.reflect.Method.invokeNative(Native Method)
                at java.lang.reflect.Method.invoke(Method.java:515)
                at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:796)
                at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:612)
                at dalvik.system.NativeStart.main(Native Method)
    02-11 10:34:58.010  26873-26880/net.osmand D/dalvikvm﹕ null clazz in OP_INSTANCE_OF, single-stepping
    
    1 回复  |  直到 10 年前
        1
  •  2
  •   Ontoshgo    9 年前

    我也遇到了同样的问题,我将所有.java类文件移到了根包中,所有错误都消失了。。。