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

Provide proguard rules to ignore missing Huawei classes #313

Open
katiedotson opened this issue Sep 27, 2023 · 2 comments
Open

Provide proguard rules to ignore missing Huawei classes #313

katiedotson opened this issue Sep 27, 2023 · 2 comments

Comments

@katiedotson
Copy link

Summary

After updating to use the latest version of Gradle, which has the property android.enableR8.fullMode to be true by default, minified builds were failing due to missing proguard rules related to Huawei. Suggestion is to add these to the SDK so they are provided by default.

Code to reproduce

Gradle 8.0 +
Targeting SDK 34
minifyEnabled true in build configuration

Steps to reproduce

Build a project using the Radar dependency and default Google location services provider with Gradle 8.0+. The build will fail with a message referencing missing Proguard rules:


Missing classes detected while running R8. Please add the missing classes or apply additional keep rules that are generated in .../app/build/outputs/mapping/.../missing_rules.txt

Missing rules text file:


# Please add these rules to your existing keep rules in order to suppress warnings.
# This is generated automatically by the Android Gradle plugin.
-dontwarn com.huawei.hmf.tasks.OnFailureListener
-dontwarn com.huawei.hmf.tasks.OnSuccessListener
-dontwarn com.huawei.hmf.tasks.Task
-dontwarn com.huawei.hms.location.FusedLocationProviderClient
-dontwarn com.huawei.hms.location.Geofence$Builder
-dontwarn com.huawei.hms.location.Geofence
-dontwarn com.huawei.hms.location.GeofenceData
-dontwarn com.huawei.hms.location.GeofenceRequest$Builder
-dontwarn com.huawei.hms.location.GeofenceRequest
-dontwarn com.huawei.hms.location.GeofenceService
-dontwarn com.huawei.hms.location.LocationCallback
-dontwarn com.huawei.hms.location.LocationRequest
-dontwarn com.huawei.hms.location.LocationResult

OS version

Android 14

SDK installation method

Gradle-provided dependency via Maven Central

SDK version

3.8.11

Other information

@lmeier
Copy link
Contributor

lmeier commented Sep 28, 2023

Hi @katiedotson, thanks for raising the issue.

In an attempt to replicate, I bumped the gradle for the SDK to 8, and made all the changes required to get the example app to build. I got the example building correctly but without any of the warnings you observed. Here's my work.

Were you able to add the proguard rules to your project? Were you able to successfully build?

Thanks again.

@katiedotson
Copy link
Author

katiedotson commented Oct 2, 2023

Yes, I was able to successfully build after adding the Proguard rules. If the next Radar release will work without them we'll be sure to update. Thank you!

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

2 participants