- нижеприведенный код - это моя зависимость от сборки
- , интегрированная в соответствии с консолью разработчика.но я получаю сообщение об ошибке при открытии приложения (происходит сбой).
- при запуске приложения происходит сбой на главном экране.
- дает мне решение этой ошибки.
apply plugin: 'com.android.application'
//apply plugin: 'com.neenbedankt.android-apt'
android {
compileSdkVersion 28
packagingOptions {
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
}
defaultConfig {
applicationId "xxxxxxxxxxxx"
minSdkVersion 19
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
javaCompileOptions {
annotationProcessorOptions {
includeCompileClasspath true
}
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
packagingOptions {
exclude 'META-INF/rxjava.properties'
}
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
//noinspection GradleCompatible
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support:support-vector-drawable:27.1.1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.android.support:recyclerview-v7:27.1.1'
implementation 'com.android.support:cardview-v7:+'
implementation 'io.reactivex:rxandroid:1.0.1'
implementation 'com.android.support:cardview-v7:27.1.1'
implementation 'io.reactivex.rxjava2:rxandroid:2.0.1'
implementation 'io.reactivex.rxjava2:rxandroid:2.0.1'
implementation 'com.github.hotchemi:android-rate:1.0.1'
implementation 'com.contentful.java:java-sdk:9.0.1'
implementation 'com.jakewharton:butterknife:7.0.1'
implementation 'com.squareup.picasso:picasso:2.5.2'
annotationProcessor 'com.contentful.vault:core:3.0.1'
annotationProcessor 'com.contentful.vault:compiler:2.1.0'
implementation 'com.contentful.vault:core:3.0.1'
implementation 'com.romainpiel.shimmer:library:1.4.0@aar'
implementation 'com.google.android.gms:play-services-auth:16.0.1'
compile 'com.android.volley:volley:1.0.0'
compile 'com.google.android.gms:play-services-analytics:10.2.4'
implementation 'com.anjlab.android.iab.v3:library:1.0.44'
}
java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/common/internal/zzac;
at com.google.android.gms.internal.zzsc.zzan(Unknown Source)
at com.google.android.gms.analytics.GoogleAnalytics.getInstance(Unknown Source)
at com.monnfamily.libraryapp.BaseApplication.onCreate(BaseApplication.java:21)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1036)
- ошибка появилась ниже
- Я включил Google Analytics в свое приложение, но я получил эту ошибку.
- Пожалуйста, дайтемне любое предложение, чтобы очистить эту проблему
public final class BaseApplication extends Application {
private static BaseApplication mInstance;
private Activity mCurrentActivity = null;
private static GoogleAnalytics sAnalytics;
private static Tracker sTracker;
@Override
public void onCreate() {
super.onCreate();
sAnalytics = GoogleAnalytics.getInstance(this); //error got here
mInstance = this;
}
/**
* Gets the default {@link Tracker} for this {@link Application}.
* @return tracker
*/
synchronized public Tracker getDefaultTracker() {
// To enable debug logging use: adb shell setprop log.tag.GAv4 DEBUG
if (sTracker == null) {
sTracker = sAnalytics.newTracker(R.xml.global_tracker);
}
return sTracker;
}