Hunt
Hunt

Reputation: 8435

cannot find symbol method while using proguard in studio

I have create an app in strudio and add one module in it and i am trying to use proguard in that module.

but i do get following error when i build my app.

enter image description here

Following is the proguard-rules.pro , com.jsondb are my own classes

-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 { *; }

following is the build.gradle of module.

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'
}

Upvotes: 3

Views: 1918

Answers (1)

Hunt
Hunt

Reputation: 8435

i resolved it by adding my missing model class

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

Upvotes: 3

Related Questions