Skip to content

[Bug] Incorrect android proguard files in libs/android/*.pro #604

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

Closed
crazyhappygame opened this issue Aug 14, 2021 · 4 comments
Closed

[Bug] Incorrect android proguard files in libs/android/*.pro #604

crazyhappygame opened this issue Aug 14, 2021 · 4 comments
Assignees
Milestone

Comments

@crazyhappygame
Copy link

crazyhappygame commented Aug 14, 2021

[REQUIRED] Please fill in the following fields:

  • Pre-built SDK from the website or open-source from this repo: https://dl.google.com/firebase/sdk/cpp/firebase_cpp_sdk_8.3.0.zip
  • Firebase C++ SDK version: 8.3.0
  • Problematic Firebase Component: app, analytics, remote_config, (probably all *.pro files) (Auth, Database, etc.)
  • Other Firebase Components in use: None (Auth, Database, etc.)
  • Platform you are using the C++ SDK on: All (Mac, Windows, or Linux)
  • Platform you are targeting: Android (iOS, Android, and/or desktop)

[REQUIRED] Please describe the issue here:

Please e.g. comapare file content of libs/android/remote_config.pro from version https://dl.google.com/firebase/sdk/cpp/firebase_cpp_sdk_6.2.0.zip

-keep,includedescriptorclasses public class com.google.firebase.remoteconfig.FirebaseRemoteConfig{ *; }
-keep,includedescriptorclasses public class com.google.firebase.remoteconfig.FirebaseRemoteConfigFetchThrottledException{ *; }
-keep,includedescriptorclasses public class com.google.firebase.remoteconfig.FirebaseRemoteConfigInfo{ *; }
-keep,includedescriptorclasses public class com.google.firebase.remoteconfig.FirebaseRemoteConfigSettings{ *; }
-keep,includedescriptorclasses public class com.google.firebase.remoteconfig.FirebaseRemoteConfigSettings$Builder{ *; }
-keep,includedescriptorclasses public class com.google.firebase.remoteconfig.FirebaseRemoteConfigValue{ *; } 

With libs/android/remote_config.pro from version https://dl.google.com/firebase/sdk/cpp/firebase_cpp_sdk_8.3.0.zip

-ignorewarnings
-keep,includedescriptorclasses public class com.google.firebase.example.LoggingUtils { * ; } 

Bug:
There is not "FirebaseRemoteConfig" in proguard configuration. All FirebaseRemoteConfig are removed. Application crashes when proguard is enabled

Steps to reproduce:

  1. Create an android project with
firebaseCpp.dependencies {
  analytics
  remoteConfig
}

and proguards enable "minifyEnabled true"

    buildTypes {
        release {
            debuggable false
            jniDebuggable false
            renderscriptDebuggable false
            minifyEnabled true
            shrinkResources true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
  1. compile apk
  2. run apk - bug application crashes. Possible error lines in adb logcat:
Abort message: 'Java class com/google/firebase/FirebaseApp not found.  Please verify the AAR which contains the com/google/firebase/FirebaseApp class is included in your app.'
....
Abort message: 'Java class com/google/firebase/remoteconfig/FirebaseRemoteConfig not found.  Please verify the AAR which contains the com/google/firebase/remoteconfig/FirebaseRemoteConfig class is included in your app.'
....
 firebase: Unable to find Method com/google/firebase/analytics/FirebaseAnalytics.setAnalyticsCollectionEnabled (signature '(Z)V', instance).  Please verify the AAR which contains the com/google/firebase/analytics/FirebaseAnalytics class is included in your app.
...

Problem: proguard files in libs/android/.pro are almost empty or does not have proper rules assigned
It seems like most (or all files) are incorrect in libs/android/
.pro https://dl.google.com/firebase/sdk/cpp/firebase_cpp_sdk_8.3.0.zip
proguard files were proper in version 6.2.0.

@crazyhappygame crazyhappygame changed the title [Bug] Incorrect android proguard files libs/android/*.pro [Bug] Incorrect android proguard files in libs/android/*.pro Aug 14, 2021
@chkuang-g chkuang-g added the needs-attention Need Googler's attention label Sep 10, 2021
@chkuang-g
Copy link
Contributor

@crazyhappygame

Thank you for reporting this. I'm still contacting the team member about this.

Does it work if you add those line into libs/android/remote_config.pro?

@crazyhappygame
Copy link
Author

@chkuang-g thank you. When I add lines from 6.2.0 it works

@chkuang-g
Copy link
Contributor

Thanks for the clarification!

@cynthiajoan
Copy link
Contributor

Should be fixed in the new release 8.5.0

@firebase firebase locked and limited conversation to collaborators Oct 17, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants