我的项目不再使用 Proguard 优化进行编译。正如您将在下面看到的那样,它提到dagger
但我没有直接使用与此相关的任何东西。我最近一次更新了许多依赖项。
Warning: dagger.android.AndroidMemorySensitiveReferenceManager: can't find referenced class dagger.releasablereferences.TypedReleasableReferenceManager
Warning: dagger.android.AndroidMemorySensitiveReferenceManager: can't find referenced class dagger.releasablereferences.TypedReleasableReferenceManager
Warning: dagger.android.AndroidMemorySensitiveReferenceManager: can't find referenced class dagger.releasablereferences.TypedReleasableReferenceManager
Warning: dagger.android.AndroidMemorySensitiveReferenceManager: can't find referenced class dagger.releasablereferences.TypedReleasableReferenceManager
Warning: dagger.android.AndroidMemorySensitiveReferenceManager: can't find referenced class dagger.releasablereferences.TypedReleasableReferenceManager
Warning: dagger.android.AndroidMemorySensitiveReferenceManager: can't find referenced class dagger.releasablereferences.TypedReleasableReferenceManager
Warning: dagger.android.AndroidMemorySensitiveReferenceManager: can't find referenced class dagger.releasablereferences.TypedReleasableReferenceManager
Warning: dagger.android.AndroidMemorySensitiveReferenceManager: can't find referenced class dagger.releasablereferences.TypedReleasableReferenceManager
Warning: dagger.android.AndroidMemorySensitiveReferenceManager: can't find referenced class dagger.releasablereferences.TypedReleasableReferenceManager
Warning: dagger.android.AndroidMemorySensitiveReferenceManager_Factory: can't find referenced class dagger.releasablereferences.TypedReleasableReferenceManager
Warning: dagger.android.AndroidMemorySensitiveReferenceManager_Factory: can't find referenced class dagger.releasablereferences.TypedReleasableReferenceManager
Warning: dagger.android.AndroidMemorySensitiveReferenceManager_Factory: can't find referenced class dagger.releasablereferences.TypedReleasableReferenceManager
Warning: dagger.android.AndroidMemorySensitiveReferenceManager_Factory: can't find referenced class dagger.releasablereferences.TypedReleasableReferenceManager
Warning: dagger.android.AndroidMemorySensitiveReferenceManager_Factory: can't find referenced class dagger.releasablereferences.TypedReleasableReferenceManager
Warning: dagger.android.AndroidMemorySensitiveReferenceManager_Factory: can't find referenced class dagger.releasablereferences.TypedReleasableReferenceManager
Warning: dagger.android.AndroidMemorySensitiveReferenceManager_Factory: can't find referenced class dagger.releasablereferences.TypedReleasableReferenceManager
Warning: dagger.android.ReleaseReferencesAt: can't find referenced class dagger.releasablereferences.CanReleaseReferences
如果我dontwarn
用来抑制dagger
相关行,我会收到以下消息(我尝试使用 获取更多行--info
,--debug
但--scan
输出具有相同的详细信息):
> Task :app:transformClassesAndResourcesWithProguardForRelease FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:transformClassesAndResourcesWithProguardForRelease'.
> java.io.IOException: java.lang.ArrayIndexOutOfBoundsException: 2
我也尝试了最新的(6.1.1)Proguard(覆盖默认的),结果是一样的。
可能是什么原因?
应用程序build.gradle
内容:
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
android {
compileSdkVersion 29//28
buildToolsVersion "29.0.0" //"28.0.3"
defaultConfig {
applicationId "myapp"
minSdkVersion 16
targetSdkVersion 28
versionName "1.1.1"
multiDexEnabled true
manifestPlaceholders.crashlyticsEnabled = "true"
}
buildTypes {
release {
useProguard true
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
dexOptions {
javaMaxHeapSize "2g"
}
}
configurations {
all*.exclude group: 'com.google.guava', module: 'listenablefuture'
}
dependencies {
implementation 'com.android.billingclient:billing:2.0.0'
implementation 'androidx.media:media:1.1.0-rc01'
implementation 'androidx.preference:preference:1.1.0-beta01'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.appcompat:appcompat:1.1.0-beta01'
implementation 'com.google.android.material:material:1.1.0-alpha07'
implementation files('libs/juniversalchardet-1.0.3.jar')
implementation project(path: ':ViewPageIndicator')
implementation 'com.google.firebase:firebase-core:17.0.0'
implementation 'com.google.firebase:firebase-inappmessaging-display:18.0.0'
implementation 'com.google.firebase:firebase-ads:18.0.0'
implementation 'com.crashlytics.sdk.android:crashlytics:2.10.1'
implementation 'com.google.firebase:firebase-analytics:17.0.0'
implementation 'androidx.multidex:multidex:2.0.1'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.browser:browser:1.0.0'
implementation 'com.facebook.android:facebook-login:4.42.0'
implementation 'com.facebook.android:facebook-share:4.42.0'
implementation 'com.amplitude:android-sdk:2.23.0'
implementation 'com.flurry.android:analytics:11.5.0@aar'
implementation 'com.google.code.gson:gson:2.8.5'
implementation 'android.arch.lifecycle:runtime:1.1.1'
annotationProcessor "android.arch.lifecycle:compiler:1.1.1"
implementation 'android.arch.lifecycle:extensions:1.1.1'
implementation('io.socket:socket.io-client:1.0.0') {
exclude group: 'org.json', module: 'json'
}
}
apply plugin: 'com.google.gms.google-services'
更新
我将依赖项恢复到他们以前的版本。问题是
implementation 'com.google.firebase:firebase-inappmessaging-display:18.0.0'
如果我将版本更改为17.1.0
,“匕首”相关问题就会消失。如果我将其更改为17.2.0
,问题又回来了。
UPDATE2 这可能是 Firebase 的一个错误。我已经联系了他们,他们创建了一个内部错误报告。当我有答案时,我会更新这个问题。