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

Android build breaks on RN 0.71 #436

Closed
krini opened this issue Aug 28, 2023 · 5 comments
Closed

Android build breaks on RN 0.71 #436

krini opened this issue Aug 28, 2023 · 5 comments

Comments

@krini
Copy link

krini commented Aug 28, 2023

Which platform(s) does your issue occur on?

  • Android
  • Galaxy S8

Please, provide the following version numbers that your issue occurs with:

"react-native": "0.71.13"
"react-native-inappbrowser-reborn": "^3.7.0"

node version 16.16.0

build.gradle

buildscript {
    ext {
        buildToolsVersion = "33.0.0"
        minSdkVersion = 21
        compileSdkVersion = 33
        targetSdkVersion = 33
        ndkVersion = "23.1.7779620"
        androidXAnnotation = "1.2.0"
        androidXBrowser = "1.5.0"
    }

Please, tell us how to recreate the issue in as much detail as possible.

It fails when I try to open inappbrowser on android device when this line is called:
await InAppBrowser.open

It works on ios, emulator and if I simulate on real android device - but if I build and install from apk it crashes.

FATAL EXCEPTION: mqt_native_modules Process: com.sampension.app, PID: 9031 c9.e: Subscriber class s7.c and its super classes have no public methods with the @Subscribe annotation at c9.p.a(SubscriberMethodFinder.java:59) at c9.c.p(EventBus.java:7) at s7.c.l(RNInAppBrowser.java:15) at s7.c.k(RNInAppBrowser.java:356) at com.proyecto26.inappbrowser.RNInAppBrowserModule.open(RNInAppBrowserModule.java:11) at java.lang.reflect.Method.invoke(Native Method) at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:149) at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:148) at com.facebook.jni.NativeRunnable.run(Native Method) at android.os.Handler.handleCallback(Handler.java:873) at android.os.Handler.dispatchMessage(Handler.java:99) at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:1) at android.os.Looper.loop(Looper.java:214) at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:38) at java.lang.Thread.run(Thread.java:764)

workaround

def enableProguardInReleaseBuilds = false

@NoahSimajji
Copy link

Hi, my android couldnt run it too. Any workaround for this issue?

Mean while i am having another issue. Do you know how to make it able to see the link certification. On lock icon press?

@jeevaselva
Copy link

any update on above issues

@gbalduzzi
Copy link

I'm having the same problem, await InAppBrowser.isAvailable() return false and raises a warning:

WARN  Possible Unhandled Promise Rejection (id: 0):
TypeError: Cannot read property 'isInstalled' of null
TypeError: Cannot read property 'isInstalled' of null

@samdyra
Copy link

samdyra commented Sep 14, 2023

Solved @krini's issue by adding this code on proguard-rules.pro.

-keepattributes *Annotation*
-keepclassmembers class ** {
  @org.greenrobot.eventbus.Subscribe <methods>;
}
-keep enum org.greenrobot.eventbus.ThreadMode { *; }

and upgrade this lib to the latest version (3.7.0)

@jdnichollsc
Copy link
Member

@samdyra thanks for your help! <3

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

6 participants