2

Good evening!

Edited

Here's my situation:

I'm using FirebaseUI to store in FirebaseStorage and FirebaseDatabase, and retrieve from Database only. I'm trying to use a FloatingActionButton in activity_main.xml (actually is the FloatingActionButton included in the Basic Activity you choose once you start a project) to take a picture. But when I compile the next dependencies

compile 'com.firebaseui:firebase-ui-database:1.0.1' compile 'com.firebaseui:firebase-ui-storage:1.0.1' 

it's not possible to run the application. It appears this exception:

E/AndroidRuntime: FATAL EXCEPTION: main Process: mx.com.jamba.pruebas, PID: 22567 java.lang.RuntimeException: Unable to start activity ComponentInfo{mx.com.jamba.pruebas/mx.com.jamba.pruebas.MainActivity}: android.view.InflateException: Binary XML file line #27: Binary XML file line #27: Error inflating class android.support.design.widget.FloatingActionButton at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2426) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2490) at android.app.ActivityThread.access$900(ActivityThread.java:154) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1354) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:148) at android.app.ActivityThread.main(ActivityThread.java:5443) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:728) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618) Caused by: android.view.InflateException: Binary XML file line #27: Binary XML file line #27: Error inflating class android.support.design.widget.FloatingActionButton at android.view.LayoutInflater.inflate(LayoutInflater.java:539) at android.view.LayoutInflater.inflate(LayoutInflater.java:423) at android.view.LayoutInflater.inflate(LayoutInflater.java:374) at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:284) at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:143) at mx.com.jamba.pruebas.MainActivity.onCreate(MainActivity.java:71) at android.app.Activity.performCreate(Activity.java:6259) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1130) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2379) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2490)  at android.app.ActivityThread.access$900(ActivityThread.java:154)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1354)  at android.os.Handler.dispatchMessage(Handler.java:102)  at android.os.Looper.loop(Looper.java:148)  at android.app.ActivityThread.main(ActivityThread.java:5443)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:728)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)  Caused by: android.view.InflateException: Binary XML file line #27: Error inflating class android.support.design.widget.FloatingActionButton at android.view.LayoutInflater.createView(LayoutInflater.java:645) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:764) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704) at android.view.LayoutInflater.rInflate(LayoutInflater.java:835) at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798) at android.view.LayoutInflater.inflate(LayoutInflater.java:515) at android.view.LayoutInflater.inflate(LayoutInflater.java:423)  at android.view.LayoutInflater.inflate(LayoutInflater.java:374)  at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:284)  at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:143)  at mx.com.jamba.pruebas.MainActivity.onCreate(MainActivity.java:71)  at android.app.Activity.performCreate(Activity.java:6259)  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1130)  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2379)  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2490)  at android.app.ActivityThread.access$900(ActivityThread.java:154)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1354)  at android.os.Handler.dispatchMessage(Handler.java:102)  at android.os.Looper.loop(Looper.java:148)  at android.app.ActivityThread.main(ActivityThread.java:5443)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:728)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)  Caused by: java.lang.reflect.InvocationTargetException at java.lang.reflect.Constructor.newInstance(Native Method) at android.view.LayoutInflater.createView(LayoutInflater.java:619) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:764)  at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704)  at android.view.LayoutInflater.rInflate(LayoutInflater.java:835)  at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798)  at android.view.LayoutInflater.inflate(LayoutInflater.java:515)  at android.view.LayoutInflater.inflate(LayoutInflater.java:423)  at android.view.LayoutInflater.inflate(LayoutInflater.java:374)  at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:284)  at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:143)  at mx.com.jamba.pruebas.MainActivity.onCreate(MainActivity.java:71)  at android.app.Activity.performCreate(Activity.java:6259)  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1130)  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2379)  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2490)  at android.app.ActivityThread.access$900(ActivityThread.java:154)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1354)  at android.os.Handler.dispatchMessage(Handler.java:102)  at android.os.Looper.loop(Looper.java:148)  at android.app.ActivityThread.main(ActivityThread.java:5443)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:728)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)  Caused by: java.lang.NoSuchMethodError: No direct method <init>(Landroid/widget/ImageView;Landroid/support/v7/widget/AppCompatDrawableManager;)V in class Landroid/support/v7/widget/AppCompatImageHelper; or its super classes (declaration of 'android.support.v7.widget.AppCompatImageHelper' appears in /data/data/mx.com.jamba.pruebas/files/instant-run/dex/slice-com.android.support-appcompat-v7-25.0.1_3703da7076adad9ae91e29d9a19b5ed5b7cb0669-classes.dex) at android.support.design.widget.FloatingActionButton.<init>(FloatingActionButton.java:133) at android.support.design.widget.FloatingActionButton.<init>(FloatingActionButton.java:110) at java.lang.reflect.Constructor.newInstance(Native Method)  at android.view.LayoutInflater.createView(LayoutInflater.java:619)  at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:764)  at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704)  at android.view.LayoutInflater.rInflate(LayoutInflater.java:835)  at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798)  at android.view.LayoutInflater.inflate(LayoutInflater.java:515)  at android.view.LayoutInflater.inflate(LayoutInflater.java:423)  at android.view.LayoutInflater.inflate(LayoutInflater.java:374)  at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:284)  at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:143)  at mx.com.jamba.pruebas.MainActivity.onCreate(MainActivity.java:71)  at android.app.Activity.performCreate(Activity.java:6259)  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1130)  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2379)  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2490)  at android.app.ActivityThread.access$900(ActivityThread.java:154)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1354)  at android.os.Handler.dispatchMessage(Handler.java:102)  at android.os.Looper.loop(Looper.java:148)  at android.app.ActivityThread.main(ActivityThread.java:5443)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:728)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618) 

