Layout Problem.

D

DmanT

Neues Mitglied
Threadstarter
Hallo,

Ich habe eine App erstellt. Diese läuft bei mir ohne Probleme (Sony, Android 8) auf einem älteren Gerät gedoch (Android 4) stürzt das ganze ab.

Logcat zeigt mir folgendes:

Code:
   java.lang.RuntimeException: Unable to start activity ComponentInfo{ovh.xxxxx.xxxxx.xxxxx/ovh.xxxxx.xxxxxxxx.xxxxxx.MainActivity}: android.view.InflateException: Binary XML file line #20: Error inflating class android.support.design.widget.BottomNavigationView
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2295)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2349)
        at android.app.ActivityThread.access$700(ActivityThread.java:159)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1316)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at android.os.Looper.loop(Looper.java:176)
        at android.app.ActivityThread.main(ActivityThread.java:5419)
        at java.lang.reflect.Method.invokeNative(Native Method)
        at java.lang.reflect.Method.invoke(Method.java:525)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1046)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:862)
        at dalvik.system.NativeStart.main(Native Method)
     Caused by: android.view.InflateException: Binary XML file line #20: Error inflating class android.support.design.widget.BottomNavigationView
        at android.view.LayoutInflater.createView(LayoutInflater.java:626)
        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:702)
        at android.view.LayoutInflater.rInflate(LayoutInflater.java:761)
        at android.view.LayoutInflater.rInflate(LayoutInflater.java:769)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:498)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:398)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:354)
        at android.support.v7.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:469)
        at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:140)
        at ovh.xxxxx.xxxxxx.xxxxxx.MainActivity.onCreate(MainActivity.java:72)
        at android.app.Activity.performCreate(Activity.java:5372)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1104)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2257)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2349) 
        at android.app.ActivityThread.access$700(ActivityThread.java:159) 
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1316) 
        at android.os.Handler.dispatchMessage(Handler.java:99) 
        at android.os.Looper.loop(Looper.java:176) 
        at android.app.ActivityThread.main(ActivityThread.java:5419) 
        at java.lang.reflect.Method.invokeNative(Native Method) 
        at java.lang.reflect.Method.invoke(Method.java:525) 
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1046) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:862) 
        at dalvik.system.NativeStart.main(Native Method) 
     Caused by: java.lang.reflect.InvocationTargetException
        at java.lang.reflect.Constructor.constructNative(Native Method)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
        at android.view.LayoutInflater.createView(LayoutInflater.java:600)
        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:702) 
        at android.view.LayoutInflater.rInflate(LayoutInflater.java:761) 
        at android.view.LayoutInflater.rInflate(LayoutInflater.java:769) 
        at android.view.LayoutInflater.inflate(LayoutInflater.java:498) 
        at android.view.LayoutInflater.inflate(LayoutInflater.java:398) 
        at android.view.LayoutInflater.inflate(LayoutInflater.java:354) 
        at android.support.v7.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:469) 
        at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:140) 
        at ovh.dmant.mykstart.k_start.MainActivity.onCreate(MainActivity.java:72) 
        at android.app.Activity.performCreate(Activity.java:5372) 
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1104) 
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2257) 
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2349) 
        at android.app.ActivityThread.access$700(ActivityThread.java:159) 
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1316) 
        at android.os.Handler.dispatchMessage(Handler.java:99) 
        at android.os.Looper.loop(Looper.java:176) 
        at android.app.ActivityThread.main(ActivityThread.java:5419) 
        at java.lang.reflect.Method.invokeNative(Native Method) 
        at java.lang.reflect.Method.invoke(Method.java:525) 
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1046) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:862) 
        at dalvik.system.NativeStart.main(Native Method) 
     Caused by: android.content.res.Resources$NotFoundException: File res/drawable/home_icon_selector.xml from drawable resource ID #0x7f07007b
        at android.content.res.Resources.loadDrawable(Resources.java:2974)
        at android.content.res.Resources.getDrawable(Resources.java:1558)
        at android.support.v4.content.ContextCompat.getDrawable(ContextCompat.java:465)
        at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:203)
        at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:191)
        at android.support.v7.content.res.AppCompatResources.getDrawable(AppCompatResources.java:102)
        at android.support.v7.view.menu.MenuItemImpl.getIcon(MenuItemImpl.java:505)
        at android.support.design.internal.BottomNavigationItemView.initialize(BottomNavigationItemView.java:105)
        at android.support.design.internal.BottomNavigationMenuView.buildMenuView(BottomNavigationMenuView.java:523)
        at android.support.design.internal.BottomNavigationPresenter.updateMenuView(BottomNavigationPresenter.java:62)
        at android.support.design.widget.BottomNavigationView.inflateMenu(BottomNavigationView.java:254)
        at android.support.design.widget.BottomNavigationView.<init>(BottomNavigationView.java:187)
        at android.support.design.widget.BottomNavigationView.<init>(BottomNavigationView.java:114)
        at java.lang.reflect.Constructor.constructNative(Native Method) 
        at java.lang.reflect.Constructor.newInstance(Constructor.java:417) 
        at android.view.LayoutInflater.createView(LayoutInflater.java:600) 
        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:702) 
        at android.view.LayoutInflater.rInflate(LayoutInflater.java:761) 
        at android.view.LayoutInflater.rInflate(LayoutInflater.java:769) 
        at android.view.LayoutInflater.inflate(LayoutInflater.java:498) 
        at android.view.LayoutInflater.inflate(LayoutInflater.java:398) 
        at android.view.LayoutInflater.inflate(LayoutInflater.java:354) 
        at android.support.v7.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:469) 
        at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:140) 
        at ovh.xxxxxxx.xxxxxx.k_start.MainActivity.onCreate(MainActivity.java:72) 
        at android.app.Activity.performCreate(Activity.java:5372) 
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1104) 
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2257) 
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2349) 
        at android.app.ActivityThread.access$700(ActivityThread.java:159) 
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1316) 
        at android.os.Handler.dispatchMessage(Handler.java:99) 
        at android.os.Looper.loop(Looper.java:176) 
        at android.app.ActivityThread.main(ActivityThread.java:5419) 
        at java.lang.reflect.Method.invokeNative(Native Method) 
        at java.lang.reflect.Method.invoke(Method.java:525) 
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1046) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:862) 
        at dalvik.system.NativeStart.main(Native Method) 
     Caused by: android.content.res.Resources$NotFoundException: File res/drawable/ic_home_inactive.xml from drawable resource ID #0x7f07007f
        at android.content.res.Resources.loadDrawable(Resources.java:2974)
        at android.content.res.Resources.getDrawable(Resources.java:1558)
    	at
 
swa00

swa00

Moderator
Teammitglied
Hallo DmanT,

deine Fehlermeldung gibt bereits schon den Grund an - die Grafik API kann unter Android 4 nicht verwendet werden .

Binary XML file line #20: Error inflating class android.support.design.widget.BottomNavigationView
Du musst also für Android 4 Dir was Anderes einfallen lassen .
 
Oben Unten