upgrade-support
upgrade-support copied to clipboard
/android/app/build/generated/autolinking/src/main/java/com/facebook/react/PackageList.java:70: error: duplicate class: com.facebook.react.PackageList public class PackageList {
/android/app/build/generated/autolinking/src/main/java/com/facebook/react/PackageList.java:70: error: duplicate class: com.facebook.react.PackageList public class PackageList { ^ 1 error FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':app:compileDebugJavaWithJavac'.
I think you forgot to remove this code at the bottom of andoird/app/build.gradle
apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
@iwangsyah I had the same problem, and this answer helped me! I think I actually forgot to delete the code in that line 😄
It seems I'm facing a similar issue. I'm unsure why this file is being generated after deletion and why it's necessary to run the app. Additionally, I've noticed that in some React Native projects, this file isn't even present.
I faced the same issue when I migrated my project from React Native version 0.74.x to 0.75.x. I finally resolved it.
android/app/build/generated/autolinking/src/main/java/com/facebook/react/PackageList.java:56: error: duplicate class: com.facebook.react.PackageList public class PackageList { ^ 1 error
FAILURE: Build failed with an exception.
- What went wrong: Execution failed for task ':app:compileDebugJavaWithJavac'.
Compilation failed; see the compiler error output for details.
I am still getting this error and above solution didn't worked for me
react-native version 0.74.2
anyone can suggest me for the solution
Thanks
@manishmobmaxime Did you find any solution?
@shahid3130khan @manishmobmaxime did you fix this?
I think you forgot to remove this code at the bottom of andoird/app/build.gradle
apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
I was having the same issue migrating from 0.74.5 to 0.76.5. The solution suggested here fixed the problem, however, the line to be deleted was not at the end of the file, but at line 122 (a few lines before the end).
I think you forgot to remove this code at the bottom of andoird/app/build.gradle
apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)I was having the same issue migrating from 0.74.5 to 0.76.5. The solution suggested here fixed the problem, however, the line to be deleted was not at the end of the file, but at line 122 (a few lines before the end).
I successfully solved the problem using the above method, but now it prompts me
Cannot resolve symbol 'SafeAreaContextPackage'
Cannot resolve symbol 'RNScreensPackage'
Can anyone provide some help?
I think you forgot to remove this code at the bottom of andoird/app/build.gradle
apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)I was having the same issue migrating from 0.74.5 to 0.76.5. The solution suggested here fixed the problem, however, the line to be deleted was not at the end of the file, but at line 122 (a few lines before the end).
I successfully solved the problem using the above method, but now it prompts me
Cannot resolve symbol 'SafeAreaContextPackage' Cannot resolve symbol 'RNScreensPackage'
Can anyone provide some help?
Check if your app/build.gradle file has auto link enabled, as in the example below:
react { autolinkLibrariesWithApp() }
Combining this https://github.com/react-native-community/upgrade-support/issues/285#issuecomment-2295761824
With this https://github.com/react-native-community/upgrade-support/issues/285#issuecomment-2682062918
Solved the issue for me !