question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error: Activity class ... does not exist

See original GitHub issue

Is this a bug report?

Yes

Have you read the Bugs section of the Contributing to React Native Guide?

Yes

Environment

  1. react-native -v: 0.45 & 0.46.1
  2. node -v: v6.9.1
  3. npm -v: 3.10.8
  4. yarn --version (if you use Yarn): 0.17.6

Then, specify:

  1. Target Platform (e.g. iOS, Android): Android
  2. Development Operating System (e.g. macOS Sierra, Windows 10): macOS Sierra

Steps to Reproduce

  • Create a new react-native project using react-native init ExampleProject
  • Add auth0 with yarn add react-native-auth0 and link it react-native link react-native-auth0
  • And configure the Android project: https://github.com/auth0/react-native-auth0#configuration
  • Add Redux, React Navigation and a few other JS libraries.

Expected Behavior

App should run without any kind of errors.

Actual Behavior

When I want to run the app with react-native run-android after writing some code and adding logic without touching the native Java code and with a successful build, I get this error:

BUILD SUCCESSFUL

Total time: 10.072 secs
Running adb -s 0259749fb8c21037 reverse tcp:8081 tcp:8081
Starting the app on 0259749fb8c21037 (adb -s 0259749fb8c21037 shell am start -n com.woodyapplication/com.woodyapplication.MainActivity)...
Starting: Intent { cmp=com.woodyapplication/.MainActivity }
Error type 3
Error: Activity class {com.woodyapplication/com.woodyapplication.MainActivity} does not exist.

I managed to fix this with the following hacks:

  • creating a new project and copy the JS code over (which is not a solution)
  • replace the package name com.woodyapplication with com.woody.application (or something else). This fixes it for a few runs but then the error message appears again.

I’ve tested this with RN 0.45 and RN 0.46.1 the bug appears on both versions

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:17 (1 by maintainers)

github_iconTop GitHub Comments

49reactions
ViGi-Pcommented, Jul 12, 2017

@theobouwman Check whether the following values are same,

  • package (usually line 2) in /android/app/src/main/AndroidManifest.xml

  • applicationId (usually line 90) in defaultConfig section of /android/app/build.gradle

  • Line 1 of /android/app/src/main/java/com/paysack/MainApplication.java

  • Line 1 of /android/app/src/main/java/com/paysack/MainActivity.java

21reactions
miakachammycommented, Feb 12, 2018

This helped me. You may have deleted/uninstalled your app, but when you check in your settings/apps, you can see that it’s not totally uninstalled.

Go to Settings. Go to Apps. Select your app. (here, you can verify that your app is not uninstalled properly). Open the overflow menu on the top right and select Uninstall for all users. Done. Try to install then launch your app again.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error type 3 Error: Activity class {} does not exist - Stack Overflow
Try changing the name of the Activity in your AndroidManifest.xml file. · This happened to e too and I had to go to...
Read more >
Different Ways to Fix "Error type 3 Error: Activity class {} does ...
“Error type 3: Activity class {} does not exist” in the Android Studio. · six methods · Step 1 · to Build >...
Read more >
Error: Activity class MainActivity does not exist #17423 - GitHub
When I run the project(react-native-cli run-android --no-packager), there is an error: Activity class MainActivity does not exist.
Read more >
Android : Error type 3 Error: Activity class {} does not exist
Android : Error type 3 Error : Activity class {} does not exist [ Beautify Your Computer : https://www.hows.tech/p/recommended.html ] Android ...
Read more >
ReactNative:Error: Activity class {.MainActivity} does not exist.
The following is that error messages filtered by app name by using AVD Manager of Android SDK Tools. The part of com.sampleproject contains ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found