I am new to React-Native.

I am trying to run my React-Native android project in Visual studio Emulator for Android.

My build was successful by running react-native run-android, but I am unable to launch the app in emulator.

It is giving me the below error:

Error type 3. Activity class does not exist.

I tried gradlew clean and gradlew cleanBuildCache. but same error exists.

I checked the package name in below files and it is same in all 4 files.MainActivity.java, AndroidManifest.xml, build.gradle, MainApplication.java

Am I doing something wrong? Or how can I run my app in Visual studio Emulator?

1

There are 1 best solutions below

1
AudioBubble On

have u opened your project in AndroidStudio? After open in it, check for assets folder in App->src->main->assets , if not present make it.

run following command

 $ react-native bundle –platform android –dev false –entry-file index.js –bundle-output android/app/src/main/assets/index.android.bundle –assets-dest android/app/src/main/res

then again try to build and run it.