Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

/android/app/build/generated/autolinking/src/main/java/com/facebook/react/PackageList.java:70: error: duplicate class: com.facebook.react.PackageList public class PackageList { #285

Open
SrinjoyBarman opened this issue Aug 17, 2024 · 6 comments

Comments

@SrinjoyBarman
Copy link

/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'.

@iwangsyah
Copy link

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)

@jieey1140
Copy link

@iwangsyah I had the same problem, and this answer helped me!
I think I actually forgot to delete the code in that line 😄

@g7crservice-Nandan-Kumar-Pandey

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.

@MAsadIlyasNajum
Copy link

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.

@manishmobmaxime
Copy link

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

@shahid3130khan
Copy link

@manishmobmaxime Did you find any solution?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants