cli icon indicating copy to clipboard operation
cli copied to clipboard

React Native Android build fails with "package com.facebook.react.common.annotations.internal.LegacyArchitectureLogger; does not exist" on React Native 0.78

Open ChinmayLale opened this issue 6 months ago • 0 comments

React Native Android build fails with "package com.facebook.react.common.annotations.internal does not exist" on React Native 0.78

I'm encountering a build failure when running yarn android for my React Native project (RN 0.78). The error occurs during :app:compileDebugJavaWithJavac and seems related to autogenerated New Architecture files. iOS builds work fine.

Error Snippet:

/Users/socon/Documents/Chinmay/socon-mobile/android/app/build/generated/autolinking/src/main/java/com/facebook/react/ReactNativeApplicationEntryPoint.java:8: error: package com.facebook.react.common.annotations.internal does not exist import com.facebook.react.common.annotations.internal.LegacyArchitectureLogger;

What I've tried:

  1. ./gradlew clean (succeeds but doesn't resolve)
  2. ./gradlew build fails with same error
  3. Toggled newArchEnabled in gradle.properties (both true/false)
  4. Cleared all caches (yarn cache clean, ./gradlew clean, deleted node_modules, android/.gradle, android/build)
  5. Verified React Native doctor (npx react-native doctor shows no issues)

Environment:

  • React Native: 0.78.0
  • React: 19.0.0
  • Vision Camera: 4.6.4
  • Gradle: 8.12 (with JDK 17)

Relevant package.json Dependencies:

"dependencies": { "react": "19.0.0", "react-native": "0.78.0", "react-native-vision-camera": "^4.6.4", "react-native-worklets-core": "^1.5.0", "react-native-reanimated": "3.18.0" }, "devDependencies": { "@react-native-community/cli": "15.0.1", "@react-native/babel-preset": "0.78.0" }

Question: How can I resolve this missing package error related to New Architecture autogenerated files? Specifically: Are there known solutions for the LegacyArchitectureLogger import failure in autogenerated code?

ChinmayLale avatar Jun 19 '25 06:06 ChinmayLale