我觉得奇怪的是,android的应用程序在模拟器上运行良好..
但在实际设备中,它会崩溃并发出以下错误(通过开发者控制台):
java.lang.Error: Unresolved compilation problem:
The import com.recipes cannot be resolved
at com.etraks.mauritianrecipes.app.SplashScreen.<init>(SplashScreen.java:3)
at java.lang.Class.newInstanceImpl(Native Method)
at java.lang.Class.newInstance(Class.java:1319)
at android.app.Instrumentation.newActivity(Instrumentation.java:1027)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1885)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1995)
at android.app.ActivityThread.access$600(ActivityThread.java:128)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1161)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4517)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:993)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:760)
at dalvik.system.NativeStart.main(Native Method)
我的问题是为什么模拟器上不会发生此类崩溃?
答案 0 :(得分:0)
如果您在jar文件中有导入com.recipes,请转到properties-&gt; javabuildpath-&gt; order并导出。如果尚未包含jar文件,请将其包括在内(标记为已选中)。