When you run an Android app using the react-native run-android command, you often see the following error:
Starting the app (/home/xxx/soft/sdk//platform-tools/adb Shell am start-n xxx/. mainactivity) ...
starting:intent {cmp=xxx/. Mainactivity}
Error Type 3
Error:activity class {xxx/xxx. Mainactivity} does not exist.
Although the app can be installed on your Android device, it doesn't affect use, but looks good for an eyesore. In the spirit of the principle can not avoid the problem, or to find ways to eliminate this error. After my attempts, finally solved the bug. Here's a record of the steps that were resolved.
1. The first is to check if the Mainactivity.java is true, and the package name and path are correct;
2. If the file exists and there is no problem with the package name and path, open the/android/app/build.gradle file where your project is located and delete the ApplicationID under Defaultconfig, as follows:
Apply plugin: ' Com.android.application '
Android {
compilesdkversion xxx
Buildtoolsversion "XXX"
defaultConfig {
ApplicationID "XXX"
or change the value of ApplicationID to the package specified in the manifest file.
Run "React-native run-android" again, OK.
This problem occurs because your package and ApplicationID are inconsistent. If you do not define ApplicationID in your Build.gradle file, this applicationid will default to the same value as the package specified in Androidmanifest.xml.
Note: Android Gradle for Android now has a package name that uniquely identifies the app as ApplicationID.
Quote Original: http://blog.csdn.net/zhaoyingm/article/details/52180352
Blog is to remember that they are easy to forget things, but also a summary of their work, the article can be reproduced, without copyright. Hope to do their own efforts to do better, we work together to improve!
If there is any problem, welcome to discuss together, code if there is a problem, you are welcome to the great God!
React-native run-android starting:intent Error Type 3 error:activity class does not exist