question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Android API level 16 crash

See original GitHub issue

Bug description: Crash on android app lauch on API level 16

To Reproduce:

Add this package to your react-native-project, build apk, run on emulator using API level 16. Expect crash

Expected behavior: since build.gradle specifies minSdk as 16 I expected this lib to work on API level 16 devices

Screenshots/Videos: Screen Shot 2019-07-15 at 12 40 28 PM

07-15 12:26:00.632 2613-2613/com.appmobile E/AndroidRuntime: FATAL EXCEPTION: main
    java.lang.RuntimeException: Unable to get provider com.reactnativecommunity.webview.RNCWebViewFileProvider: java.lang.ClassNotFoundException: com.reactnativecommunity.webview.RNCWebViewFileProvider
        at android.app.ActivityThread.installProvider(ActivityThread.java:4563)
        at android.app.ActivityThread.installContentProviders(ActivityThread.java:4190)
        at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4132)
        at android.app.ActivityThread.access$1300(ActivityThread.java:130)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1255)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at android.os.Looper.loop(Looper.java:137)
        at android.app.ActivityThread.main(ActivityThread.java:4745)
        at java.lang.reflect.Method.invokeNative(Native Method)
        at java.lang.reflect.Method.invoke(Method.java:511)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
        at dalvik.system.NativeStart.main(Native Method)
     Caused by: java.lang.ClassNotFoundException: com.reactnativecommunity.webview.RNCWebViewFileProvider
        at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
        at android.app.ActivityThread.installProvider(ActivityThread.java:4548)
        at android.app.ActivityThread.installContentProviders(ActivityThread.java:4190) 
        at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4132) 
        at android.app.ActivityThread.access$1300(ActivityThread.java:130) 
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1255) 
        at android.os.Handler.dispatchMessage(Handler.java:99) 
        at android.os.Looper.loop(Looper.java:137) 
        at android.app.ActivityThread.main(ActivityThread.java:4745) 
        at java.lang.reflect.Method.invokeNative(Native Method) 
        at java.lang.reflect.Method.invoke(Method.java:511) 
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553) 
        at dalvik.system.NativeStart.main(Native Method) 
07-15 12:26:01.162 2284-2284/com.android.launcher E/EGL_emulation: tid 2284: eglSurfaceAttrib(1199): error 0x3009 (EGL_BAD_MATCH)
07-15 12:26:15.742 2625-2625/com.appmobile E/Trace: error opening trace file: Permission denied (13)
07-15 12:26:15.752 2625-2625/com.appmobile E/AndroidRuntime: FATAL EXCEPTION: main
    java.lang.RuntimeException: Unable to get provider com.reactnativecommunity.webview.RNCWebViewFileProvider: java.lang.ClassNotFoundException: com.reactnativecommunity.webview.RNCWebViewFileProvider
        at android.app.ActivityThread.installProvider(ActivityThread.java:4563)
        at android.app.ActivityThread.installContentProviders(ActivityThread.java:4190)
        at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4132)
        at android.app.ActivityThread.access$1300(ActivityThread.java:130)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1255)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at android.os.Looper.loop(Looper.java:137)
        at android.app.ActivityThread.main(ActivityThread.java:4745)
        at java.lang.reflect.Method.invokeNative(Native Method)
        at java.lang.reflect.Method.invoke(Method.java:511)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
        at dalvik.system.NativeStart.main(Native Method)
     Caused by: java.lang.ClassNotFoundException: com.reactnativecommunity.webview.RNCWebViewFileProvider
        at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
        at android.app.ActivityThread.installProvider(ActivityThread.java:4548)

Environment: rn info

info Fetching system and libraries information...
System:
    OS: macOS 10.14.5
    CPU: (8) x64 Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz
    Memory: 195.02 MB / 16.00 GB
    Shell: 5.7.1 - /usr/local/bin/zsh
  Binaries:
    Node: 12.5.0 - ~/.nvm/versions/node/v12.5.0/bin/node
    Yarn: 1.17.0 - /usr/local/bin/yarn
    npm: 6.9.0 - ~/.nvm/versions/node/v12.5.0/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  SDKs:
    iOS SDK:
      Platforms: iOS 12.2, macOS 10.14, tvOS 12.2, watchOS 5.2
    Android SDK:
      API Levels: 22, 23, 24, 25, 26, 27, 28
      Build Tools: 23.0.1, 23.0.2, 26.0.1, 26.0.2, 26.0.3, 27.0.2, 27.0.3, 28.0.0, 28.0.3, 29.0.0
      System Images: android-16 | Google APIs Intel x86 Atom, android-19 | Google APIs Intel x86 Atom, android-22 | Google APIs Intel x86 Atom, android-22 | Google APIs Intel x86 Atom_64, android-23 | Google APIs Intel x86 Atom, android-23 | Google APIs Intel x86 Atom_64, android-24 | Google APIs ARM 64 v8a, android-24 | Google APIs Intel x86 Atom_64, android-25 | Google APIs Intel x86 Atom_64, android-26 | Google APIs Intel x86 Atom, android-26 | Google APIs Intel x86 Atom_64, android-28 | Google APIs Intel x86 Atom, android-28 | Google APIs Intel x86 Atom_64
  IDEs:
    Android Studio: 3.4 AI-183.6156.11.34.5522156
    Xcode: 10.2.1/10E1001 - /usr/bin/xcodebuild
  npmPackages:
    react: 16.8.6 => 16.8.6
    react-native: 0.60.2 => 0.60.2

“react-native-webview”: “5.12.1”

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:11

github_iconTop GitHub Comments

9reactions
bashen1commented, Nov 25, 2019

try to modify the MainApplication.java

above RN 0.60

import androidx.multidex.MultiDexApplication;

public class MainApplication extends MultiDexApplication implements ReactApplication {

and app/bulid.gradle

defaultConfig {
        dexOptions{
            javaMaxHeapSize "4g"
            incremental true
        }
        multiDexEnabled true
}
dependencies {
  implementation 'androidx.multidex:multidex:2.0.1'
}
3reactions
AmmarRajabcommented, Sep 30, 2019

how this issue is closed!! … the crash is still there

Read more comments on GitHub >

github_iconTop Results From Across the Web

Camera crashes in android 4.1(API level 16) - Stack Overflow
Lincy Here is Code of Class Camera View public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) { if(mPreviewRunning ) { mCamera ......
Read more >
Crash on Android API level 16 devices · Issue #12235 - GitHub
Fatal Exception: java.lang.NoSuchMethodError: io.flutter.view.FlutterView.getDisplay at io.flutter.view.FlutterView.
Read more >
Crashes - Android Developers
An Android app crashes whenever there's an unexpected exit caused by an unhandled exception or signal. An app that is written using Java...
Read more >
Iterable's Android SDK
Iterable's Android SDK supports Android versions 4.1.2 (API level 16) and higher. ... crashes in apps built with version 3.4.10 of Iterable's Android...
Read more >
Android - Sentry Documentation
The SDK builds a crash report that persists to disk and tries to send the report right ... NDK integration is packed with...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found