Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BottomBar crashes when "minSdkVersion" is set to 21 #870

Open
Drakuwa opened this issue Nov 14, 2017 · 1 comment
Open

BottomBar crashes when "minSdkVersion" is set to 21 #870

Drakuwa opened this issue Nov 14, 2017 · 1 comment

Comments

@Drakuwa
Copy link

Drakuwa commented Nov 14, 2017

Here's the stack trace from the Exception:

E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.debug, PID: 24921
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.debug/com.example.activities.MainActivity}: android.view.InflateException: Binary XML file line #0: Binary XML file line #0: Error inflating class com.roughike.bottombar.BottomBar
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2762)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2848)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1552)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6334)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
Caused by: android.view.InflateException: Binary XML file line #0: Binary XML file line #0: Error inflating class com.roughike.bottombar.BottomBar
Caused by: android.view.InflateException: Binary XML file line #0: Error inflating class com.roughike.bottombar.BottomBar
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Constructor.newInstance0(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:430)
at android.view.LayoutInflater.createView(LayoutInflater.java:645)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:787)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:727)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:858)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:821)
at android.view.LayoutInflater.inflate(LayoutInflater.java:518)
at android.view.LayoutInflater.inflate(LayoutInflater.java:426)
at android.view.LayoutInflater.inflate(LayoutInflater.java:377)
at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:287)
at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:139)
at com.example.activities.MainActivity.onCreate(MainActivity.kt:60)
at android.app.Activity.performCreate(Activity.java:6743)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1134)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2715)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2848)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1552)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6334)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
Caused by: java.lang.NoSuchFieldError: No field bb_bottom_bar_shadow of type I in class Lcom/roughike/bottombar/R$id; or its superclasses (declaration of 'com.roughike.bottombar.R$id' appears in /data/app/com.example.debug-1/base.apk)
at com.roughike.bottombar.BottomBar.initializeViews(BottomBar.java:270)
at com.roughike.bottombar.BottomBar.init(BottomBar.java:140)
at com.roughike.bottombar.BottomBar.(BottomBar.java:127)
at com.roughike.bottombar.BottomBar.(BottomBar.java:122)
at java.lang.reflect.Constructor.newInstance0(Native Method) 
at java.lang.reflect.Constructor.newInstance(Constructor.java:430) 
at android.view.LayoutInflater.createView(LayoutInflater.java:645) 
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:787) 
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:727) 
at android.view.LayoutInflater.rInflate(LayoutInflater.java:858) 
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:821) 
at android.view.LayoutInflater.inflate(LayoutInflater.java:518) 
at android.view.LayoutInflater.inflate(LayoutInflater.java:426) 
at android.view.LayoutInflater.inflate(LayoutInflater.java:377) 
at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:287) 
at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:139) 
at com.example.activities.MainActivity.onCreate(MainActivity.kt:60) // This is the setContentView(R.layout.activity_main) line from the onCreate() method
at android.app.Activity.performCreate(Activity.java:6743) 
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1134) 
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2715) 
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2848) 
at android.app.ActivityThread.-wrap12(ActivityThread.java) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1552) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:154) 
at android.app.ActivityThread.main(ActivityThread.java:6334) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)

The crash doesn't happen when I set minSdkVersion 17

EDIT:
Since the bb_bottom_bar_shadow is mentioned in the stack trace as a "Cause", I tried removing the app:bb_showShadow="true" from the layout, which ended in the same crash.

Worth mentioning is that the layout I use only has the most basic width, height, alignParentBottom and bb_tabXmlResource attributes added and it lives in a RelativeLayout parent.

I'm using bottom-bar:2.3.1

@Drakuwa
Copy link
Author

Drakuwa commented Nov 14, 2017

From what I can see here: https://github.com/roughike/BottomBar/blob/master/bottom-bar/src/main/java/com/roughike/bottombar/BottomBar.java#L270 shadowView is the only one not looking into rootView to find the desired View with given id (bb_bottom_bar_shadow), which could be the cause of the java.lang.NoSuchFieldError. Maybe the bb_bottom_bar_shadow id is present somewhere in a local layout (highly unlikely...)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant