Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

342
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda