proyecto26 / react-native-inappbrowser

📱InAppBrowser for React Native (Android & iOS) 🤘
https://www.npmjs.com/package/react-native-inappbrowser-reborn
MIT License
1.29k stars 218 forks source link

Android build breaks on RN 0.71 #436

Closed krini closed 8 months ago

krini commented 10 months ago

Which platform(s) does your issue occur on?

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 commented 10 months ago

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 commented 10 months ago

any update on above issues

gbalduzzi commented 10 months ago

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 commented 10 months ago

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 commented 8 months ago

@samdyra thanks for your help! <3