Kaushal Agarwal
Kaushal Agarwal

Reputation: 80

While integrating firebase data reference for images I encountered the below mentioned error

I looked all over the web and the possible solutions were to make the version of each firebase dependency the same but on doing so the same error is thrown.

Process: com.bookbud.hp.firebasebook, PID: 5025 java.lang.NoSuchMethodError: 
No virtual method zzUU()Z in class Lcom/google/firebase/FirebaseApp; or its 
super classes (declaration of 'com.google.firebase.FirebaseApp' appears in 
/data/app/com.bookbud.hp.firebasebook1/split_lib_dependencies_apk.apk:
classes5.dex) at 
com.google.firebase.database.FirebaseDatabase.getInstance(Unknown Source)at 
com.google.firebase.database.FirebaseDatabase.getInstance(Unknown Source)at 
com.bookbud.hp.firebasebook.MainActivity.onCreate(MainActivity.java:77)at 
android.app.Activity.performCreate(Activity.java:6760)at 
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1134)
at 
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2681)at 
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2814)at 
android.app.ActivityThread.-wrap12(ActivityThread.java)at 
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1527)at 
android.os.Handler.dispatchMessage(Handler.java:102)at 
android.os.Looper.loop(Looper.java:154)at 
android.app.ActivityThread.main(ActivityThread.java:6290)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)

Main Activity. The import statements and other unnecessary code have been omitted for simplicity.

package com.bookbud.hp.firebasebook;

import android.os.Handler;//others are also included

public class MainActivity extends AppCompatActivity implements 
SearchView.OnQueryTextListener,SwipeRefreshLayout.OnRefreshListener{
   private String n;
   private String c;
   private String a;
   private String cc;
   private String r;
   private String cn;
   private String e;
   private String p;
   private String d;
   private String i;
   private String contact;
   private String email;
   private String ed;
   private String pubi;
   private AdView mAdView;
   private SearchView mSearchView;
   private ListView listView ;
   private ArrayList<book> b;
   private SwipeRefreshLayout swipeRefreshLayout;
   boolean doubleBackToExitPressedOnce = false;
   private ShareActionProvider mShareActionProvider;

   @Override
   protected void onCreate(Bundle savedInstanceState) {
       super.onCreate(savedInstanceState);
       setContentView(R.layout.word_list);
       request.isTestDevice(MainActivity.this);

       mAdView = (AdView) findViewById(R.id.adView);
       AdRequest adRequest = new AdRequest.Builder().build();
       mAdView.loadAd(adRequest);
       listView = (ListView) findViewById(R.id.listview_with_fab);
       mSearchView = (SearchView) findViewById(R.id.searchView1);

       b = new ArrayList<book>();
       swipeRefreshLayout = (SwipeRefreshLayout) findViewById(R.id.swipe_refresh_layout);
       swipeRefreshLayout.setOnRefreshListener(this);
       swipeRefreshLayout.setRefreshing(true);

       DatabaseReference connectedRef = 
       FirebaseDatabase.getInstance().getReference(".info/connected");

Dependencies, all are the same version. I don't think I'm missing any.

compile 'com.google.android.gms:play-services-ads:10.2.1'
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.google.firebase:firebase-core:10.2.0'
compile 'com.google.firebase:firebase-ads:10.2.0'
compile 'com.google.firebase:firebase-database:10.2.0'
compile 'com.android.support:design:25.3.1'
compile 'com.google.firebase:firebase-appindexing:10.2.0'
compile 'com.google.firebase:firebase-storage:10.2.0'
compile 'com.google.firebase:firebase-auth:10.2.0'

Upvotes: 1

Views: 55

Answers (1)

chornge
chornge

Reputation: 2111

Your play-services-ads version is 10.2.1 but your firebase-ads version is 10.2.0.

They need to be the same version.

Upvotes: 1

Related Questions