This is my project gradle
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'com.google.gms:google-services:4.1.0'
}
}
allprojects {
repositories {
jcenter()
maven {
url 'https://maven.google.com/'
}
google()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
This is my app gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
buildToolsVersion '28.0.3'
defaultConfig {
applicationId 'com.ramin.quiz'
minSdkVersion 15
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.google.firebase:firebase-database:11.8.0'
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
//noinspection GradleCompatible
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'
testImplementation 'junit:junit:4.12'
//noinspection UseOfBundledGooglePlayServices
// implementation 'com.google.android.gms:play-services-analytics:16.0.4'
implementation 'com.google.android.gms:play-services:12.0.1'
implementation 'com.mcxiaoke.volley:library:1.0.18'
implementation 'com.google.code.gson:gson:2.8.5'
implementation 'com.android.support:cardview-v7:28.0.0'
implementation 'com.github.bluejamesbond:textjustify-android:2.1.1'
implementation 'com.nineoldandroids:library:2.4.0'
implementation 'com.daimajia.easing:library:1.0.1@aar'
implementation 'com.daimajia.androidanimations:library:1.1.3@aar'
//compile 'com.google.android.gms:play-services-appstate:7.3.0'
implementation 'com.google.firebase:firebase-auth:16.0.5'
implementation 'com.google.firebase:firebase-core:16.0.4'
implementation 'com.facebook.android:facebook-android-sdk:4.38.0'
implementation 'com.squareup.picasso:picasso:2.71828'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:multidex:1.0.3'
implementation 'com.google.android.gms:play-services-ads:17.0.0'
implementation 'com.google.android.gms:play-services-auth:16.0.1'
androidTestImplementation 'com.android.support:multidex-instrumentation:1.0.3'
}
apply plugin: 'com.google.gms.google-services'
This line get error on MainApplication.class
GoogleAnalytics analytics = GoogleAnalytics.getInstance(MainApplication.this);
This line get error on menuHomeScreenActivity.class
Tracker mTracker = application.getDefaultTracker();
my logcat:
10-27 19:55:14.008 17432-17432/com.ramin.quiz E/UncaughtException: java.lang.NoClassDefFoundError: Failed resolution of:
Lcom/google/android/gms/common/internal/zzbq; at com.google.android.gms.internal.zzark.zzbl(Unknown Source:0) at com.google.android.gms.analytics.GoogleAnalytics.getInstance(Unknown Source:0) at com.ramin.quiz.application.MainApplication.getDefaultTracker(MainApplication.java:40) at com.ramin.quiz.activity.MenuHomeScreenActivity.onCreate(MenuHomeScreenActivity.java:153) at android.app.Activity.performCreate(Activity.java:7009) at android.app.Activity.performCreate(Activity.java:7000) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1214) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2731) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2856) at android.app.ActivityThread.-wrap11(Unknown Source:0) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:164) at android.app.ActivityThread.main(ActivityThread.java:6494) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807) Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.common.internal.zzbq" on path: DexPathList[[zip file "/data/app/com.ramin.quiz-RNjLhiGfgiVubfbHvVcKDQ==/base.apk", zip file "/data/app/com.ramin.quiz-RNjLhiGfgiVubfbHvVcKDQ==/split_lib_dependencies_apk.apk", zip file "/data/app/com.ramin.quiz-RNjLhiGfgiVubfbHvVcKDQ==/split_lib_resources_apk.apk", zip file "/data/app/com.ramin.quiz-RNjLhiGfgiVubfbHvVcKDQ==/split_lib_slice_0_apk.apk", zip file "/data/app/com.ramin.quiz-RNjLhiGfgiVubfbHvVcKDQ==/split_lib_slice_1_apk.apk", zip file "/data/app/com.ramin.quiz-RNjLhiGfgiVubfbHvVcKDQ==/split_lib_slice_2_apk.apk", zip file "/data/app/com.ramin.quiz-RNjLhiGfgiVubfbHvVcKDQ==/split_lib_slice_3_apk.apk", zip file "/data/app/com.ramin.quiz-RNjLhiGfgiVubfbHvVcKDQ==/split_lib_slice_4_apk.apk", zip file "/data/app/com.ramin.quiz-RNjLhiGfgiVubfbHvVcKDQ==/split_lib_slice_5_apk.apk", zip file "/data/app/com.ramin.quiz-RNjLhiGfgiVubfbHvVcKDQ==/split_lib_slice_6_apk.apk", zip file "/data/app/com.ramin.quiz-RNjLhiGfgiVubfbHvVcKDQ==/split_lib_slice_7_apk.apk", zip file "/data/app/com.ramin.quiz-RNjLhiGfgiVubfbHvVcKDQ==/split_lib_slice_8_apk.apk", zip file "/data/app/com.ramin.quiz-RNjLhiGfgiVubfbHvVcKDQ==/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/data/app/com.ramin.quiz-RNjLhiGfgiVubfbHvVcKDQ==/lib/x86, /system/lib, /vendor/lib]] at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:125) at java.lang.ClassLoader.loadClass(ClassLoader.java:379) at java.lang.ClassLoader.loadClass(ClassLoader.java:312) at com.google.android.gms.internal.zzark.zzbl(Unknown Source:0) at com.google.android.gms.analytics.GoogleAnalytics.getInstance(Unknown Source:0) at com.ramin.quiz.application.MainApplication.getDefaultTracker(MainApplication.java:40) at com.ramin.quiz.activity.MenuHomeScreenActivity.onCreate(MenuHomeScreenActivity.java:153) at android.app.Activity.performCreate(Activity.java:7009) at android.app.Activity.performCreate(Activity.java:7000) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1214) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2731) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2856) at android.app.ActivityThread.-wrap11(Unknown Source:0) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:164) at android.app.ActivityThread.main(ActivityThread.java:6494) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807) Suppressed: java.io.IOException: No original dex files found for dex location /data/app/com.ramin.quiz-RNjLhiGfgiVubfbHvVcKDQ==/split_lib_resources_apk.apk