Error type 3. Activity class {com.awesome_project/ com.awesome_project.MainActivity} does not exist in react native (Android device)

后端 未结 24 1538
甜味超标
甜味超标 2021-01-30 20:10

I\'ve created the project using the following command.

react-native init Awesome_Project

I\'ve started the packager using the following com

24条回答
  •  孤城傲影
    2021-01-30 20:32

    I had changed my application id from com.appName to com.companyName.appName, and I had made this update in android>app>build.gradle:

    defaultConfig {
      applicationId "com.companyName.appName" // was previously "com.appName"
    }
    

    I also changed my file structure from android>app>src>main>java>com>appName to android>app>src>main>java>com>companyName>appName. This is when I got the error.

    To fix the error, I simply did a project wide search (CMD-SHIFT-F in Atom) for com.appName, and replaced them all with com.companyName.appName. Problem solved!

提交回复
热议问题