Skip to content

[ANDROID] Crash when setting targetSdkVersion to 23: com.facebook.react.devsupport.JSException: Can't find variable: parseErrorStackLib  #19679

@abrel

Description

@abrel

Environment

  OS: macOS Sierra 10.12.6
  Node: 8.4.0
  Yarn: 1.3.2
  npm: 4.0.5
  Watchman: 4.7.0
  Xcode: Xcode 9.2 Build version 9C40b
  Android Studio: 2.3 AI-162.4069837

Packages: (wanted => installed)
  react: 16.3.1 => 16.3.1
  react-native: 0.55.3 => 0.55.3

Description

On Android, I upgraded the targetSdkVersion from 22 to 23 to enjoy permissions being requested at runtime. Everything works well for devices running android 6+ (as apiLevel is >= 23)
However for every device running Android 5 (I have minSdkVersion set at 16) or below I get the following crash:

Fatal Exception: java.lang.RuntimeException
com.facebook.react.devsupport.JSException: Can't find variable: parseErrorStackLib (index.android.bundle:454)

Steps to Reproduce

Set targetSdkVersion to 23 and try to compile your app on a device running Android 5 or below.
I guess your app should make use of parseErrorStackLib in some ways for the crash to occur.

Expected Behavior

All required classes should be included and It should not crash even for older devices

Actual Behavior

It crashes as some dependencies seem missing for older devices

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions