Gradle "dependency resolution error"

Last update of gradle caused unusual error and I have no idea how to fix it. :frowning: Unfortunately I can not continue work over my project with no possibility of testing on android - it makes build crash.

Duplicate class com.jme3.app.state.MjpegFileWriter found in modules jme3-android-3.2.1-stable.jar (org.jmonkeyengine:jme3-android:3.2.1-stable) and jme3-desktop-3.2.1-stable.jar (org.jmonkeyengine:jme3-desktop:3.2.1-stable)

Duplicate class com.jme3.app.state.MjpegFileWriter$AVIIndex found in modules jme3-android-3.2.1-stable.jar (org.jmonkeyengine:jme3-android:3.2.1-stable) and jme3-desktop-3.2.1-stable.jar (org.jmonkeyengine:jme3-desktop:3.2.1-stable)
Duplicate class com.jme3.app.state.MjpegFileWriter$AVIIndexList found in modules jme3-android-3.2.1-stable.jar (org.jmonkeyengine:jme3-android:3.2.1-stable) and jme3-desktop-3.2.1-stable.jar (org.jmonkeyengine:jme3-desktop:3.2.1-stable)
Duplicate class com.jme3.app.state.MjpegFileWriter$AVIJunk found in modules jme3-android-3.2.1-stable.jar (org.jmonkeyengine:jme3-android:3.2.1-stable) and jme3-desktop-3.2.1-stable.jar (org.jmonkeyengine:jme3-desktop:3.2.1-stable)
Duplicate class com.jme3.app.state.MjpegFileWriter$AVIMainHeader found in modules jme3-android-3.2.1-stable.jar (org.jmonkeyengine:jme3-android:3.2.1-stable) and jme3-desktop-3.2.1-stable.jar (org.jmonkeyengine:jme3-desktop:3.2.1-stable)
Duplicate class com.jme3.app.state.MjpegFileWriter$AVIMovieList found in modules jme3-android-3.2.1-stable.jar (org.jmonkeyengine:jme3-android:3.2.1-stable) and jme3-desktop-3.2.1-stable.jar (org.jmonkeyengine:jme3-desktop:3.2.1-stable)
Duplicate class com.jme3.app.state.MjpegFileWriter$AVIStreamFormat found in modules jme3-android-3.2.1-stable.jar (org.jmonkeyengine:jme3-android:3.2.1-stable) and jme3-desktop-3.2.1-stable.jar (org.jmonkeyengine:jme3-desktop:3.2.1-stable)
Duplicate class com.jme3.app.state.MjpegFileWriter$AVIStreamHeader found in modules jme3-android-3.2.1-stable.jar (org.jmonkeyengine:jme3-android:3.2.1-stable) and jme3-desktop-3.2.1-stable.jar (org.jmonkeyengine:jme3-desktop:3.2.1-stable)
Duplicate class com.jme3.app.state.MjpegFileWriter$AVIStreamList found in modules jme3-android-3.2.1-stable.jar (org.jmonkeyengine:jme3-android:3.2.1-stable) and jme3-desktop-3.2.1-stable.jar (org.jmonkeyengine:jme3-desktop:3.2.1-stable)
Duplicate class com.jme3.app.state.MjpegFileWriter$RIFFHeader found in modules jme3-android-3.2.1-stable.jar (org.jmonkeyengine:jme3-android:3.2.1-stable) and jme3-desktop-3.2.1-stable.jar (org.jmonkeyengine:jme3-desktop:3.2.1-stable)
Duplicate class com.jme3.app.state.VideoRecorderAppState found in modules jme3-android-3.2.1-stable.jar (org.jmonkeyengine:jme3-android:3.2.1-stable) and jme3-desktop-3.2.1-stable.jar (org.jmonkeyengine:jme3-desktop:3.2.1-stable)
Duplicate class com.jme3.app.state.VideoRecorderAppState$1 found in modules jme3-android-3.2.1-stable.jar (org.jmonkeyengine:jme3-android:3.2.1-stable) and jme3-desktop-3.2.1-stable.jar (org.jmonkeyengine:jme3-desktop:3.2.1-stable)
Duplicate class com.jme3.app.state.VideoRecorderAppState$IsoTimer found in modules jme3-android-3.2.1-stable.jar (org.jmonkeyengine:jme3-android:3.2.1-stable) and jme3-desktop-3.2.1-stable.jar (org.jmonkeyengine:jme3-desktop:3.2.1-stable)
Duplicate class com.jme3.app.state.VideoRecorderAppState$VideoProcessor found in modules jme3-android-3.2.1-stable.jar (org.jmonkeyengine:jme3-android:3.2.1-stable) and jme3-desktop-3.2.1-stable.jar (org.jmonkeyengine:jme3-desktop:3.2.1-stable)
Duplicate class com.jme3.app.state.VideoRecorderAppState$VideoProcessor$1 found in modules jme3-android-3.2.1-stable.jar (org.jmonkeyengine:jme3-android:3.2.1-stable) and jme3-desktop-3.2.1-stable.jar (org.jmonkeyengine:jme3-desktop:3.2.1-stable)
Duplicate class com.jme3.app.state.VideoRecorderAppState$WorkItem found in modules jme3-android-3.2.1-stable.jar (org.jmonkeyengine:jme3-android:3.2.1-stable) and jme3-desktop-3.2.1-stable.jar (org.jmonkeyengine:jme3-desktop:3.2.1-stable)

Go to the documentation to learn how to Fix dependency resolution errors.

Thanks for any help

Don’t include the desktop jar in the android build.
Don’t include the android jar in the desktop build.

O.K. but I didn’t change anything in settings / dependencies. What happened? Where to find this?

You said “latest update of gradle” but I’m not sure what you mean by that. Whatever you did you could undo. But in reality you should only be including the necessary dependencies anyway. There’s no need to include the desktop jar on Android, it will just bloat your jar, and there’s no telling if you’re depending on desktop methods that shouldn’t be used on Android.

I guess the easiest way is to use desktop on a debug build and Android on a release build.

I mean, if it were me, I’d try to do something like:

  • /MyCoolGame
    • /android
    • /desktop
    • /common

…or something. Then the common code goes in common and depends on jme-core. desktop depends on common and jme-desktop, android depends on common and jme-android.

But I’ve also never built for android before. It just seems likely to me that the android/build.gradle file will be very different from the simpler desktop/build.gradle

Thanks guys. Now I just have something like below and still dont know whats going on:

Android resource linking failed

C:\Users\Laptop HP.jmonkeyplatform\assetpacks\JME-Example-master\android\build\intermediates\incremental\mergeDebugResources\merged.dir\values-v28\values-v28.xml:7: error: resource android:attr/dialogCornerRadius not found.
C:\Users\Laptop HP.jmonkeyplatform\assetpacks\JME-Example-master\android\build\intermediates\incremental\mergeDebugResources\merged.dir\values-v28\values-v28.xml:11: error: resource android:attr/dialogCornerRadius not found.
C:\Users\Laptop HP.jmonkeyplatform\assetpacks\JME-Example-master\android\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:2611: error: resource android:attr/fontVariationSettings not found.
C:\Users\Laptop HP.jmonkeyplatform\assetpacks\JME-Example-master\android\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:2612: error: resource android:attr/ttcIndex not found.
error: failed linking references.