Uh oh!
There was an error while loading. Please reload this page.
Fix build error and runtime error after proguard enabled. - #5146
Fix build error and runtime error after proguard enabled.#5146tdzl2003 wants to merge 4 commits into
Conversation
facebook-github-bot
commented
Jan 6, 2016
By analyzing the blame information on this pull request, we identified @mkonicek to be a potential reviewer. |
mkonicek
commented
Jan 6, 2016
Thanks for the fix! |
There was a problem hiding this comment.
Can you try changing this to?
# For native methods, see http://proguard.sourceforge.net/manual/examples.html#native
-keepclasseswithmembernames class * {
native <methods>;
}
keep class gives 7.1MB APK, keepclasseswithmembernames 6.8MB.
There was a problem hiding this comment.
I tried but it didn't work. There's still errors:
E/dalvikvm( 1032): ERROR: couldn't find native method
E/dalvikvm( 1032): Requested: Lcom/facebook/react/bridge/ReadableNativeArray;.getType:(I)Lcom/facebook/react/bridge/ReadableType;
Maybe there's another problem. I'll take a look and give a update for this PR.
There was a problem hiding this comment.
I read the code decompiled from classes-proguard. All other methods is fine but getType is missing. I don't know why...
tdzl2003
commented
Jan 6, 2016
this work for me. We should not only keep their names, but also keep native methods self, otherwise it may be stripped if not used. |
mkonicek
commented
Jan 6, 2016
Does this work as noted in the docs (http://proguard.sourceforge.net/manual/examples.html#native)? |
facebook-github-bot
commented
Jan 6, 2016
@tdzl2003 updated the pull request. |
tdzl2003
commented
Jan 6, 2016
Nope. I think getType is stripped but other methods are kept because getType wasn't used in modules provided by MainReactPackage |
tdzl2003
commented
Jan 6, 2016
includedescriptorclasses has no effect now because all the classes used by native method have annotation |
facebook-github-bot
commented
Jan 6, 2016
@tdzl2003 updated the pull request. |
mkonicek
commented
Jan 6, 2016
ok ok thanks for looking! |
mkonicek
commented
Jan 6, 2016
@facebook-github-bot shipit |
facebook-github-bot
commented
Jan 6, 2016
Thanks for importing. If you are an FB employee go to https://our.intern.facebook.com/intern/opensource/github/pull_request/1678391639113596/int_phab to review. |
Summary: Fix: 1. :app:packageRelease FAILED caused by proguard exception: `java.io.IOException: Please correct the above warnings first.` 2. Fix runtime exception ``` java.lang.ExceptionInInitializerError at com.facebook.react.ReactInstanceManagerImpl.recreateReactContextInBackgroundFromBundleFile(ReactInstanceManagerImpl.java:308) ``` Closesreact#5146 Reviewed By: svcscm Differential Revision: D2807252 Pulled By: mkonicek fb-gh-sync-id: 03d004405c7cca14a71230086b95351cfacbc055
Summary: Fix: 1. :app:packageRelease FAILED caused by proguard exception: `java.io.IOException: Please correct the above warnings first.` 2. Fix runtime exception ``` java.lang.ExceptionInInitializerError at com.facebook.react.ReactInstanceManagerImpl.recreateReactContextInBackgroundFromBundleFile(ReactInstanceManagerImpl.java:308) ``` Closes#5146 Reviewed By: svcscm Differential Revision: D2807252 Pulled By: mkonicek fb-gh-sync-id: 03d004405c7cca14a71230086b95351cfacbc055
Summary: Fix: 1. :app:packageRelease FAILED caused by proguard exception: `java.io.IOException: Please correct the above warnings first.` 2. Fix runtime exception ``` java.lang.ExceptionInInitializerError at com.facebook.react.ReactInstanceManagerImpl.recreateReactContextInBackgroundFromBundleFile(ReactInstanceManagerImpl.java:308) ``` Closesreact/react-native#5146 Reviewed By: svcscm Differential Revision: D2807252 Pulled By: mkonicek fb-gh-sync-id: 03d004405c7cca14a71230086b95351cfacbc055
Fix:
java.io.IOException: Please correct the above warnings first.