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

react-native-iosandroid-0-71 Duplicate class a.a.a found in modules core-1.22.0.aar #661

Open
fortyone-41 opened this issue Oct 6, 2024 · 4 comments
Assignees
Milestone

Comments

@fortyone-41
Copy link

fortyone-41 commented Oct 6, 2024

Describe the bug
In library react-native-iosandroid-0-71, in build.gradle there is string: implementation 'com.google.ar:core:1.22.0', which is the reason of error about duplicate class. If i comment it, app starts but works incorrectly (immediately closes)

To Reproduce
Steps to reproduce the behavior:

  1. install @babylonjs/react-native-iosandroid-0-71
  2. npx react-native run-android
  3. See error 'Duplicate class a.a.a found in modules core-1.22.0.aar -> core-1.22.0-runtime (com.google.ar:core:1.22.0) and installreferrer-2.2.aar -> installreferrer-2.2-runtime (com.android.installreferrer:installreferrer:2.2)'

Expected behavior
App starts

@bghgary bghgary added this to the 8.0 milestone Oct 7, 2024
@fortyone-41
Copy link
Author

Meanwhile, I found out how i can fix it, but it seems like not a good solution

configurations {
        all*.exclude module: 'installreferrer'
    }

@CedricGuillemet
Copy link
Contributor

Maybe it's possible to check in BRN gradle file if dependency already exists. Can you please try to add these lines in BaylonReactNative gradle and see if it fixes the issue:

dependencies {
    implementation('com.google.ar:core:1.22.0') {
        exclude group: 'com.google.ar', module: 'core'
    }
...
}

@fortyone-41
Copy link
Author

Maybe it's possible to check in BRN gradle file if dependency already exists. Can you please try to add these lines in BaylonReactNative gradle and see if it fixes the issue:

dependencies {
    implementation('com.google.ar:core:1.22.0') {
        exclude group: 'com.google.ar', module: 'core'
    }
...
}

Ive tried it, and it didn't help.

@CedricGuillemet
Copy link
Contributor

Do get some results at chechking root projects dependencies?

def parentHasDependency(String group, String name) {
    rootProject.configurations.each { config ->
        config.dependencies.each { dep ->
            if (dep.group == group && dep.name == name) {
                return true
            }
        }
    }
    return false
}

if (!parentHasDependency('com.google.ar', 'core')) {
    dependencies {
        implementation 'com.google.ar:core:1.22.0'
    }
}

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

No branches or pull requests

3 participants