It would be great if someone knows how to resolve this error can can let me know what to do: checkDebugDuplicateClasses FAILED
Goal: from Android Studio, run/debug Chromium on an Android device. (Thereafter, make PKI-related updates required for use on a corporate intranet.)
My work has been with a new computer:
i7-13700KF CPU
2 TB SSD
32 GB DRAM
Ubuntu 22.04.1 LTS
Android Studio Dolphin | 2021.3.1 Patch 1
I followed the current Chromium download/build instructions but no matter what I tried (over two days), I could not resolve this error:
checkDebugDuplicateClasses FAILED
No change has been made to the downloaded Chromium source code so this error is occurring in the Chromium project as it is today and as it was over the past week.
Today, I started afresh, using what I have learnt. Here's an acurate record of what I did (I still saw the same error):
a) Followed instructions at:
https://chromium.googlesource.com/chromium/src/+/master/docs/android_build_instructions.md ...
fetch --nohooks --no-history android
cd src
build/install-build-deps-android.sh
gclient runhooks
gn args out/Default
when prompted, paste into
args.gn:
target_os = "android"
target_cpu = "arm64"
autoninja -C out/Default chrome_public_apk
b) Followed instructions at:
https://chromium.googlesource.com/chromium/src.git/+/main/docs/android_studio.md ...
build/android/gradle/generate_gradle.py --output-directory out/Default --project-dir /home/jeff/chromium2/Android --target //chrome/android:chrome_public_apk
Import /home/jeff/chromium2/Android into Android Studio
Android Gradle Plugin upgrade recommended but ignored. (Previously, I updated but that did not help.)
Wait for indexing to complete.
c) Use imported project ...
Clean Project. Rebuild Project. Generates build output:
> Task :chrome.android.chrome_public_apk:checkDebugDuplicateClasses FAILED
> Task :chrome.android.chrome_public_apk:compileDebugJavaWithJavac FAILED
Duplicate class com.google.common.util.concurrent.ListenableFuture found in modules guava-31.1-android (guava-31.1-android.jar) and listenablefuture-1.0 (listenablefuture-1.0.jar)
To build.gradle in app module, added:
configurations {
all*.exclude group: 'com.google.guava', module: 'listenablefuture'
}
then did Sync Now.
To gradle.properties, added:
org.gradle.jvmargs=-Xmx4g -XX:MaxPermSize=2048m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
android.useAndroidX=true
android.enableJetifier=true
then did Sync Now.
Clear Project. Rebuild Project.
Still see:
> Task :chrome.android.chrome_public_apk:checkDebugDuplicateClasses FAILED
plus many duplicate files
Previously built with --debug but nothing obvious appears.