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.

App crashes on start on Samsung Oreo devices because of dex issue

See original GitHub issue

Running a release variant of React Native app on Samsung Oreo (8) devices leads to a crash:

java.lang.RuntimeException:
Unable to instantiate application com.pershop.pershop.MainApplication:
  java.lang.ClassNotFoundException:  Didn't find class "com.pershop.pershop.MainApplication" 
  on path: DexPathList[[zipfile....]]
  at android.app.LoadedApk.makeApplication (LoadedApk.java:977)
  at android.app.ActivityThread.handleBindApplication (ActivityThread.java:6030)
  at android.app.ActivityThread.-wrap1 (Unknown Source)
  at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1764)
  at android.os.Handler.dispatchMessage (Handler.java:105)
  at android.os.Looper.loop (Looper.java:164)
  at android.app.ActivityThread.main (ActivityThread.java:6938)
  at java.lang.reflect.Method.invoke (Native Method)
  at com.android.internal.os.Zygote$MethodAndArgsCaller.run (Zygote.java:327)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1374)

App runs fine on non-Samsung devices. (and iOS FWIW)

Environment

  React Native Environment Info:
    System:
      OS: macOS High Sierra 10.13.6
      CPU: (4) x64 Intel(R) Core(TM) i7-4650U CPU @ 1.70GHz
      Memory: 68.29 MB / 8.00 GB
      Shell: 3.2.57 - /bin/bash
    Binaries:
      Node: 10.5.0 - /usr/local/bin/node
      npm: 6.1.0 - /usr/local/bin/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
    SDKs:
      iOS SDK:
        Platforms: iOS 12.1, macOS 10.14, tvOS 12.1, watchOS 5.1
      Android SDK:
        API Levels: 25, 26, 27, 28
        Build Tools: 27.0.3, 28.0.2, 28.0.3
        System Images: android-27 | Google Play Intel x86 Atom
    IDEs:
      Android Studio: 3.2 AI-181.5540.7.32.5056338
      Xcode: 10.1/10B61 - /usr/bin/xcodebuild
    npmPackages:
      react: 16.6.3 => 16.6.3 
      react-native: 0.57.8 => 0.57.8 
    npmGlobalPackages:
      react-native-cli: 2.0.1

Description

Created a release version of Android app and any users that install it on Samsung Oreo devices report a crash. (see more above)

Reproducible Demo

You can download and run this app on any Samsung device and see the crash.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
tonyd3commented, Jan 23, 2019

I had a similar issue before, I fixed it by forcing Java 8 in app/build.gradle.

  compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
  }
0reactions
amoljaincommented, Jan 29, 2019

@tonyd3 is right. I scrolled up the crash logs and there was a line that complained about Java8. Explicitly setting Java8 solve the issue. Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to fix apps that keep crashing and freezing - Samsung
How to fix apps that keep crashing and freezing ; Step 1. Switch off your mobile data/Wi-Fi router for about a few minutes....
Read more >
Why are my Android phone apps crashing or closing & how to ...
Find out why your Samsung Galaxy Android phone apps keep crashing, closing, freezing or stop working. Fix the issue with our guide and...
Read more >
How to fix apps keep crashing and freezing | Samsung CA
Step 1. Switch off your mobile data/Wi-Fi router for about a few minutes. Step 2. Turn off your device and Restart it again....
Read more >
How to fix apps keep crashing and freezing? - Samsung
Step 1. Switch off your mobile data/Wi-Fi router for about a few minutes. ; Step 2. Turn off your device and Restart it...
Read more >
Solved: Dex Crashes Upon Starting Financial Apps - 941367
userUwP3wButxz. Constellation · ‎11-07-2019 06:13 PM (Last edited ‎11-07-2019 06:47 PM ) in. Samsung Apps and Services · Hi, my Dex (on Windows) ......
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