1

App closes on adding wrapper class to manifest. On removal of the class it works perfectly fine.

the class that needs to be added :

public class App extends Application {

    @Override
    public void onCreate() {
        super.onCreate();

        final FirebaseRemoteConfig remoteConfig = FirebaseRemoteConfig.getInstance();
        Map<String,Object> defaultValue = new HashMap<>();
        defaultValue.put(UpdateHelper.KEY_UPDATE_ENABLE,false);
        defaultValue.put(UpdateHelper.KEY_UPDATE_VERSION,"1.0");
        defaultValue.put(UpdateHelper.KEY_UPDATE_URL,"play url");

        remoteConfig.setDefaults(defaultValue);
        remoteConfig.fetch(5).addOnCompleteListener(new OnCompleteListener<Void>() {
            @Override
            public void onComplete(@NonNull Task<Void> task) {
                if(task.isSuccessful()){
                    remoteConfig.activateFetched();
                }
            }
        });
    }
}

manifest :

<application
        android:name="com.abc.App"
        android:allowBackup="true"
        android:icon="@drawable/logo"
        android:label="@string/app_name"
        android:roundIcon="@drawable/logo"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">

stack trace :

java.lang.Class<com.google.android.gms.internal.zzevx>: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/internal/zzfhe;
2019-04-26 08:35:28.661 9940-9940/com.abc I/art:     at com.google.firebase.remoteconfig.FirebaseRemoteConfig com.google.firebase.remoteconfig.FirebaseRemoteConfig.getInstance() ((null):-1)
2019-04-26 08:35:28.661 9940-9940/com.abc I/art:     at void com.abc.App.onCreate() (App.java:18)

line 18 -> final FirebaseRemoteConfig remoteConfig = FirebaseRemoteConfig.getInstance();

Samuel Robert
  • 7,119
  • 7
  • 34
  • 52

1 Answers1

0

You need to update this dependency in app/gradle

Remote Config :

com.google.firebase:firebase-config:16.5.0
coroutineDispatcher
  • 5,134
  • 2
  • 16
  • 50
Venky
  • 1,440
  • 4
  • 13
  • 24