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

Fail/Crash to open app after installing react-native-webview dependency #2014

Closed
VitorPaludetto opened this issue May 24, 2021 · 4 comments
Closed

Comments

@VitorPaludetto
Copy link

Bug description:

I installed the latest version of the lib and when I run yarn react-native run-android everything goes fine, but I can't get my app to open on the emulator after it. It keeps crashing. If I remove react-native-webview dependency my app opens normally.
I've tried to install older versions of the lib but the same happens.
I already wiped the emulator settings and cleared cache to see if it would work, but with no success.

Screenshots/Videos:

App Crashing when react-antive-webview is installed.
appCrashBetter

App opens when I remove the dependency
appWorking

Environment:

  • OS: Android
  • OS version: 11
  • react-native version: 0.63.4
  • react-native-webview version: 11.6.2
@AlexPeret
Copy link

hi,

I've started facing the same problem after adding minHeight attribute to the style property, like this:

<WebView
    ...
    style={{backgroundColor: 'transparent', flex: 1, minHeight: '300px'}}
    ...
 />

replacing the minHeight's value to a number works fine:

<WebView
    ...
    style={{backgroundColor: 'transparent', flex: 1, minHeight: 300}}
    ...
 />

Environment:

  • OS: Android
  • OS version: 11
  • react-native: 0.63.4
  • react-native-webview: ^11.4.3

@alexcbluk
Copy link

alexcbluk commented Jun 14, 2021

I have a very similar android specific issue with version: ^11.6.4
Like yourself, I have ONLY installed the package via yarn add react-native-webview and my detox tests have been failing with the following error:

DetoxRuntimeError: Failed to run application on the device

    HINT: Most likely, your main activity has crashed prematurely.

    Native stacktrace dump: java.lang.NoSuchMethodError: No direct method <init>(ILjava/lang/Class;Ljava/lang/String;Ljava/lang/String;I)V in class Lkotlin/jvm/internal/FunctionReferenceImpl; or its super classes (declaration of 'kotlin.jvm.internal.FunctionReferenceImpl' appears in /data/app/~~tVQXRextVO2nUllF1-6L6g==/com.whichmobileapp-R1eVS54uc89qIOHE9sUwbg==/base.apk)

What makes it even more confusing is that I haven't even started using the < WebView /> component anywhere in the code base.

Environment:

OS: Android
MacOS 10.15.7
react-native: 0.64.2
react-native-webview: ^11.6.4

@alexcbluk
Copy link

To resolve the issue I had with detox, I had to use a lower version of the kotlin-gradle-plugin which can be found in android/settings.gradle

classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.71'

@github-actions
Copy link

Hello 👋, this issue has been opened for more than 2 months with no activity on it. If the issue is still here, please keep in mind that we need community support and help to fix it! Just comment something like still searching for solutions and if you found one, please open a pull request! You have 7 days until this gets closed automatically

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

No branches or pull requests

3 participants