I am getting the following error when Gradle is set 7.2.2.
Duplicate class androidx.lifecycle.ViewModelLazy found in modules jetified-lifecycle-viewmodel-ktx-2.3.1-runtime (androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1) and lifecycle-viewmodel-2.5.1-runtime (androidx.lifecycle:lifecycle-viewmodel:2.5.1)
Duplicate class androidx.lifecycle.ViewTreeViewModelKt found in modules jetified-lifecycle-viewmodel-ktx-2.3.1-runtime (androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1) and lifecycle-viewmodel-2.5.1-runtime (androidx.lifecycle:lifecycle-viewmodel:2.5.1)
This is not in my program but in Android Studio.
How do I correct the problem?
Thanks,
Bill
In your build.gradle try adding this:
implementation "androidx.lifecycle:lifecycle-livedata-ktx:2.5.1"
This worked for me.
I added it but no change.
Duplicate class androidx.lifecycle.ViewModelLazy found in modules jetified-lifecycle-viewmodel-ktx-2.3.1-runtime (androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1) and lifecycle-viewmodel-2.5.1-runtime (androidx.lifecycle:lifecycle-viewmodel:2.5.1)
Duplicate class androidx.lifecycle.ViewTreeViewModelKt found in modules jetified-lifecycle-viewmodel-ktx-2.3.1-runtime (androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1) and lifecycle-viewmodel-2.5.1-runtime (androidx.lifecycle:lifecycle-viewmodel:2.5.1)
This error is caused by duplication of dependencies
To solve the same:
You must open Gradle Scripts-->build.gradle(Module: YourApp)
Or
You can just choose to search the builder:app file in Navigate--> Search Everywhere, type "build.gradle " and choose the option that appears build.gradle (: app)
Inside your build.gradle file it checks which of the implementations made in the dependencies tag was duplicated and deletes one of them.
Now
rebuild your app and good work!
I want to integrate the Jitsi meeting and send-bird into my project. For that, I added the below dependencies.
implementation 'com.sendbird.sdk:sendbird-android-sdk:3.1.15'
implementation 'com.sendbird.sdk:sendbird-calls:1.8.0'
implementation('org.jitsi.react:jitsi-meet-sdk:6.0.0') {
transitive = true
}
But when I am trying to run the project I'm getting the below errors.
> Task :app:dexBuilderDebug
FAILURE: Build completed with 2 failures.
1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':app:checkDebugDuplicateClasses'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable
> Duplicate class org.webrtc.AndroidVideoDecoder found in modules jetified-react-native-webrtc-1.100.1-jitsi-11101599-runtime (com.facebook.react:react-native-webrtc:1.100.1-jitsi-11101599) and jetified-sendbird-calls-1.8.0-runtime (com.sendbird.sdk:sendbird-calls:1.8.0)
Duplicate class org.webrtc.AndroidVideoDecoder$1 found in modules jetified-react-native-webrtc-1.100.1-jitsi-11101599-runtime (com.facebook.react:react-native-webrtc:1.100.1-jitsi-11101599) and jetified-sendbird-calls-1.8.0-runtime (com.sendbird.sdk:sendbird-calls:1.8.0)
Duplicate class org.webrtc.AndroidVideoDecoder$DecodedTextureMetadata found in modules jetified-react-native-webrtc-1.100.1-jitsi-11101599-runtime (com.facebook.react:react-native-webrtc:1.100.1-jitsi-11101599) and jetified-sendbird-calls-1.8.0-runtime (com.sendbird.sdk:sendbird-calls:1.8.0)
Duplicate class org.webrtc.AndroidVideoDecoder$FrameInfo found in modules jetified-react-native-webrtc-1.100.1-jitsi-11101599-runtime (com.facebook.react:react-native-webrtc:1.100.1-jitsi-11101599) and jetified-sendbird-calls-1.8.0-runtime (com.sendbird.sdk:sendbird-calls:1.8.0)
Duplicate class org.webrtc.AudioDecoderFactoryFactory found in modules jetified-react-native-webrtc-1.100.1-jitsi-11101599-runtime (com.facebook.react:react-native-webrtc:1.100.1-jitsi-11101599) and jetified-sendbird-calls-1.8.0-runtime (com.sendbird.sdk:sendbird-calls:1.8.0)
Duplicate class org.webrtc.AudioEncoderFactoryFactory found in modules jetified-react-native-webrtc-1.100.1-jitsi-11101599-runtime (com.facebook.react:react-native-webrtc:1.100.1-jitsi-11101599) and jetified-sendbird-calls-1.8.0-runtime (com.sendbird.sdk:sendbird-calls:1.8.0)
Duplicate class org.webrtc.AudioProcessingFactory found in modules jetified-react-native-webrtc-1.100.1-jitsi-11101599-runtime (com.facebook.react:react-native-webrtc:1.100.1-jitsi-11101599) and jetified-sendbird-calls-1.8.0-runtime (com.sendbird.sdk:sendbird-calls:1.8.0)
Duplicate class org.webrtc.AudioSource found in modules jetified-react-native-webrtc-1.100.1-jitsi-11101599-runtime (com.facebook.react:react-native-webrtc:1.100.1-jitsi-11101599) and jetified-sendbird-calls-1.8.0-runtime (com.sendbird.sdk:sendbird-calls:1.8.0)
Duplicate class org.webrtc.AudioTrack found in modules jetified-react-native-webrtc-1.100.1-jitsi-11101599-runtime (com.facebook.react:react-native-webrtc:1.100.1-jitsi-11101599) and jetified-sendbird-calls-1.8.0-runtime (com.sendbird.sdk:sendbird-calls:1.8.0)
Duplicate class org.webrtc.BaseBitrateAdjuster found in modules jetified-react-native-webrtc-1.100.1-jitsi-11101599-runtime (com.facebook.react:react-native-webrtc:1.100.1-jitsi-11101599) and jetified-sendbird-calls-1.8.0-runtime (com.sendbird.sdk:sendbird-calls:1.8.0)
Duplicate class org.webrtc.BitrateAdjuster found in modules jetified-react-native-webrtc-1.100.1-jitsi-11101599-runtime (com.facebook.react:react-native-webrtc:1.100.1-jitsi-11101599) and jetified-sendbird-calls-1.8.0-runtime (com.sendbird.sdk:sendbird-calls:1.8.0)
Duplicate class org.webrtc.BuiltinAudioDecoderFactoryFactory found in modules jetified-react-native-webrtc-1.100.1-jitsi-11101599-runtime (com.facebook.react:react-native-webrtc:1.100.1-jitsi-11101599) and jetified-sendbird-calls-1.8.0-runtime (com.sendbird.sdk:sendbird-calls:1.8.0)
Duplicate class org.webrtc.BuiltinAudioEncoderFactoryFactory found in modules jetified-react-native-webrtc-1.100.1-jitsi-11101599-runtime (com.facebook.react:react-native-webrtc:1.100.1-jitsi-11101599) and jetified-sendbird-calls-1.8.0-runtime (com.sendbird.sdk:sendbird-calls:1.8.0)
Duplicate class org.webrtc.CallSessionFileRotatingLogSink found in modules jetified-react-native-webrtc-1.100.1-jitsi-11101599-runtime (com.facebook.react:react-native-webrtc:1.100.1-jitsi-11101599) and jetified-sendbird-calls-1.8.0-runtime (com.sendbird.sdk:sendbird-calls:1.8.0)
Duplicate class org.webrtc.CalledByNative found in modules jetified-react-native-webrtc-1.100.1-jitsi-11101599-runtime (com.facebook.react:react-native-webrtc:1.100.1-jitsi-11101599) and jetified-sendbird-calls-1.8.0-runtime (com.sendbird.sdk:sendbird-calls:1.8.0)
==============================================================================
* Get more help at https://help.gradle.org
BUILD FAILED in 3s
33 actionable tasks: 9 executed, 24 up-to-date
Caused by: com.android.builder.merge.DuplicateRelativeFileException: 2 files found with path 'lib/arm64-v8a/libjingle_peerconnection_so.so' from inputs:
Please help who knows answer.
Perhaps this is no longer relevant, but try to add the conflicting module to the exclude group:
implementation(project(':react-native-jitsi-meet')) {
exclude group: 'com.facebook.react', module: 'react-native-webrtc'
}
In my case, I use react native
While updating my app to the latest library versions, I have encountered the following issue:
Duplicate class com.google.android.gms.internal.measurement.zzfu found in modules jetified-play-services-measurement-base-18.0.3-runtime (com.google.android.gms:play-services-measurement-base:18.0.3) and jetified-play-services-measurement-impl-18.0.0-runtime (com.google.android.gms:play-services-measurement-impl:18.0.0)
Duplicate class com.google.android.gms.internal.measurement.zzfv found in modules jetified-play-services-measurement-base-18.0.3-runtime (com.google.android.gms:play-services-measurement-base:18.0.3) and jetified-play-services-measurement-impl-18.0.0-runtime (com.google.android.gms:play-services-measurement-impl:18.0.0)
Duplicate class com.google.android.gms.internal.measurement.zzfw found in modules jetified-play-services-measurement-base-18.0.3-runtime (com.google.android.gms:play-services-measurement-base:18.0.3) and jetified-play-services-measurement-impl-18.0.0-runtime (com.google.android.gms:play-services-measurement-impl:18.0.0)
Duplicate class com.google.android.gms.internal.measurement.zzfx found in modules jetified-play-services-measurement-base-18.0.3-runtime (com.google.android.gms:play-services-measurement-base:18.0.3) and jetified-play-services-measurement-impl-18.0.0-runtime (com.google.android.gms:play-services-measurement-impl:18.0.0)
Duplicate class com.google.android.gms.internal.measurement.zzfy found in modules jetified-play-services-measurement-base-18.0.3-runtime (com.google.android.gms:play-services-measurement-base:18.0.3) and jetified-play-services-measurement-impl-18.0.0-runtime (com.google.android.gms:play-services-measurement-impl:18.0.0)
Duplicate class com.google.android.gms.internal.measurement.zzfz found in modules jetified-play-services-measurement-base-18.0.3-runtime (com.google.android.gms:play-services-measurement-base:18.0.3) and jetified-play-services-measurement-impl-18.0.0-runtime (com.google.android.gms:play-services-measurement-impl:18.0.0)
Duplicate class com.google.android.gms.internal.measurement.zzq found in modules jetified-play-services-measurement-base-18.0.3-runtime (com.google.android.gms:play-services-measurement-base:18.0.3) and jetified-play-services-measurement-impl-18.0.0-runtime (com.google.android.gms:play-services-measurement-impl:18.0.0)
Duplicate class com.google.android.gms.internal.measurement.zzs found in modules jetified-play-services-measurement-base-18.0.3-runtime (com.google.android.gms:play-services-measurement-base:18.0.3) and jetified-play-services-measurement-impl-18.0.0-runtime (com.google.android.gms:play-services-measurement-impl:18.0.0)
Duplicate class com.google.android.gms.measurement.internal.zzfh found in modules jetified-play-services-measurement-base-18.0.3-runtime (com.google.android.gms:play-services-measurement-base:18.0.3) and jetified-play-services-measurement-impl-18.0.0-runtime (com.google.android.gms:play-services-measurement-impl:18.0.0)
Duplicate class com.google.android.gms.measurement.internal.zzgl found in modules jetified-play-services-measurement-18.0.0-runtime (com.google.android.gms:play-services-measurement:18.0.0) and jetified-play-services-measurement-base-18.0.3-runtime (com.google.android.gms:play-services-measurement-base:18.0.3)
Duplicate class com.google.android.gms.measurement.internal.zzgm found in modules jetified-play-services-measurement-18.0.0-runtime (com.google.android.gms:play-services-measurement:18.0.0) and jetified-play-services-measurement-base-18.0.3-runtime (com.google.android.gms:play-services-measurement-base:18.0.3)
Duplicate class com.google.android.gms.measurement.internal.zzgn found in modules jetified-play-services-measurement-18.0.0-runtime (com.google.android.gms:play-services-measurement:18.0.0) and jetified-play-services-measurement-base-18.0.3-runtime (com.google.android.gms:play-services-measurement-base:18.0.3)
Duplicate class com.google.android.gms.measurement.internal.zzgo found in modules jetified-play-services-measurement-18.0.0-runtime (com.google.android.gms:play-services-measurement:18.0.0) and jetified-play-services-measurement-base-18.0.3-runtime (com.google.android.gms:play-services-measurement-base:18.0.3)
Duplicate class com.google.android.gms.measurement.internal.zzgp found in modules jetified-play-services-measurement-18.0.0-runtime (com.google.android.gms:play-services-measurement:18.0.0) and jetified-play-services-measurement-base-18.0.3-runtime (com.google.android.gms:play-services-measurement-base:18.0.3)
Duplicate class com.google.android.gms.measurement.internal.zzgq found in modules jetified-play-services-measurement-base-18.0.3-runtime (com.google.android.gms:play-services-measurement-base:18.0.3) and jetified-play-services-measurement-impl-18.0.0-runtime (com.google.android.gms:play-services-measurement-impl:18.0.0)
Duplicate class com.google.android.gms.measurement.internal.zzhs found in modules jetified-play-services-measurement-base-18.0.3-runtime (com.google.android.gms:play-services-measurement-base:18.0.3) and jetified-play-services-measurement-impl-18.0.0-runtime (com.google.android.gms:play-services-measurement-impl:18.0.0)
Duplicate class com.google.android.gms.measurement.internal.zzhx found in modules jetified-play-services-measurement-base-18.0.3-runtime (com.google.android.gms:play-services-measurement-base:18.0.3) and jetified-play-services-measurement-impl-18.0.0-runtime (com.google.android.gms:play-services-measurement-impl:18.0.0)
Go to the documentation to learn how to Fix dependency resolution errors.
After checking the dependencies, I was able to fix the build errors using the following in my build.gradle file:
resolutionStrategy {
force("com.google.android.gms:play-services-measurement-base:18.0.0")
force("com.google.android.gms:play-services-measurement-sdk-api:18.0.0")
}
Although the app builds fine and ads are showing, I am worried that overriding the the default dependency versions for google play ads library will cause some issue with impression tracking, etc.
Is there any official solution here? I need analytics and ads. Is there something I'm missing here?
Thanks!
I'm having issues getting the UnityPlayer dependencies into my Android Library plugin for Unity.
I just can't figure out the correct way to add dependencies to my plugin.
Before I was trying to add a classes.jar file to my libs directory that contains all the UnityPlayer code, and that got me to the point where I can write code without intellisense errors, but when I build and run I get this massive output.
CommandInvokationFailure: Gradle build failed.
C:\Program Files\Unity\Hub\Editor\2018.4.14f1\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\OpenJDK\Windows\bin\java.exe -classpath "C:\Program Files\Unity\Hub\Editor\2018.4.14f1\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\gradle\lib\gradle-launcher-5.1.1.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx4096m" "assembleRelease"
stderr[
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':checkReleaseDuplicateClasses'.
> 1 exception was raised by workers:
java.lang.RuntimeException: Duplicate class bitter.jnibridge.JNIBridge found in modules classes-2.jar (:coffeeplugin-release:) and unity-classes.jar (unity-classes.jar)
Duplicate class bitter.jnibridge.JNIBridge$a found in modules classes-2.jar (:coffeeplugin-release:) and unity-classes.jar (unity-classes.jar)
Duplicate class com.unity3d.player.NativeLoader found in modules classes-2.jar (:coffeeplugin-release:) and unity-classes.jar (unity-classes.jar)
Duplicate class com.unity3d.player.ReflectionHelper found in modules classes-2.jar (:coffeeplugin-release:) and unity-classes.jar (unity-classes.jar)
Duplicate class com.unity3d.player.ReflectionHelper$1 found in modules classes-2.jar (:coffeeplugin-release:) and unity-classes.jar (unity-classes.jar)
Duplicate class com.unity3d.player.ReflectionHelper$a found in modules classes-2.jar (:coffeeplugin-release:) and unity-classes.jar (unity-classes.jar)
Duplicate class com.unity3d.player.UnityPlayer found in modules classes-2.jar (:coffeeplugin-release:) and unity-classes.jar (unity-classes.jar)
Duplicate class com.unity3d.player.UnityPlayer$1 found in modules classes-2.jar (:coffeeplugin-release:) and unity-classes.jar (unity-classes.jar)
Duplicate class com.unity3d.player.UnityPlayer$10 found in modules classes-2.jar (:coffeeplugin-release:) and unity-classes.jar (unity-classes.jar)
Duplicate class com.unity3d.player.UnityPlayer$11 found in modules classes-2.jar (:coffeeplugin-release:) and unity-classes.jar (unity-classes.jar)
Duplicate class com.unity3d.player.UnityPlayer$12 found in modules classes-2.jar (:coffeeplugin-release:) and unity-classes.jar (unity-classes.jar)
Duplicate class com.unity3d.player.UnityPlayer$13 found in modules classes-2.jar (:coffeeplugin-release:) and unity-classes.jar (unity-classes.jar)
Duplicate class com.unity3d.player.UnityPlayer$14 found in modules classes-2.jar (:coffeeplugin-release:) and unity-classes.jar (unity-classes.jar)
Duplicate class com.unity3d.player.UnityPlayer$15 found in modules classes-2.jar (:coffeeplugin-release:) and unity-classes.jar (unity-classes.jar)
Duplicate class com.unity3d.player.UnityPlayer$16 found in modules classes-2.jar (:coffeeplugin-release:) and unity-classes.jar (unity-classes.jar)
Duplicate class com.unity3d.player.UnityPlayer$17 found in modules classes-2.jar (:coffeeplugin-release:) and unity-classes.jar (unity-classes.jar)
Duplicate class com.unity3d.player.UnityPlayer$18 found in modules classes-2.jar (:coffeeplugin-release:) and unity-classes.jar (unity-classes.jar)
Duplicate class com.unity3d.player.UnityPlayer$19 found in modules classes-2.jar (:coffeeplugin-release:) and unity-classes.jar (unity-classes.jar)
Duplicate class com.unity3d.player.UnityPlayer$2 found in modules classes-2.jar (:coffeeplugin-release:) and unity-classes.jar (unity-classes.jar)
Duplicate class com.unity3d.player.UnityPlayer$3 found in modules classes-2.jar (:coffeeplugin-release:) and unity-classes.jar (unity-classes.jar)
Duplicate class com.unity3d.player.UnityPlayer$4 found in modules classes-2.jar (:coffeeplugin-release:) and unity-classes.jar (unity-classes.jar)
Duplicate class com.unity3d.player.UnityPlayer$5 found in modules classes-2.jar (:coffeeplugin-release:) and unity-classes.jar (unity-classes.jar)
Duplicate class com.unity3d.player.UnityPlayer$6 found in modules classes-2.jar (:coffeeplugin-release:) and unity-classes.jar (unity-classes.jar)
Duplicate class com.unity3d.player.UnityPlayer$7 found in modules classes-2.jar (:coffeeplugin-release:) and unity-classes.jar (unity-classes.jar)
Duplicate class com.unity3d.player.UnityPlayer$8 found in modules classes-2.jar (:coffeeplugin-release:) and unity-classes.jar (unity-classes.jar)
Duplicate class com.unity3d.player.UnityPlayer$9 found in modules classes-2.jar (:coffeeplugin-release:) and unity-classes.jar (unity-classes.jar)
Duplicate class com.unity3d.player.UnityPlayer$a found in modules classes-2.jar (:coffeeplugin-release:) and unity-classes.jar (unity-classes.jar)
Duplicate class com.unity3d.player.UnityPlayer$b found in modules classes-2.jar (:coffeeplugin-release:) and unity-classes.jar (unity-classes.jar)
Duplicate class com.unity3d.player.UnityPlayer$c found in modules classes-2.jar (:coffeeplugin-release:) and unity-classes.jar (unity-classes.jar)
Duplicate class com.unity3d.player.UnityPlayerActivity found in modules classes-2.jar (:coffeeplugin-release:) and unity-classes.jar (unity-classes.jar)
Duplicate class com.unity3d.player.a found in modules classes-2.jar (:coffeeplugin-release:) and unity-classes.jar (unity-classes.jar)
Duplicate class com.unity3d.player.a$1 found in modules classes-2.jar (:coffeeplugin-release:) and unity-classes.jar (unity-classes.jar)
Duplicate class com.unity3d.player.a$2 found in modules classes-2.jar (:coffeeplugin-release:) and unity-classes.jar (unity-classes.jar)
Duplicate class com.unity3d.player.a$a found in modules classes-2.jar (:coffeeplugin-release:) and unity-classes.jar (unity-classes.jar)
Duplicate class com.unity3d.player.b found in modules classes-2.jar (:coffeeplugin-release:) and unity-classes.jar (unity-classes.jar)
Duplicate class com.unity3d.player.c found in modules classes-2.jar (:coffeeplugin-release:) and unity-classes.jar (unity-classes.jar)
Duplicate class com.unity3d.player.d found in modules classes-2.jar (:coffeeplugin-release:) and unity-classes.jar (unity-classes.jar)
Duplicate class com.unity3d.player.e found in modules classes-2.jar (:coffeeplugin-release:) and unity-classes.jar (unity-classes.jar)
Duplicate class com.unity3d.player.f found in modules classes-2.jar (:coffeeplugin-release:) and unity-classes.jar (unity-classes.jar)
Duplicate class com.unity3d.player.g found in modules classes-2.jar (:coffeeplugin-release:) and unity-classes.jar (unity-classes.jar)
Duplicate class com.unity3d.player.h found in modules classes-2.jar (:coffeeplugin-release:) and unity-classes.jar (unity-classes.jar)
Duplicate class com.unity3d.player.i found in modules classes-2.jar (:coffeeplugin-release:) and unity-classes.jar (unity-classes.jar)
Duplicate class com.unity3d.player.j found in modules classes-2.jar (:coffeeplugin-release:) and unity-classes.jar (unity-classes.jar)
Duplicate class com.unity3d.player.k found in modules classes-2.jar (:coffeeplugin-release:) and unity-classes.jar (unity-classes.jar)
Duplicate class com.unity3d.player.k$1 found in modules classes-2.jar (:coffeeplugin-release:) and unity-classes.jar (unity-classes.jar)
Duplicate class com.unity3d.player.l found in modules classes-2.jar (:coffeeplugin-release:) and unity-classes.jar (unity-classes.jar)
Duplicate class com.unity3d.player.m found in modules classes-2.jar (:coffeeplugin-release:) and unity-classes.jar (unity-classes.jar)
Duplicate class com.unity3d.player.n found in modules classes-2.jar (:coffeeplugin-release:) and unity-classes.jar (unity-classes.jar)
Duplicate class com.unity3d.player.o found in modules classes-2.jar (:coffeeplugin-release:) and unity-classes.jar (unity-classes.jar)
Duplicate class com.unity3d.player.p found in modules classes-2.jar (:coffeeplugin-release:) and unity-classes.jar (unity-classes.jar)
Duplicate class com.unity3d.player.q found in modules classes-2.jar (:coffeeplugin-release:) and unity-classes.jar (unity-classes.jar)
Duplicate class com.unity3d.player.q$1 found in modules classes-2.jar (:coffeeplugin-release:) and unity-classes.jar (unity-classes.jar)
Duplicate class com.unity3d.player.q$2 found in modules classes-2.jar (:coffeeplugin-release:) and unity-classes.jar (unity-classes.jar)
Duplicate class com.unity3d.player.q$3 found in modules classes-2.jar (:coffeeplugin-release:) and unity-classes.jar (unity-classes.jar)
Duplicate class org.fmod.FMODAudioDevice found in modules classes-2.jar (:coffeeplugin-release:) and unity-classes.jar (unity-classes.jar)
Duplicate class org.fmod.a found in modules classes-2.jar (:coffeeplugin-release:) and unity-classes.jar (unity-classes.jar)
Go to the documentation to learn how to Fix dependency resolution errors.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 8s
]
stdout[
> Task :preBuild UP-TO-DATE
> Task :preReleaseBuild UP-TO-DATE
> Task :compileReleaseAidl NO-SOURCE
> Task :compileReleaseRenderscript NO-SOURCE
> Task :checkReleaseManifest UP-TO-DATE
> Task :generateReleaseBuildConfig UP-TO-DATE
> Task :prepareLintJar UP-TO-DATE
> Task :generateReleaseSources UP-TO-DATE
> Task :javaPreCompileRelease
> Task :mainApkListPersistenceRelease UP-TO-DATE
> Task :generateReleaseResValues UP-TO-DATE
> Task :generateReleaseResources UP-TO-DATE
> Task :mergeReleaseResources UP-TO-DATE
> Task :createReleaseCompatibleScreenManifests UP-TO-DATE
> Task :processReleaseManifest
> Task :processReleaseResources
> Task :compileReleaseJavaWithJavac
> Task :compileReleaseSources
> Task :lintVitalRelease
> Task :mergeReleaseShaders UP-TO-DATE
> Task :compileReleaseShaders UP-TO-DATE
> Task :generateReleaseAssets UP-TO-DATE
> Task :mergeReleaseAssets
> Task :validateSigningRelease UP-TO-DATE
> Task :signingConfigWriterRelease UP-TO-DATE
> Task :checkReleaseDuplicateClasses FAILED
Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/5.1.1/userguide/command_line_interface.html#sec:command_line_warnings
19 actionable tasks: 7 executed, 12 up-to-date
]
exit code: 1
UnityEditor.Android.Command.WaitForProgramToRun (UnityEditor.Utils.Program p, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <f92457847c324e90907abe57dde6951d>:0)
UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <f92457847c324e90907abe57dde6951d>:0)
UnityEditor.Android.Command.Run (System.String command, System.String args, System.String workingdir, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <f92457847c324e90907abe57dde6951d>:0)
UnityEditor.Android.AndroidJavaTools.RunJava (System.String args, System.String workingdir, System.Action`1[T] progress, System.String error) (at <f92457847c324e90907abe57dde6951d>:0)
UnityEditor.Android.GradleWrapper.Run (UnityEditor.Android.AndroidJavaTools javaTools, System.String workingdir, System.String task, System.Action`1[T] progress) (at <f92457847c324e90907abe57dde6951d>:0)
Rethrow as GradleInvokationException: Gradle build failed
UnityEditor.Android.GradleWrapper.Run (UnityEditor.Android.AndroidJavaTools javaTools, System.String workingdir, System.String task, System.Action`1[T] progress) (at <f92457847c324e90907abe57dde6951d>:0)
UnityEditor.Android.PostProcessor.Tasks.BuildGradleProject.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <f92457847c324e90907abe57dde6951d>:0)
UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <f92457847c324e90907abe57dde6951d>:0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr) (at C:/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:179)
I'm seeing mostly duplicate errors, so I'm guessing I already have everything in the classes.jar in my Android Studio project. I built the project from an exported project from Unity and opened it in Android Studio then made the "coffeeplugin" module.
When I try to add com.unity3d.player.UnityPlayer in the Gradle build script, Android Studio tells me its an invalid string when I sync Gradle.
I understand it's wanting :SomeTag I'm guessing, but I don't know what to put there.
The Unity documentation doesn't really get into this part (at least from what documentation and blogs I'm able to find).
coffeeplugin build.gradle
apply plugin: 'com.android.library'
android {
compileSdkVersion 29
buildToolsVersion "29.0.2"
defaultConfig {
minSdkVersion 14
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles 'consumer-rules.pro'
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'com.unity3d.player'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
}
task copyPlugin(type: Copy) {
dependsOn assemble
from ('build/output/aar')
into ('N:/Storage/UnityProjects/Coffee/Assets/Plugins/Android')
include (project.name + "-release.aar")
}
I figured out exactly what is contained in these AAR files I've been importing in to Unity.
I have been doing the correct thing by including classes.jar from Unity into my plugin/libs. The problem was that by building my plugin in Android Studio with classes.jar in libs, classes.jar was being included in the final AAR output, which on the Unity side of things is redundant because Unity already has this data, thus the duplicate classes error I've been getting.
The fix was to open the AAR is some archive editor (7-zip or winrar) and extract only the clases.jar within that and import only that into Unity.
I'm surprised there's not more official documentation on this process.
Also, this fix means no edits to the Gradle build script is necessary unless you want to automate the copy process from intermediate builds to Unity.
Change implementation to compileOnly for 'com.unity3d.player'. This allows the unity player classes.jar to be used at compile time, but not at run time which was causing the duplication.
What i did was renamed the Unity Jar [classes.jar] to [clases.jar]
and Added the following in Gradle file
If this still gives the error then:
Goto File>>Settings
Opening the unity player class after adding classes.jar file from unity in libs folder solved this issue for me.
In build.gradle add line --> implementation fileTree(dir: 'libs', include: ['*.jar']).
And move your unity.jar to lib folder.
I have recently updated my Android studio to 3.4.1. I am planning to integrate Geofencing Application. So I have downloaded the Map Application from the Google sample git repository and import it to new Android studio. But I am getting the below error continuously while building the application.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:checkDebugDuplicateClasses'.
> 1 exception was raised by workers:
java.lang.RuntimeException: Duplicate class android.support.v4.app.INotificationSideChannel found in modules classes.jar (androidx.core:core:1.0.1) and classes.jar (com.android.support:support-compat:26.1.0)
Duplicate class android.support.v4.app.INotificationSideChannel$Stub found in modules classes.jar (androidx.core:core:1.0.1) and classes.jar (com.android.support:support-compat:26.1.0)
Duplicate class android.support.v4.app.INotificationSideChannel$Stub$Proxy found in modules classes.jar (androidx.core:core:1.0.1) and classes.jar (com.android.support:support-compat:26.1.0)
Duplicate class android.support.v4.os.IResultReceiver found in modules classes.jar (androidx.core:core:1.0.1) and classes.jar (com.android.support:support-compat:26.1.0)
Duplicate class android.support.v4.os.IResultReceiver$Stub found in modules classes.jar (androidx.core:core:1.0.1) and classes.jar (com.android.support:support-compat:26.1.0)
Duplicate class android.support.v4.os.IResultReceiver$Stub$Proxy found in modules classes.jar (androidx.core:core:1.0.1) and classes.jar (com.android.support:support-compat:26.1.0)
Duplicate class android.support.v4.os.ResultReceiver found in modules classes.jar (androidx.core:core:1.0.1) and classes.jar (com.android.support:support-compat:26.1.0)
Duplicate class android.support.v4.os.ResultReceiver$1 found in modules classes.jar (androidx.core:core:1.0.1) and classes.jar (com.android.support:support-compat:26.1.0)
Duplicate class android.support.v4.os.ResultReceiver$MyResultReceiver found in modules classes.jar (androidx.core:core:1.0.1) and classes.jar (com.android.support:support-compat:26.1.0)
Duplicate class android.support.v4.os.ResultReceiver$MyRunnable found in modules classes.jar (androidx.core:core:1.0.1) and classes.jar (com.android.support:support-compat:26.1.0)
Go to the documentation to learn how to Fix dependency resolution errors.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/5.1.1/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 18s
16 actionable tasks: 12 executed, 4 up-to-date