Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ProGuard causes TargetMethodFinder to fail #57

Open
nathanvogel opened this issue Jun 16, 2016 · 0 comments
Open

ProGuard causes TargetMethodFinder to fail #57

nathanvogel opened this issue Jun 16, 2016 · 0 comments

Comments

@nathanvogel
Copy link

Hi,
I'm not sure if this is just my ProGuard file that needs a fix, or maybe just the Evernote examples, but I think it should be fixed at the SDK level.

When this sample from the API example is executed, it downloads the list of notes, but stays loading forever.
ADB logs only this warning :
W/TargetMethodFinder: Didn't find method, result type interface java.util.List, result [com.evernote.client.android.c.a@bcea7c2, com.evernote.client.android.c.a@26b8d3, com.evernote.client.android.c.a@bcea7c2, com.evernote.client.android.c.a@30c7d4, ...long list of notes here.... com.evernote.client.android.c.a@11fe256, com.evernote.client.android.c.a@60d12d7], annotationId null, fragmentId 0/2131558519/null

which was sent from this library included in the EN SDK :
https://github.com/vRallev/android-task/blob/master/library/src/main/java/net/vrallev/android/task/TargetMethodFinder.java#L87

Seems to occur a bit randomly, possibly in different places (I heard about weird bugs from users), but after some testing, I think it happens only in release mode when ProGuard is enabled.

I built the Demo with in release mode and was forced to modify the build config, but it also happens there. Here's what I added to the demo build.gradle file :

    signingConfigs {
        release {
            storeFile file(RELEASE_STORE_FILE)
            storePassword RELEASE_STORE_PASSWORD
            keyAlias RELEASE_KEY_ALIAS
            keyPassword RELEASE_KEY_PASSWORD
        }
    }


    buildTypes {
        debug {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }

        release {
            minifyEnabled true
            proguardFile getDefaultProguardFile('proguard-android-optimize.txt')
            proguardFile 'proguard-rules.pro'
            signingConfig signingConfigs.release
        }
    }

And proguard-rules.pro :

# --- Remove some warnings, as suggested by the warnings
# --- It won't compile without (at least some of) them
-dontwarn sun.misc.Unsafe
-dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
-dontwarn java.nio.file.*
-dontwarn org.scribe.services.DatatypeConverterEncoder
-dontwarn com.evernote.client.conn.mobile.TAndroidTransport
-dontwarn com.evernote.client.conn.mobile.DiskBackedByteStore
-dontwarn com.evernote.client.conn.mobile.ByteStore
-dontwarn org.scribe.services.CommonsEncoder
-dontwarn org.apache.commons.codec.binary.Base64

For now, my dumb fix is to set minifyEnabled false, because I simply have too many problems with ProGuard, but it would be great to either have a fix in the SDK or help me edit my ProGuard file.

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant