Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Unfortunately, app has stopped" error with building React Native project on Android

I'm trying to run a project written in React Native and the app crashes:

Error image

The solution stated on this thread is irrelevant since the enableProguardInReleaseBuilds variable is already configured to false.

I've also had problems with RCT Video, solved with this thread so maybe it's related.

Thanks in advance.

like image 580
Yoni Mor Avatar asked Aug 07 '16 15:08

Yoni Mor


People also ask

How do I run React Native project on Android?

Running your React Native application Install the Expo Go app on your iOS or Android phone and connect to the same wireless network as your computer. On Android, use the Expo Go app to scan the QR code from your terminal to open your project. On iOS, use the built-in QR code scanner of the default iOS Camera app.

Can you build Android apps with React Native?

Yeah, with React Native you can build mobile apps that can run on iOS and Android. This is one of the great benefits of React Native. Before Facebook created it, you had to build your app twice and with different code: one for iOS using Swift or Objective-C and one for Android using Java or Kotlin.

Why does my app keep stopping in Android Studio?

An Android app crashes whenever there's an unexpected exit caused by an unhandled exception or signal. An app that is written using Java or Kotlin crashes if it throws an unhandled exception, represented by the Throwable class.


1 Answers

Solved after debugging in Android Studio.

The error I had (java.lang.ClassCastException: android.app.Application cannot be cast to com.facebook.react.ReactApplication) was solved with greena13's answer on this thread.

like image 53
Yoni Mor Avatar answered Jan 29 '23 05:01

Yoni Mor