应用在Android模拟器上显示,但在Real Device上崩溃,反之亦然

时间:2019-06-19 11:33:14

标签: android android-layout

我是Android Studio的新手。 Android版本是3.2.1。 我一直在开发一个使用API​​ 21的应用程序,并且刚刚完成我的数据库。然后在实际设备(Danny Genius Tablet)上运行该应用程序,即Lollipop(5.1),它只是使用应用程序包名称创建一个应用程序名称,并且通过显示消息“应用程序名称”已停止工作根本无法打开。 在尝试了许多解决方案之后,什么都没有发生。 当我在Tablet Logcat上运行它时,

06-20 19:06:30.162 716-737/? E/SensorService: activeConnections...
06-20 19:06:30.182 716-737/? E/SensorService: activeConnections...
06-20 19:06:30.182 716-737/? E/SensorService: activeConnections...
06-20 19:06:30.198 26859-26859/? E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.example.user.offlinemobilefinder, PID: 26859
    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.user.offlinemobilefinder/com.example.user.offlinemobilefinder.WelcomeScreen}: android.view.InflateException: Binary XML file line #9: Error inflating class <unknown>
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2521)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2595)
        at android.app.ActivityThread.access$800(ActivityThread.java:178)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1470)
        at android.os.Handler.dispatchMessage(Handler.java:111)
        at android.os.Looper.loop(Looper.java:194)
        at android.app.ActivityThread.main(ActivityThread.java:5631)
        at java.lang.reflect.Method.invoke(Native Method)
        at java.lang.reflect.Method.invoke(Method.java:372)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:959)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:754)
     Caused by: android.view.InflateException: Binary XML file line #9: Error inflating class <unknown>
        at android.view.LayoutInflater.createView(LayoutInflater.java:633)
        at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:55)
        at android.view.LayoutInflater.onCreateView(LayoutInflater.java:682)
        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:741)
        at android.view.LayoutInflater.rInflate(LayoutInflater.java:806)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:504)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:414)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:365)
        at android.support.v7.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:469)
        at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:140)
        at com.example.user.offlinemobilefinder.WelcomeScreen.onCreate(WelcomeScreen.java:19)
        at android.app.Activity.performCreate(Activity.java:6092)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1112)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2468)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2595) 
        at android.app.ActivityThread.access$800(ActivityThread.java:178) 
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1470) 
        at android.os.Handler.dispatchMessage(Handler.java:111) 
        at android.os.Looper.loop(Looper.java:194) 
        at android.app.ActivityThread.main(ActivityThread.java:5631) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at java.lang.reflect.Method.invoke(Method.java:372) 
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:959) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:754) 
     Caused by: java.lang.reflect.InvocationTargetException
        at java.lang.reflect.Constructor.newInstance(Native Method)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:288)
        at android.view.LayoutInflater.createView(LayoutInflater.java:607)
        at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:55) 
        at android.view.LayoutInflater.onCreateView(LayoutInflater.java:682) 
        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:741) 
        at android.view.LayoutInflater.rInflate(LayoutInflater.java:806) 
        at android.view.LayoutInflater.inflate(LayoutInflater.java:504) 
        at android.view.LayoutInflater.inflate(LayoutInflater.java:414) 
        at android.view.LayoutInflater.inflate(LayoutInflater.java:365) 
        at android.support.v7.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:469) 
        at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:140) 
        at com.example.user.offlinemobilefinder.WelcomeScreen.onCreate(WelcomeScreen.java:19) 
        at android.app.Activity.performCreate(Activity.java:6092) 
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1112) 
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2468) 
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2595) 
        at android.app.ActivityThread.access$800(ActivityThread.java:178) 
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1470) 
        at android.os.Handler.dispatchMessage(Handler.java:111) 
        at android.os.Looper.loop(Looper.java:194) 
        at android.app.ActivityThread.main(ActivityThread.java:5631) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at java.lang.reflect.Method.invoke(Method.java:372) 
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:959) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:754) 
     Caused by: android.content.res.Resources$NotFoundException: Resource "com.example.user.offlinemobilefinder:drawable/black" (7f060055)  is not a Drawable (color or path): TypedValue{t=0x1/d=0x7f060055 a=-1 r=0x7f060055}
        at android.content.res.Resources.loadDrawableForCookie(Resources.java:2690)
        at android.content.res.Resources.loadDrawable(Resources.java:2614)
        at android.content.res.TypedArray.getDrawable(TypedArray.java:749)
        at android.view.View.<init>(View.java:3791)
        at android.view.ViewGroup.<init>(ViewGroup.java:524)
        at android.widget.LinearLayout.<init>(LinearLayout.java:215)
        at android.widget.LinearLayout.<init>(LinearLayout.java:211)
        at android.widget.LinearLayout.<init>(LinearLayout.java:206)
        at java.lang.reflect.Constructor.newInstance(Native Method) 
        at java.lang.reflect.Constructor.newInstance(Constructor.java:288) 
        at android.view.LayoutInflater.createView(LayoutInflater.java:607) 
        at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:55) 
        at android.view.LayoutInflater.onCreateView(LayoutInflater.java:682) 
        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:741) 
        at android.view.LayoutInflater.rInflate(LayoutInflater.java:806) 
        at android.view.LayoutInflater.inflate(LayoutInflater.java:504) 
        at android.view.LayoutInflater.inflate(LayoutInflater.java:414) 
        at android.view.LayoutInflater.inflate(LayoutInflater.java:365) 
        at android.support.v7.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:469) 
        at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:140) 
        at com.example.user.offlinemobilefinder.WelcomeScreen.onCreate(WelcomeScreen.java:19) 
        at android.app.Activity.performCreate(Activity.java:6092) 
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1112) 
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2468) 
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2595) 
        at android.app.ActivityThread.access$800(ActivityThread.java:178) 
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1470) 
        at android.os.Handler.dispatchMessage(Handler.java:111) 
        at android.os.Looper.loop(Looper.java:194) 
        at android.app.ActivityThread.main(ActivityThread.java:5631) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at java.lang.reflect.Method.invoke(Method.java:372) 
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:959) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:754) 

0 个答案:

没有答案