Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

344
Views
Dependencies of an Android plugin for Unity collide with the dependencies downloaded by unity-jar-resolver

There is this situation where I am trying to use MLKit inside Unity. Naturally I make an Android plugin. Here are the Gradle dependencies:

dependencies {
    implementation 'androidx.appcompat:appcompat:1.2.0'
    implementation 'com.google.android.material:material:1.3.0'
    testImplementation 'junit:junit:4.+'
    androidTestImplementation 'androidx.test.ext:junit:1.1.2'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'

    implementation "androidx.camera:camera-camera2:1.1.0-alpha02"
    implementation "com.google.mlkit:pose-detection:17.0.1-beta3"
}

Then I compile the .aar using

task copyPlugin(type: Copy) {
    dependsOn assemble
    from ('build/outputs/aar')
    into ('../../../Assets/Plugins/Android')
    include (project.name + '-release.aar')
}

What happens next is that Unity is not able to access androidx.camera:camera-camera2:1.1.0-alpha02 or com.google.mlkit:pose-detection:17.0.1-beta3. Because of this, I have to use unity-jar-resolver to download the dependencies so that Unity will link them with the resulting app. I expected everything will work but now the dependencies seem to collide. Can you give me an insight into this? Here is the Unity build error:

* What went wrong:
Execution failed for task ':launcher:checkDebugDuplicateClasses'.
> 1 exception was raised by workers:
  java.lang.RuntimeException: java.lang.RuntimeException: Duplicate class androidx.camera.camera2.Camera2Config found in modules PoseDetector-release-runtime.jar (:PoseDetector-release:) and androidx.camera.camera-camera2-1.1.0-alpha02-runtime.jar (:androidx.camera.camera-camera2-1.1.0-alpha02:)
  Duplicate class androidx.camera.camera2.Camera2Config$DefaultProvider found in modules PoseDetector-release-runtime.jar (:PoseDetector-release:) and androidx.camera.camera-camera2-1.1.0-alpha02-runtime.jar (:androidx.camera.camera-camera2-1.1.0-alpha02:)
  Duplicate class androidx.camera.camera2.impl.Camera2CameraCaptureResultConverter found in modules PoseDetector-release-runtime.jar (:PoseDetector-release:) and androidx.camera.camera-camera2-1.1.0-alpha02-runtime.jar (:androidx.camera.camera-camera2-1.1.0-alpha02:)
over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

As the error message suggests, the same stuff seams to be around in two separate dependencies: once in ":PoseDetector-release:" and once in ":androidx.camera.camera-camera2-1.1.0-alpha02:"

I have run in this issue before, and was able to solve it. Sometimes it takes longer to find out which dependencies to remove.

The solution to this error is to remove one of the duplicate dependencies, in my case I believe it was removing the android plugin folder of some SDK in my Project's Assets Folder, due to the fact that the same dependency was already included by some package I downloaded and imported via the unity package manager.

The two cases I can think of, where my answer is garbage are:

  • The collision is NOT due to collision between same dependencies, but just between namespaces

  • You can not remove neither of the two dependencies because they only overlap, but BOTH each contain MORE stuff you need, which is NOT already included in the other one

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!