gpt4 book ai didi

android - Proguard 在 25.1.6 版本的 Android 工具中失败

转载 作者:塔克拉玛干 更新时间:2023-11-02 22:12:49 25 4
gpt4 key购买 nike

我今天下载了 25.1.6 版本的 Android 工具,我注意到 proguard 因以下错误而崩溃:

Error:Execution failed for task ':app:transformClassesWithNewClassShrinkerForDebug'.
> /usr/local/opt/android-sdk/tools/proguard/proguard-android.txt line 43:15 extraneous input '[]' expecting ')'

我确定我没有更改 proguard-android.txt 文件中的任何内容。第 43 行对我来说如下:

void set*(%[]);

我注意到这里的文件...

https://android.googlesource.com/platform/sdk/+/android-6.0.1_r43/files/proguard-android.txt

... 与我机器上的不同吗?该文件是我应该拥有的文件的最新版本吗?

最佳答案

只知道几个选项:

对我有帮助的是将相应的 proguard-android.txt 文件替换为来自 this 的文件页

为了防止页面消失,请在此处保存其内容:

# This is a configuration file for ProGuard.
# http://proguard.sourceforge.net/index.html#manual/usage.html
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-verbose
# Optimization is turned off by default. Dex does not like code run
# through the ProGuard optimize and preverify steps (and performs some
# of these optimizations on its own).
-dontoptimize
-dontpreverify
# Note that if you want to enable optimization, you cannot just
# include optimization flags in your own project configuration file;
# instead you will need to point to the
# "proguard-android-optimize.txt" file instead of this one from your
# project.properties file.
-keepattributes *Annotation*
-keep public class com.google.vending.licensing.ILicensingService
-keep public class com.android.vending.licensing.ILicensingService
# For native methods, see http://proguard.sourceforge.net/manual/examples.html#native
-keepclasseswithmembernames class * {
native <methods>;
}
# keep setters in Views so that animations can still work.
# see http://proguard.sourceforge.net/manual/examples.html#beans
-keepclassmembers public class * extends android.view.View {
void set*(***);
*** get*();
}
# We want to keep methods in Activity that could be used in the XML attribute onClick
-keepclassmembers class * extends android.app.Activity {
public void *(android.view.View);
}
# For enumeration classes, see http://proguard.sourceforge.net/manual/examples.html#enumerations
-keepclassmembers enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}
-keepclassmembers class * implements android.os.Parcelable {
public static final android.os.Parcelable$Creator CREATOR;
}
-keepclassmembers class **.R$* {
public static <fields>;
}
# The support library contains references to newer platform versions.
# Don't warn about those in case this app is linking against an older
# platform version. We know about them, and they are safe.
-dontwarn android.support.**

关于android - Proguard 在 25.1.6 版本的 Android 工具中失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37212749/

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