Skip to content

Error: Activity class does not exist & Could not find dependency com.facebook.react:react-native:0.78.0 #49804

Description

@meriem-majdoul

Description

Hello,
I'm experiencing two issues when trying to run my React Native app on Android. Here are the details:

Issue 1: Activity class does not exist
When I execute npx react-native run-android, I get the following error:
info Starting the app on "RZ8W90J1ZZE"... Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.synergys/.MainActivity } Error type 3 Error: Activity class {com.synergys/com.synergys.MainActivity} does not exist.
Issue 2: Dependency not found
When I try to build the app in Android Studio, I get this error:
`Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.

Could not resolve all dependencies for configuration ':app:debugCompileClasspath'.
Could not find com.facebook.react:react-native:0.78.0.
Required by:
project :app

Possible solution:

Steps to reproduce

1- Verified that the React Native version in package.json is 0.78.0.
2- Added the necessary repositories in android/build.gradle:
allprojects { repositories { mavenCentral() google() maven { url 'https://repo.maven.apache.org/maven2/' } maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' } } }
3- Ran the following commands to clean and rebuild:

cd android
./gradlew clean
./gradlew build

4- Verified that MainActivity.java exists in android/app/src/main/java/com/synergys/.

React Native Version

0.78.0

Affected Platforms

Build - Windows

Output of npx @react-native-community/cli info

System:
  OS: Windows 10 10.0.19045
  CPU: (4) x64 Intel(R) Core(TM) i5-3427U CPU @ 1.80GHz
  Memory: 8.87 GB / 15.87 GB
Binaries:
  Node:
    version: 22.13.1
    path: C:\nvm4w\nodejs\node.EXE
  Yarn:
    version: 1.22.19
    path: ~\AppData\Roaming\npm\yarn.CMD
  npm:
    version: 10.9.2
    path: C:\nvm4w\nodejs\npm.CMD
  Watchman: Not Found
SDKs:
  Android SDK:
    API Levels:
      - "28"
      - "29"
      - "30"
      - "31"
      - "32"
      - "33"
      - "34"
      - "35"
    Build Tools:
      - 29.0.2
      - 30.0.2
      - 30.0.3
      - 31.0.0
      - 33.0.1
      - 33.0.2
      - 34.0.0
      - 35.0.0
    System Images:
      - android-28 | Google Play Intel x86 Atom
    Android NDK: Not Found
  Windows SDK: Not Found
IDEs:
  Android Studio: AI-242.23726.103.2422.12816248
  Visual Studio: Not Found
Languages:
  Java: 17.0.12
  Ruby: Not Found
npmPackages:
  "@react-native-community/cli":
    installed: 15.0.1
    wanted: 15.0.1
  react:
    installed: 19.0.0
    wanted: ^19.0.0
  react-native:
    installed: 0.78.0
    wanted: ^0.78.0
  react-native-windows: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: false
  newArchEnabled: true
iOS:
  hermesEnabled: Not found
  newArchEnabled: Not found

npm notice
npm notice New major version of npm available! 10.9.2 -> 11.1.0
npm notice Changelog: https://github.com/npm/cli/releases/tag/v11.1.0
npm notice To update run: npm install -g npm@11.1.0
npm notice

Stacktrace or Logs

Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
> Could not resolve all dependencies for configuration ':app:debugCompileClasspath'.
   > Could not find com.facebook.react:react-native:0.78.0.
     Required by:
         project :app

Possible solution:
 - Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html

Reproducer

https://github.com/meriem-majdoul/Siamtec

Screenshots and Videos

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs: AttentionIssues where the author has responded to feedback.Needs: ReproThis issue could be improved with a clear list of steps to reproduce the issue.StaleThere has been a lack of activity on this issue and it may be closed soon.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions