Open datnhemployee opened 5 years ago
I am using the standard one, and it works in release. I'm not saying it couldn't be proguard/D8/R8 doing it, but I'm saying the currently documented one does work for me
Thanks for your answer, @mikehardy . I love to see your code of proguard-rules.pro as an attachment of your answer. Could you share it with me ? Again, thank you very much.
Here's the full thing
mike@Bendy:~/work/Kullki/kscoreapp-rxp (vp1) % more android/app/proguard-rules.pro
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# Add any project specific keep options here:
# react-native-background-geolocation-android section
-keepnames class com.facebook.react.ReactActivity
# BackgroundGeolocation lib tslocationmanager.aar is *already* proguarded
-keep class com.transistorsoft.** { *; }
-dontwarn com.transistorsoft.**
# BackgroundGeolocation (EventBus)
-keepclassmembers class * extends de.greenrobot.event.util.ThrowableFailureEvent {
<init>(java.lang.Throwable);
}
-keepattributes *Annotation*
-keepclassmembers class ** {
@org.greenrobot.eventbus.Subscribe <methods>;
}
-keep enum org.greenrobot.eventbus.ThreadMode { *; }
-keepclassmembers class * extends org.greenrobot.eventbus.util.ThrowableFailureEvent {
<init>(java.lang.Throwable);
}
# logback
-keep class ch.qos.** { *; }
-keep class org.slf4j.** { *; }
-dontwarn ch.qos.logback.core.net.*
# OkHttp3
-dontwarn okio.**
# end react-native-background-geolocation-android section
# react-native-firebase section
-keep class io.invertase.firebase.** { *; }
-dontwarn io.invertase.firebase.**
# end react-native-firebase section
# react-native-contacts
-keep class com.rt2zz.reactnativecontacts.** {*;}
-keepclassmembers class com.rt2zz.reactnativecontacts.** {*;}
# FIXME Just to test the build with ProGuard, likely not correct
-ignorewarnings
mike@Bendy:~/work/Kullki/kscoreapp-rxp (vp1) %
Note my FIXME at the bottom has been there since I first integrated everything about a year ago, and I haven't gotten around to fixing it because it works
I believe the firebase sdk libraries have their own proguard files internal, thus no entries
Scenario I have followed the documentation of react-native-firebase at the link https://rnfirebase.io/docs/v5.x.x/installation/android to install the react-native-firebase. The notification does not work when I build the release apk. However, it does work fine in debug mode. I believe it is the proguard obfuscation which does not keep the relevant modules to make Firebase Notification work right way.
Asking for help Would anyone mind giving me the proguard-rules.pro file which did work with FCM (Firebase Cloud Messaging), please ? Thanks for advance.
app/android/build.gradle
app/build.gradle
setting.gradle
MainApplication.java
AndroidManifest.xml
proguard-rules.pro