在 android studio windows 10 中分离 proguard 文件失败
separating proguard files in android studio windows 10 failing
我在 Mac
的 Android Studio
中创建了一个 android 项目。但是,当我尝试在 windows 10
中使用 android studio 创建发行版 apk
时,似乎不包括 proguard
文件。由于混淆了一些 类 应用程序在 运行 时间内崩溃,根据我的 proguard 设置,它应该跳过。
请注意,此配置在 Mac 环境中运行良好。
初始配置:
buildTypes {
release {
minifyEnabled true
proguardFile 'proguard-eventbus-3.pro'
proguardFile 'proguard-acra.pro'
proguardFile 'proguard-glide.pro'
proguardFile 'proguard-gson.pro'
proguardFile 'proguard-square-retrofit2.pro'
proguardFile 'proguard-project-app.pro'
testProguardFile 'proguard-project-test.pro'
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
我还尝试将所有 proguard 文件移动到单个文件夹中并对其进行测试并遇到以下构建错误:
更新配置:
buildTypes {
release {
minifyEnabled true
proguardFiles fileTree(dir: "proguard", include: ["*.pro"]).asList().toArray()
testProguardFile 'proguard-project-test.pro'
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
错误:
您可以使用:
proguardFiles fileTree(dir: 'proguard', include: ['*.pro']).asList().toArray()
注意 '
的用法
我在 Mac
的 Android Studio
中创建了一个 android 项目。但是,当我尝试在 windows 10
中使用 android studio 创建发行版 apk
时,似乎不包括 proguard
文件。由于混淆了一些 类 应用程序在 运行 时间内崩溃,根据我的 proguard 设置,它应该跳过。
请注意,此配置在 Mac 环境中运行良好。
初始配置:
buildTypes {
release {
minifyEnabled true
proguardFile 'proguard-eventbus-3.pro'
proguardFile 'proguard-acra.pro'
proguardFile 'proguard-glide.pro'
proguardFile 'proguard-gson.pro'
proguardFile 'proguard-square-retrofit2.pro'
proguardFile 'proguard-project-app.pro'
testProguardFile 'proguard-project-test.pro'
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
我还尝试将所有 proguard 文件移动到单个文件夹中并对其进行测试并遇到以下构建错误:
更新配置:
buildTypes {
release {
minifyEnabled true
proguardFiles fileTree(dir: "proguard", include: ["*.pro"]).asList().toArray()
testProguardFile 'proguard-project-test.pro'
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
错误:
您可以使用:
proguardFiles fileTree(dir: 'proguard', include: ['*.pro']).asList().toArray()
注意 '