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

Enabling Google Play's Privacy Protection crashes app. #1763

Closed
jenshandersson opened this issue Dec 15, 2021 · 3 comments
Closed

Enabling Google Play's Privacy Protection crashes app. #1763

jenshandersson opened this issue Dec 15, 2021 · 3 comments
Labels

Comments

@jenshandersson
Copy link

Description

App crashes straight away on Android when enabling "Automatic integrity protection" and "Require installation from Google Play".

Crash log:

12-15 14:29:47.981 25123 25211 E AndroidRuntime: java.lang.RuntimeException: com.facebook.react.devsupport.JSException: Exception in HostObject::get for prop 'RNGestureHandlerModule': java.lang.IllegalArgumentException: Type is not annotation: com.facebook.react.bridge.ReactMethod
12-15 14:29:47.981 25123 25211 E AndroidRuntime: 	at com.facebook.react.bridge.DefaultNativeModuleCallExceptionHandler.handleException(DefaultNativeModuleCallExceptionHandler.java:3)
12-15 14:29:47.981 25123 25211 E AndroidRuntime: 	at com.facebook.react.devsupport.b.handleException(DisabledDevSupportManager.java:1)
12-15 14:29:47.981 25123 25211 E AndroidRuntime: 	at com.facebook.react.bridge.CatalystInstanceImpl.onNativeException(CatalystInstanceImpl.java:1)
12-15 14:29:47.981 25123 25211 E AndroidRuntime: 	at com.facebook.react.bridge.CatalystInstanceImpl.access$1100(CatalystInstanceImpl.java:1)
12-15 14:29:47.981 25123 25211 E AndroidRuntime: 	at com.facebook.react.bridge.CatalystInstanceImpl$NativeExceptionHandler.handleException(CatalystInstanceImpl.java:1)
12-15 14:29:47.981 25123 25211 E AndroidRuntime: 	at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:2)
12-15 14:29:47.981 25123 25211 E AndroidRuntime: 	at android.os.Looper.loopOnce(Looper.java:201)
12-15 14:29:47.981 25123 25211 E AndroidRuntime: 	at android.os.Looper.loop(Looper.java:288)
12-15 14:29:47.981 25123 25211 E AndroidRuntime: 	at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:8)
12-15 14:29:47.981 25123 25211 E AndroidRuntime: 	at java.lang.Thread.run(Thread.java:920)
12-15 14:29:47.981 25123 25211 E AndroidRuntime: Caused by: com.facebook.react.devsupport.JSException: Exception in HostObject::get for prop 'RNGestureHandlerModule': java.lang.IllegalArgumentException: Type is not annotation: com.facebook.react.bridge.ReactMethod
12-15 14:29:47.981 25123 25211 E AndroidRuntime: 	at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
12-15 14:29:47.981 25123 25211 E AndroidRuntime: 	at android.os.Handler.handleCallback(Handler.java:938)
12-15 14:29:47.981 25123 25211 E AndroidRuntime: 	at android.os.Handler.dispatchMessage(Handler.java:99)
12-15 14:29:47.981 25123 25211 E AndroidRuntime: 	at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:1)
12-15 14:29:47.981 25123 25211 E AndroidRuntime: 	... 4 more
12-15 14:29:47.981 25123 25211 E AndroidRuntime: Caused by: com.facebook.jni.CppException: Exception in HostObject::get for prop 'RNGestureHandlerModule': java.lang.IllegalArgumentException: Type is not annotation: com.facebook.react.bridge.ReactMethod
12-15 14:29:47.981 25123 25211 E AndroidRuntime:
12-15 14:29:47.981 25123 25211 E AndroidRuntime: Error: Exception in HostObject::get for prop 'RNGestureHandlerModule': java.lang.IllegalArgumentException: Type is not annotation: com.facebook.react.bridge.ReactMethod
12-15 14:29:47.981 25123 25211 E AndroidRuntime:     at anonymous (address at index.android.bundle:1:605704)
12-15 14:29:47.981 25123 25211 E AndroidRuntime:     at loadModuleImplementation (address at index.android.bundle:1:73776)
12-15 14:29:47.981 25123 25211 E AndroidRuntime:     at guardedLoadModule (address at index.android.bundle:1:73325)
12-15 14:29:47.981 25123 25211 E AndroidRuntime:     at metroRequire (address at index.android.bundle:1:72953)
12-15 14:29:47.981 25123 25211 E AndroidRuntime:     at anonymous (address at index.android.bundle:1:85671)
12-15 14:29:47.981 25123 25211 E AndroidRuntime:     at loadModuleImplementation (address at index.android.bundle:1:73776)
12-15 14:29:47.981 25123 25211 E AndroidRuntime:     at guardedLoadModule (address at index.android.bundle:1:73325)
12-15 14:29:47.981 25123 25211 E AndroidRuntime:     at metroRequire (address at index.android.bundle:1:72953)
12-15 14:29:47.981 25123 25211 E AndroidRuntime:     at anonymous (address at index.android.bundle:1:631123)
12-15 14:29:47.981 25123 25211 E AndroidRuntime:     at loadModuleImplementation (address at index.android.bundle:1:73776)
12-15 14:29:47.981 25123 25211 E AndroidRuntime:     at guardedLoadModule (address at index.android.bundle:1:73325)
12-15 14:29:47.981 25123 25211 E AndroidRuntime:     at metroRequire (address at index.android.bundle:1:72953)
12-15 14:29:47.981 25123 25211 E AndroidRuntime:     at anonymous (address at index.android.bundle:1:634874)
12-15 14:29:47.981 25123 25211 E AndroidRuntime:     at loadModuleImplementation (address at index.android.bundle:1:73776)
12-15 14:29:47.981 25123 25211 E AndroidRuntime:     at guardedLoadModule (address at index.android.bundle:1:73325)
12-15 14:29:47.981 25123 25211 E AndroidRuntime:     at metroRequire (address at index.android.bundle:1:72953)
12-15 14:29:47.981 25123 25211 E AndroidRuntime:     at anonymous (address at index.android.bundle:1:82150)
12-15 14:29:47.981 25123 25211 E AndroidRuntime:     at loadModuleImplementation (address at index.android.bundle:1:73776)
12-15 14:29:47.981 25123 25211 E AndroidRuntime:     at guardedLoadModule (address at index.android.bundle:1:73325)
12-15 14:29:47.981 25123 25211 E AndroidRuntime:     at metroRequire (address at index.android.bundle:1:72953)
12-15 14:29:47.981 25123 25211 E AndroidRuntime:     at anonymous (address at index.android.bundle:1:80129)
12-15 14:29:47.981 25123 25211 E AndroidRuntime:     at loadModuleImplementation (address at index.android.bundle:1:73776)
12-15 14:29:47.981 25123 25211 E AndroidRuntime:     at guardedLoadModule (address at index.android.bundle:1:73282)
12-15 14:29:47.981 25123 25211 E AndroidRuntime:     at metroRequire (address at index.android.bundle:1:72953)
12-15 14:29:47.981 25123 25211 E AndroidRuntime:     at global (address at index.android.bundle:1:72539)
12-15 14:29:47.981 25123 25211 E AndroidRuntime: 	... 8 more

