gpt4 book ai didi

android - Gradle (ProGuard) 处理任务 java.io 时出现异常(重复的 zip 条目)

转载 作者:行者123 更新时间:2023-11-29 01:06:24 26 4
gpt4 key购买 nike

当我构建发布版本时,我收到以下 gradle 警告:

Warning:Exception while processing task java.io.IOException: 
Can't write [C:\Users\MyName\AndroidStudioProjects\MyApp\app\build\intermediates\transforms\proguard\free\release\jars\3\1f\main.jar]
(Can't read [C:\Users\MyName\AndroidStudioProjects\MyApp\app\build\intermediates\classes\free\release(;;;;;;**.class)]
(Can't read [com] (Can't read [android] (Can't read [vending] (Can't read [billing]
(Can't read [IInAppBillingService$Stub$Proxy.class]
(Duplicate zip entry [com/android/a/a/a$a$a.class == com/android/vending/billing/IInAppBillingService$Stub$Proxy.class])))))))

和错误:

Error:Execution failed for task 
':app:transformClassesAndResourcesWithProguardForFreeRelease'.
> Job failed, see logs for details

可能是某种 ProGuard 问题。这是因为我一直在尝试实现新的 Play Billing Library .我尝试清理并重建项目(多次),并使缓存无效并重新启动,但都无济于事。

请注意真正确定要在此处包含哪些资源...以下是可能相关的 fragment 。

来自build.gradle:

compileSdkVersion 26
buildToolsVersion '26.0.1'
defaultConfig {
minSdkVersion 16
targetSdkVersion 26
}

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

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile project(':playLicensing')
compile 'com.android.billingclient:billing:1.0'
compile 'com.firebase:firebase-jobdispatcher:0.8.3'
compile 'com.google.android.gms:play-services-location:11.4.2'
compile 'com.google.android.gms:play-services-places:11.4.2'
compile 'com.google.android.gms:play-services-auth:11.4.2'
compile 'com.google.guava:guava:23.1-android'
compile 'com.android.support:appcompat-v7:26.0.2'
compile 'com.android.support:design:26.0.2'
}

来自proguard-rules.pro:

-dontwarn com.google.**
-keepattributes EnclosingMethod
-keepattributes JavascriptInterface
-keepclassmembers class * {
@android.webkit.JavascriptInterface <methods>;
}
-assumenosideeffects class android.util.Log {
public static boolean isLoggable(java.lang.String, int);
public static int v(...);
public static int i(...);
public static int w(...);
public static int d(...);
public static int e(...);
}
-printmapping mapping.txt

最佳答案

好的,我知道问题出在哪里了。随着previous in-app billing implementation , 有一个 requirementIInAppBillingService.aidl 文件放入项目的 aidl 子文件夹中。这是我的:

enter image description here

除了那个文件,我已经删除了所有旧的结算内容...但现在我也删除了它,使用新的 Play Billing Library 构建我的应用程序一切正常。

关于android - Gradle (ProGuard) 处理任务 java.io 时出现异常(重复的 zip 条目),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46743040/

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