ReactNative:Error: Activity class {.MainActivity} does not exist.

Published on:
Last updated:

This post is also available in: 日本語 (Japanese)

When developing an Android smartphone application with ReactNative, an error occurred when debugging the actual machine, and the application screen quit when it was launched.
The following is that error messages filtered by app name by using AVD Manager of Android SDK Tools.
The part of com.sampleproject contains application ID specified by developer.

Starting: Intent { cmp=com.sampleproject/.MainActivity }
Error type 3
Error: Activity class {com.sampleproject/com.sampleproject.MainActivity} does not exist.

In my case, the cause of the error is that Application ID(first two files) and package name(the remaining two files) in the following files in the ReactNative project folder are not unified. It seemed to be the cause.

YourProjectFolder/app/ build.gradle


No tags for this post.

Kuniyoshi Takemoto is the founder of LLC, and editor of this blog( more and follow me on LinkedIn.