首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >windows 7上的Android studio错误:意外的顶级异常

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

Stack Overflow用户
提问于 2015-02-10 19:16:02
回答 1查看 605关注 0票数 0

导入osmand项目时发生了错误:

代码语言:javascript
复制
Error:Execution failed for task ':OsmAnd:preDexFreeLegacyArmv5Debug'.

com.android.ide.common.internal.LoggedErrorException:未能运行命令:e:\Android\build-tools\21.1.2\dx.bat-dex-强制输出E:\Android_test_projects\Osmand-master2\Osmand-master\OsmAnd\build\intermediates\pre-dexed\freelegacyarmv5\debug\OsmAnd-java-android-9c283cd307dbfef07359ccbde68a116b21ff0b4f.jar E:\Android_test_projects\Osmand-master2\Osmand-master\OsmAnd-java\build\libs\OsmAnd-java-错误代码:1输出:意外的顶级异常: com.android.dx.cf.direct.DirectClassFile.parse0(DirectClassFile.java:472) at com.android.dx.cf.direct.DirectClassFile.parse(DirectClassFile.java:406) at com.android.dx.cf.direct的com.android.dx.cf.iface.ParseException:坏类文件魔术( android.jar )或版本(0034.0000)。DirectClassFile.parseToInterfacesIfNecessary(DirectClassFile.java:388) at com.android.dx.cf.direct.DirectClassFile.getMagic(DirectClassFile.java:251) at com.android.dx.command.dexer.Main.processClass(Main.java:704) at com.android.dx.command.dexer.Main.processFileBytes(Main.java:673) at com.android.dx.command.dexer.Main.access$300(Main.java:83) atcom.android.dx.command.dexer.Main$1.processFileBytes(Main.java:602) at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:284) at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:166) at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:144) at com.android.dx.command.dexer.Main.processOne(Main.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/ ...while /protobuf/AbstractMessage$1.class 1错误;流产

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

代码语言:javascript
复制
      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
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2015-10-04 12:45:01

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

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/28439955

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档