Expected behavior

App should work as expected

Actual behavior

App crashes when opening. Disabling protection and rebuilding works fine.

Package versions

  • React: 17.0.2
  • React Native: 0.66.2
  • React Native Gesture Handler: 2.1.0
@j-piasecki j-piasecki added Gesture Handler 2 Platform: Android This issue is specific to Android labels Jan 5, 2022
@kmagiera
Copy link
Member

At first glance it looks like "automatic integrity protection" messes something up with refleciton. React Native on Android uses reflection to map native methods such that they can be called from JS (that's what ReactMethod annotation is for). It appears like the class is renamed and no longer recognized as an annotation class.

If this is the case, I don't think this issue is specific to gesture handler. Would you be able to check if an empty react native app (w/o gesture-handler or any other library installed) crashes the same way when published with that setting?

@fcarreiro
Copy link

Hi Jens and Krzysztof! I'm the TL for Automatic Integrity Protections. We found this report by chance and looked into it. We apologise for the inconvenience. The culprit has been found and this problem should now be fixed. You can try again by re-enabling protections and re-uploading your bundle. I can confirm that the problem was not related to reflection, react native nor gesture handlers.

If you face a problem with AIP we'd appreciate it if you filed a bug through https://support.google.com/googleplay/android-developer/gethelp , where it should be routed to us. Thank you and happy protecting!

@j-piasecki
Copy link
Member

Thanks for the information! In that case, I'll close the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants