- >这是我的build.gradle
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "com.bhavya.whatsappplus"
minSdkVersion 10
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:21.0.3'
compile 'com.google.android.gms:play-services:6.5.87'
compile 'com.android.support:support-v4:21.0.3'
compile files('libs/StartAppInApp-2.4.11.jar')
compile files('libs/mobilecore.jar')
}
- >这是progaurd-rules.pro
}
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-verbose
-printseeds seeds.txt
-printusage unused.txt
-printmapping mapping.txt
-keep class com.startapp.** {
*;
}
-keepattributes Exceptions, InnerClasses, Signature, Deprecated, SourceFile,LineNumberTable, *Annotation*, EnclosingMethod
-dontwarn android.webkit.JavascriptInterface
-dontwarn com.startapp.**
-keepattributes InnerClasses, EnclosingMethod
-keep class com.ironsource.mobilcore.**{ *; }
答案 0 :(得分:1)
这就是我的工作方式:在路径proguard-rules.txt
/MyProject/
且build.gradle
包含:
buildTypes {
release {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
....
请参阅文档中的notes:
" ... getDefaultProguardFile(' proguard-android.txt')从Android SDK安装中获取默认的ProGuard设置。 Android Studio在模块的根目录中添加特定于模块的规则文件proguard-rules.txt,您可以在其中添加自定义ProGuard规则。 .."