gpt4 book ai didi

android - : Ldagger/internal/Preconditions 解析失败

转载 作者:太空狗 更新时间:2023-10-29 14:41:52 26 4
gpt4 key购买 nike

我的应用程序运行良好,但由于我的操作系统 Debian 出现问题,我决定重新安装它并选择安装 Ubuntu-16.04 而不是最后一个 Debian。现在一切正常。

问题是我的 android 应用程序。重新安装 android-studio 稳定版后,我无法再测试我的应用程序。

为什么?因为每次启动应用程序时,我都会收到此错误。我不知道这意味着什么,在互联网上搜索了一番之后,我没有找到任何地方。

这是堆栈跟踪:

10-13 07:47:10.749 1631-1631/com.gre E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.gre, PID: 1631
java.lang.NoClassDefFoundError: Failed resolution of: Ldagger/internal/Preconditions;
at com.gre.di.components.DaggerApplicationComponent$Builder.applicationModule(DaggerApplicationComponent.java:209)
at com.gre.GreApplication.onCreate(GreApplication.java:47)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1012)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4593)
at android.app.ActivityThread.access$1600(ActivityThread.java:154)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1382)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5294)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:904)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:699)
Caused by: java.lang.ClassNotFoundException: Didn't find class "dagger.internal.Preconditions" on path: DexPathList[[zip file "/data/app/com.gre-1/base.apk", zip file "/data/app/com.gre-1/split_lib_dependencies_apk.apk", zip file "/data/app/com.gre-1/split_lib_slice_0_apk.apk", zip file "/data/app/com.gre-1/split_lib_slice_1_apk.apk", zip file "/data/app/com.gre-1/split_lib_slice_2_apk.apk", zip file "/data/app/com.gre-1/split_lib_slice_3_apk.apk", zip file "/data/app/com.gre-1/split_lib_slice_4_apk.apk", zip file "/data/app/com.gre-1/split_lib_slice_5_apk.apk", zip file "/data/app/com.gre-1/split_lib_slice_6_apk.apk", zip file "/data/app/com.gre-1/split_lib_slice_7_apk.apk", zip file "/data/app/com.gre-1/split_lib_slice_8_apk.apk", zip file "/data/app/com.gre-1/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/data/app/com.gre-1/lib/arm, /vendor/lib, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
at com.gre.di.components.DaggerApplicationComponent$Builder.applicationModule(DaggerApplicationComponent.java:209) 
at com.gre.GreApplication.onCreate(GreApplication.java:47) 
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1012) 
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4593) 
at android.app.ActivityThread.access$1600(ActivityThread.java:154) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1382) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:135) 
at android.app.ActivityThread.main(ActivityThread.java:5294) 
at java.lang.reflect.Method.invoke(Native Method) 
at java.lang.reflect.Method.invoke(Method.java:372) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:904) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:699) 
Suppressed: java.lang.ClassNotFoundException: dagger.internal.Preconditions
at java.lang.Class.classForName(Native Method)
at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
... 14 more
Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available

请问如何解决??

这是我的build.gradle文件

    apply plugin: 'com.android.application'
apply plugin: 'realm-android'
// apply plugin: 'com.neenbedankt.android-apt'

android {
compileSdkVersion 25
buildToolsVersion '25.0.2' // '23.0.2'

defaultConfig {
applicationId "com.gre"
minSdkVersion 15
targetSdkVersion 25
versionCode 1
versionName "1.0"
multiDexEnabled true

}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}

/*debug {
applicationIdSuffix ".debug"
}*/

/**
* The 'initWith' property allows you to copy configurations from other build types,
* so you don't have to configure one from the beginning. You can then configure
* just the settings you want to change. The following line initializes
* 'jnidebug' using the debug build type, and changes only the
* applicationIdSuffix and versionNameSuffix settings.
*/

jnidebug {

// This copies the debuggable attribute and debug signing configurations.
initWith debug

applicationIdSuffix ".jnidebug"
jniDebuggable true
}
}
dexOptions {
// javaMaxHeapSize "2048M"
javaMaxHeapSize "4g"
}
configurations.all {
// all*.exclude group: 'com.squareup.okhttp3', module: 'okhttp'configurations.all {
// OkHttp 3.5.0+ includes the websockets API, so we need this to prevent a conflict
exclude module: 'okhttp-ws'
}
}

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile('io.socket:socket.io-client:0.8.1') {
exclude group: 'org.json', module: 'json'
}

/*compile 'com.google.android.gms:play-services-auth:10.0.1'
compile 'com.google.android.gms:play-services-maps:10.0.1'
compile 'com.google.android.gms:play-services-appindexing:10.0.1'*/

