Nubescope / react-native-facebook-account-kit

Facebook Account Kit SDK wrapper for React Native
320 stars 120 forks source link

Android: proguard fails when trying to use minifyEnable: true #72

Open fabriziomoscon opened 7 years ago

fabriziomoscon commented 7 years ago

I am not an expert with proguard but I think the following warning could be avoided by adding the rule I pasted at the bottom:

Note: the configuration keeps the entry point 'io.underscope.react.fbak.RNAccountKitModule { void login(java.lang.String,com.facebook.react.bridge.Promise); }', but not the descriptor class 'com.facebook.react.bridge.Promise'
Note: the configuration keeps the entry point 'io.underscope.react.fbak.RNAccountKitModule { void logout(com.facebook.react.bridge.Promise); }', but not the descriptor class 'com.facebook.react.bridge.Promise'
Note: the configuration keeps the entry point 'io.underscope.react.fbak.RNAccountKitModule { void getCurrentAccessToken(com.facebook.react.bridge.Promise); }', but not the descriptor class 'com.facebook.react.bridge.Promise'
Note: the configuration keeps the entry point 'io.underscope.react.fbak.RNAccountKitModule { void getCurrentAccount(com.facebook.react.bridge.Promise); }', but not the descriptor class 'com.facebook.react.bridge.Promise'
Note: the configuration keeps the entry point 'io.underscope.react.fbak.RNAccountKitModule { void configure(com.facebook.react.bridge.ReadableMap); }', but not the descriptor class 'com.facebook.react.bridge.ReadableMap'
Note: the configuration keeps the entry point 'io.underscope.react.fbak.RNAccountKitModule { com.facebook.accountkit.ui.AccountKitConfiguration$AccountKitConfigurationBuilder createAccountKitConfiguration(com.facebook.accountkit.ui.LoginType); }', but not the descriptor class 'com.facebook.accountkit.ui.LoginType'
Note: the configuration keeps the entry point 'io.underscope.react.fbak.RNAccountKitModule { com.facebook.react.bridge.WritableMap mapToken(com.facebook.accountkit.AccessToken); }', but not the descriptor class 'com.facebook.accountkit.AccessToken'
Note: the configuration keeps the entry point 'io.underscope.react.fbak.RNAccountKitModule { java.lang.String[] formatCountryList(com.facebook.react.bridge.ReadableArray); }', but not the descriptor class 'com.facebook.react.bridge.ReadableArray'

We need to add:

# facebook account kit
-keep class com.facebook.react.** { *; }
-keep class com.facebook.accountkit.** { *; }

to proguard-rules.txt

gaguirre commented 7 years ago

Hey @fabriziomoscon, thanks for the tip! We could add it to the documentation, a PR would be great ;)