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

[Bug]: Missing classes when pro guard enabled with Expo SDK 50 #3344

Open
raajnadar opened this issue Jan 27, 2024 · 5 comments
Open

[Bug]: Missing classes when pro guard enabled with Expo SDK 50 #3344

raajnadar opened this issue Jan 27, 2024 · 5 comments
Labels
bug 🪲 Something isn't working waiting Non planned issues wontfix-valid Valid issues we won't fix but we still accept PR-s for

Comments

@raajnadar
Copy link

raajnadar commented Jan 27, 2024

Mapbox Implementation

Mapbox

Mapbox Version

11

Platform

Android

@rnmapbox/maps version

10.1.8

Standalone component to reproduce

import React from 'react';
import {
  MapView,
  ShapeSource,
  LineLayer,
  Camera,
} from '@rnmapbox/maps';

const aLine = {
  type: 'LineString',
  coordinates: [
    [-74.00597, 40.71427],
    [-74.00697, 40.71527],
  ],
};

class BugReportExample extends React.Component {
  render() {
    return (
      <MapView style={{flex: 1}}>
        <Camera centerCoordinate={[-74.00597, 40.71427]} zoomLevel={14} />
        <ShapeSource id="idStreetLayer" shape={aLine}>
          <LineLayer id="idStreetLayer" />
        </ShapeSource>
      </MapView>
    );
  }
}

Observed behavior and steps to reproduce

The error is on build for production with pro guard enabled

Run

expo run:android --variant release

Expected behavior

There should not a build errors

Notes / preliminary analysis

There is no issue on dev mode
There is no issue in Expo SDK 49

Additional links and references

> Task :app:minifyReleaseWithR8 FAILED
ERROR: Missing classes detected while running R8. Please add the missing classes or apply additional keep rules that are generated in /Users/<project-path>/android/app/build/outputs/mapping/release/missing_rules.txt.
ERROR: R8: Missing class com.google.android.gms.location.ActivityRecognition (referenced from: void com.mapbox.common.movement.ProxyGoogleActivityRecognitionClient.<init>(android.content.Context))
Missing class com.google.android.gms.location.ActivityRecognitionClient (referenced from: void com.mapbox.common.movement.ProxyGoogleActivityRecognitionClient.<init>(android.content.Context))
Missing class com.google.android.gms.location.ActivityRecognitionResult (referenced from: com.mapbox.common.MovementInfo com.mapbox.common.movement.GoogleActivityRecognition$Companion.toMovementInfo(com.google.android.gms.location.ActivityRecognitionResult, com.mapbox.common.MovementModeProvider) and 2 other contexts)
Missing class com.google.android.gms.location.ActivityTransition$Builder (referenced from: java.util.List com.mapbox.common.movement.GoogleActivityRecognition$Companion$TRANSITION_API_MONITORING_TYPES$2.invoke())
Missing class com.google.android.gms.location.ActivityTransition (referenced from: java.util.List com.mapbox.common.movement.GoogleActivityRecognition$Companion$TRANSITION_API_MONITORING_TYPES$2.invoke())
Missing class com.google.android.gms.location.ActivityTransitionEvent (referenced from: com.mapbox.common.MovementInfo com.mapbox.common.movement.GoogleActivityRecognition$Companion.toMovementInfo(com.google.android.gms.location.ActivityTransitionResult, com.mapbox.common.MovementModeProvider))
Missing class com.google.android.gms.location.ActivityTransitionRequest (referenced from: void com.mapbox.common.movement.GoogleActivityRecognition.start() and 2 other contexts)
Missing class com.google.android.gms.location.ActivityTransitionResult (referenced from: com.mapbox.common.MovementInfo com.mapbox.common.movement.GoogleActivityRecognition$Companion.toMovementInfo(com.google.android.gms.location.ActivityTransitionResult, com.mapbox.common.MovementModeProvider) and 2 other contexts)
Missing class com.google.android.gms.location.DetectedActivity (referenced from: com.mapbox.common.MovementInfo com.mapbox.common.movement.GoogleActivityRecognition$Companion.toMovementInfo(com.google.android.gms.location.ActivityRecognitionResult, com.mapbox.common.MovementModeProvider))
Missing class com.google.android.gms.location.FusedLocationProviderClient (referenced from: void com.mapbox.common.location.ProxyGoogleFusedLocationProviderClient.<init>(android.content.Context))
Missing class com.google.android.gms.location.LocationCallback (referenced from: void com.mapbox.common.location.GoogleDeviceLocationProvider$locationCallback$1.<init>(com.mapbox.common.location.GoogleDeviceLocationProvider) and 6 other contexts)
Missing class com.google.android.gms.location.LocationRequest (referenced from: void com.mapbox.common.location.GoogleDeviceLocationProvider.doStart() and 5 other contexts)
Missing class com.google.android.gms.location.LocationResult (referenced from: void com.mapbox.common.location.GoogleDeviceLocationProvider$locationCallback$1.onLocationResult(com.google.android.gms.location.LocationResult) and 1 other context)
Missing class com.google.android.gms.location.LocationServices (referenced from: void com.mapbox.common.location.ProxyGoogleFusedLocationProviderClient.<init>(android.content.Context))
Missing class com.tobrun.datacompat.annotation.Default (referenced from: void com.mapbox.maps.plugin.attribution.generated.AttributionSettingsData.<init>(boolean, int, int, float, float, float, float, boolean) and 11 other contexts)

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:minifyReleaseWithR8'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.R8Task$R8Runnable
   > Compilation failed to complete
@raajnadar raajnadar added the bug 🪲 Something isn't working label Jan 27, 2024
@mfazekas
Copy link
Contributor

Please include actual errors. Also you can disable pro guard as a workaround.

@raajnadar
Copy link
Author

@mfazekas I added the error in the main issue thread at the end, please check and let me know if you need any other information.

@mfazekas
Copy link
Contributor

@mfazekas mfazekas added wontfix-valid Valid issues we won't fix but we still accept PR-s for waiting Non planned issues and removed Needs: Author Feedback labels Jan 29, 2024
@raajnadar
Copy link
Author

@mfazekas could you please guide me what will be the next step? I have very little knowledge of this pro-guard stuff

@mfazekas
Copy link
Contributor

@raajnadar I'm sorry, I'm not planning to do anything about it.

https://github.com/rnmapbox/maps/wiki/Support

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🪲 Something isn't working waiting Non planned issues wontfix-valid Valid issues we won't fix but we still accept PR-s for
Projects
None yet
Development

No branches or pull requests

2 participants