I find my solution after many failures. The dependencies use those -
compile 'com.google.firebase:firebase-core:11.0.1'
compile 'com.google.firebase:firebase-database:11.0.1'
compile 'com.android.support:multidex:1.0.1'
compile 'com.google.android.gms:play-services:11.0.1'
and then add multiDexEnabled trueinbuild.gradle
then add this line to buildscript-
classpath 'com.google.gms:google-services:3.1.0'
classpath 'com.google.firebase:firebase-plugins:1.0.4'
there also add in allprojects-
maven {
url "https://maven.google.com"
}
, -
public class AppUtils extends Application {
@Override
public void onCreate() {
super.onCreate();
FirebaseApp.initializeApp(getApplicationContext());
}
}
AndroidManifest, -
android:name=".AppUtils"
.