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

后端 未结 24 1545
甜味超标
甜味超标 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:23

    I had a similar issue.

    BUILD SUCCESSFUL in 38s
    27 actionable tasks: 27 executed
    info Connecting to the development server...
    info Starting the app on "a77c634"...
    Starting: Intent { cmp=com.helloworld/.MainActivity }
    Error type 3
    Error: Activity class {com.helloworld/com.helloworld.MainActivity} does not exist.e
    

    For me, my target device had multiple accounts, so before running the app for another ime, make sure you uninstall it from all accounts.

    0 讨论(0)
  • 2021-01-30 20:25

    In my case the app just doesn't open automatically, there's no other issue.

    Just search for the app icon in your android device (look at location of all applications) and tap on it to open the app manually. The packager will begin to load the app as usual.

    So this seems to be a bug here. Unfortunately I don't really know what's causing it.

    0 讨论(0)
  • 2021-01-30 20:25

    For anyone else running into this issue where there are no solutions, if you've linked libraries, make sure that in the settings.gradle file located in ProjectName/android has your app in the include statement, like so: include ':ThirdPartyLibrary', ':app'. I forgot :app and it was build and installing the 3rd party library, but not the actual app, resulting in the problem.

    0 讨论(0)
  • 2021-01-30 20:26

    I tried all the answers posted above, no any outcome for my use case.

    It got resolved finally by executing like this:

    react-native run-android --variant=alphaDebug

    if there are multiple flavours in the app, then we must mention variant through command line

    0 讨论(0)
  • 2021-01-30 20:28

    try running adb command to install the apk (should provide more output) from android dir in your project: adb install app/build/outputs/apk/app-debug.apk

    In my case was a insufficient storage case

    facebook/react-native issue #2885

    0 讨论(0)
  • 2021-01-30 20:28

    I ran into this issue after having a successful build installed on my phone, but long story short I had to uninstall it in order to do a fresh install. After uninstalling the app and trying to do a react-native run-android, I received this error.

    Seems that 'uninstalling' an application on some devices only disables it in case you wish to undo the uninstall within a certain time frame. To remedy this, I went into Applications under settings and selected my app and completely uninstalled it. After that I was able to successfully build my app again. Hope this helps someone out.

    0 讨论(0)
提交回复
热议问题