The only line of code that the exception points in my code is the #71, and it has the following piece of code:

 setContentView(R.layout.activity_main); 

This is my Style.xml

<resources> <!-- Base application theme. --> <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> <!-- Customize your theme here. --> <item name="colorPrimary">@color/colorPrimary</item> <item name="colorPrimaryDark">@color/colorPrimaryDark</item> <item name="colorAccent">@color/colorAccent</item> </style> <style name="AppTheme.NoActionBar"> <item name="windowActionBar">false</item> <item name="windowNoTitle">true</item> </style> <style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" /> <style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" /> </resources> 

Also, this is my FloatingActionButton in activity_main.xml:

<android.support.design.widget.FloatingActionButton android:layout_width="wrap_content" android:layout_height="wrap_content" android:clickable="true" app:fabSize="normal" app:backgroundTint="@color/colorAccent" android:layout_gravity="bottom|right" app:srcCompat="@android:drawable/ic_dialog_dialer" android:id="@+id/floatingActionButton" /> 

The problem is that when I try to Run 'app' in my Moto G4 Android 6.0.1, the application crashes. I dedicated a little time to compile the project dependency by dependency and I realized that when I erase the FirebaseUI dependencies the application was executed, but without FurebaseUI functions. The way that I found to execute the application was erase the FloatingActionButton and use a normal Button instead, but I need a FloatingActionButton.

If you guys need more info or code, comment and I'll gladly put it in the post!

11
  • 1
    So what's the error message? What's your layout that doesn't work? What theme are you using? How are you using FirebaseUI? Commented Dec 9, 2016 at 3:45
  • Hello! @ianhanniballake I edited the post, I hope the post is clearer now. Commented Dec 9, 2016 at 4:12
  • 2
    Add more of the exception. Look for lines with "Caused by" Commented Dec 9, 2016 at 4:13
  • @cricket_007 done! exception edited :) Commented Dec 9, 2016 at 4:27
  • Looks like it can't find the constructor for the FloatingActionButton... NoSuchMethodError. FloatingActionButton.<init> Commented Dec 9, 2016 at 4:31

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.