// compile 'com.android.support.constraint:constraint-layout:1.0.2'

// Android
// Glide

// Facebook Stetho
// OkHttp
// SquareUp
// Rx
// Dragger
// Realm

// RippleButton
compile 'com.balysv:material-ripple:1.0.2'
compile 'com.android.support:appcompat-v7:'
compile "com.android.support:cardview-v7:${buildTools}"
compile "com.android.support:recyclerview-v7:${buildTools}"
compile "com.android.support:design:${buildTools}"
compile "com.android.support:support-v13:${buildTools}"
compile "com.android.support:support-v4:${buildTools}"
compile 'com.android.support:multidex:1.0.1'
compile 'com.github.bumptech.glide:glide:4.0.0-RC0'
compile 'com.github.florent37:materialtextfield:1.0.7'
compile 'uk.co.chrisjenx:calligraphy:2.2.0'
compile 'com.splitwise:tokenautocomplete:2.0.8@aar'
compile 'com.github.Plumillon:ChipView:1.2.0'
compile 'com.github.clans:fab:1.6.4'
compile 'org.greenrobot:eventbus:3.0.0'
compile 'com.amulyakhare:com.amulyakhare.textdrawable:1.0.1'
compile 'com.google.android.gms:play-services:10.2.6'
compile 'com.google.android.gms:play-services-location:10.2.6'
compile 'com.google.android.gms:play-services-maps:10.2.6'
compile 'com.google.firebase:firebase-core:9.2.0'
compile 'com.google.firebase:firebase-messaging:9.2.0'
compile 'com.bignerdranch.android:recyclerview-multiselect:+'
compile 'com.facebook.stetho:stetho:1.5.0'
compile 'com.uphyca:stetho_realm:2.0.0'
compile 'com.lapism:searchview:4.0'
compile 'com.miguelcatalan:materialsearchview:1.4.0'
compile 'com.github.arimorty:floatingsearchview:2.1.1'
compile 'me.philio:pinentryview:1.0.6'
compile 'com.alimuzaffar.lib:pinentryedittext:1.3.1'
compile 'com.google.code.gson:gson:2.6.2'
compile 'com.github.pchmn:MaterialChipsInput:1.0.8'


/*----- Retrofit 2 */
compile 'com.squareup.okhttp3:okhttp:3.4.1'
compile 'com.squareup.okhttp3:okhttp-ws:3.4.1'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.squareup.retrofit2:retrofit:2.1.0'
compile 'com.squareup.retrofit2:converter-gson:2.1.0'
compile 'io.reactivex.rxjava2:rxjava:2.0.2'
compile 'io.reactivex.rxjava2:rxandroid:2.0.1'
compile 'com.squareup.retrofit2:adapter-rxjava2:2.3.0'
compile 'com.google.dagger:dagger:2.11'
compile 'com.google.dagger:dagger-android:2.11'
compile 'javax.inject:javax.inject:1'
compile 'io.realm:android-adapters:2.0.0'
compile 'org.parceler:parceler-api:1.1.6'
compile 'com.jakewharton:butterknife:8.5.1'
compile 'com.theartofdev.edmodo:android-image-cropper:2.4.+'
compile 'com.github.yalantis:ucrop:2.2.1-native'
compile 'jp.wasabeef:picasso-transformations:2.1.2'
compile 'jp.co.cyberagent.android.gpuimage:gpuimage-library:1.4.1'
compile 'com.github.dmytrodanylyk:android-morphing-button:98a4986e56'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
annotationProcessor 'com.google.dagger:dagger-android-processor:2.11'
annotationProcessor 'com.google.dagger:dagger-compiler:2.11'
annotationProcessor 'com.github.bumptech.glide:compiler:4.0.0-RC0'
annotationProcessor 'org.parceler:parceler:1.1.6'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.5.1'
provided 'javax.annotation:jsr250-api:1.0'
compile 'com.mikhaellopez:circularimageview:3.0.2' // circle image view
}


apply plugin: 'com.google.gms.google-services'

最佳答案

在我的例子中,我正在更新 Gradle 版本,所以我在依赖项中有以下几行:

compileOnly 'com.google.dagger:dagger:2.11'
annotationProcessor 'com.google.dagger:dagger-compiler:2.11'
testAnnotationProcessor "com.google.dagger:dagger-compiler:2.11"

但是根据教程,我找到了这一行,问题就解决了。

implementation 'com.google.dagger:dagger:2.11'
implementation 'com.google.dagger:dagger-android-support:2.11'
annotationProcessor 'com.google.dagger:dagger-compiler:2.11'
annotationProcessor 'com.google.dagger:dagger-android-processor:2.11'

关于android - : Ldagger/internal/Preconditions 解析失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46724468/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com