在工作室

时间:2016-03-10 08:19:54

标签: android android-studio android-proguard

我在strudio中创建了一个应用程序,并在其中添加了一个模块,我正在尝试在该模块中使用proguard。

但是当我构建我的应用程序时,我确实遇到以下错误。

enter image description here

以下是proguard-rules.procom.jsondb是我自己的班级

-keep class com.bluelinelabs.logansquare.** { *; }
-keep @com.bluelinelabs.logansquare.annotation.JsonObject class *
-keep class **$$JsonObjectMapper { *; }

-keep class io.realm.annotations.RealmModule
-keep @io.realm.annotations.RealmModule class *
-keep class io.realm.internal.Keep
-keep @io.realm.internal.Keep class * { *; }
-dontwarn javax.**
-dontwarn io.realm.**

-keep public class com.jsondb.db.DB { *; }
-keep public class com.jsondb.db.model { *; }
-keep public class com.jsondb.rest.RestApi { *; }
-keep public class com.jsondb.rest.RestApiCallback { *; }

以下是模块的build.gradle。

apply plugin: 'com.android.library'
apply plugin: 'com.neenbedankt.android-apt'
android {
    compileSdkVersion 23
    buildToolsVersion "23.0.2"

    defaultConfig {
        minSdkVersion 19
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    apt 'com.bluelinelabs:logansquare-compiler:1.3.4'
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.1.1'
    compile 'com.squareup.retrofit2:retrofit:2.0.0-beta3'
    compile 'com.github.aurae.retrofit2:converter-logansquare:1.2.1'
    compile 'com.bluelinelabs:logansquare:1.3.4'
    compile 'io.realm:realm-android:0.87.4'
}

1 个答案:

答案 0 :(得分:3)

我通过添加我缺少的模型类来解决它

-keep public class com.jsondb.model.user.** {*; }