Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android Build Test Failed #3827

Closed
2 tasks done
AlirezaHadjar opened this issue Jan 9, 2023 · 3 comments
Closed
2 tasks done

Android Build Test Failed #3827

AlirezaHadjar opened this issue Jan 9, 2023 · 3 comments

Comments

@AlirezaHadjar
Copy link

What happened?

I ran cd android ; ./gradlew assembleLocalDebug assembleAndroidTest -DtestBuildType=debug ; cd - and it failed because of Duplicate class androidx.appcompat.content.res.AppCompatResources found in modules appcompat-1.0.2-runtime (androidx.appcompat:appcompat:1.0.2) and jetified-appcompat-resources-1.3.1-runtime (androidx.appcompat:appcompat-resources:1.3.1)

What was the expected behaviour?

It should have built the test app.

Was it tested on latest Detox?

  • I have tested this issue on the latest Detox release and it still reproduces.

Did your test throw out a timeout?

Help us reproduce this issue!

No response

In what environment did this happen?

Detox version: 20.1.1
React Native version: 0.68.5
Node version: 16.14.0
Device model: Real Device
Android version: 10
Test-runner (select one): jest

Detox logs

Detox logs
paste logs here!

Device logs

Device logs
paste logs here!

More data, please!

I think it has a conflict between androidx.appcompat version of detox and react-native-track-player. But I don't know how to fix it.

Any help would be appreciated!

Here is the log:

> Configure project :app
Unable to detect AGP versions for included builds. All projects in the build should use the same AGP version. Class name for the included build object: org.gradle.composite.internal.DefaultIncludedBuild$IncludedBuildImpl_Decorated.
Reading env from: .env.local

> Configure project :react-native-firebase_analytics
:react-native-firebase_analytics package.json found at /Users/alirezahadjar/Dropbox/Mac/Desktop/Projects/ReactNative/omp-mobile-react-native/node_modules/@react-native-firebase/analytics/package.json
:react-native-firebase_app package.json found at /Users/alirezahadjar/Dropbox/Mac/Desktop/Projects/ReactNative/omp-mobile-react-native/node_modules/@react-native-firebase/app/package.json
:react-native-firebase_analytics:firebase.bom using default value: 31.1.1
:react-native-firebase_analytics package.json found at /Users/alirezahadjar/Dropbox/Mac/Desktop/Projects/ReactNative/omp-mobile-react-native/node_modules/@react-native-firebase/analytics/package.json
:react-native-firebase_analytics:version set from package.json: 16.5.0 (16,5,0 - 16005000)
:react-native-firebase_analytics:android.compileSdk using custom value: 33
:react-native-firebase_analytics:android.targetSdk using custom value: 33
:react-native-firebase_analytics:android.minSdk using custom value: 23
:react-native-firebase_analytics:reactNativeAndroidDir /Users/alirezahadjar/Dropbox/Mac/Desktop/Projects/ReactNative/omp-mobile-react-native/node_modules/react-native/android

> Configure project :react-native-firebase_app
:react-native-firebase_app package.json found at /Users/alirezahadjar/Dropbox/Mac/Desktop/Projects/ReactNative/omp-mobile-react-native/node_modules/@react-native-firebase/app/package.json
:react-native-firebase_app:firebase.bom using default value: 31.1.1
:react-native-firebase_app:play.play-services-auth using default value: 20.3.0
:react-native-firebase_app package.json found at /Users/alirezahadjar/Dropbox/Mac/Desktop/Projects/ReactNative/omp-mobile-react-native/node_modules/@react-native-firebase/app/package.json
:react-native-firebase_app:version set from package.json: 16.5.0 (16,5,0 - 16005000)
:react-native-firebase_app:android.compileSdk using custom value: 33
:react-native-firebase_app:android.targetSdk using custom value: 33
:react-native-firebase_app:android.minSdk using custom value: 23
:react-native-firebase_app:reactNativeAndroidDir /Users/alirezahadjar/Dropbox/Mac/Desktop/Projects/ReactNative/omp-mobile-react-native/node_modules/react-native/android

> Configure project :react-native-firebase_dynamic-links
:react-native-firebase_dynamic-links package.json found at /Users/alirezahadjar/Dropbox/Mac/Desktop/Projects/ReactNative/omp-mobile-react-native/node_modules/@react-native-firebase/dynamic-links/package.json
:react-native-firebase_app package.json found at /Users/alirezahadjar/Dropbox/Mac/Desktop/Projects/ReactNative/omp-mobile-react-native/node_modules/@react-native-firebase/app/package.json
:react-native-firebase_dynamic-links:firebase.bom using default value: 31.1.1
:react-native-firebase_dynamic-links package.json found at /Users/alirezahadjar/Dropbox/Mac/Desktop/Projects/ReactNative/omp-mobile-react-native/node_modules/@react-native-firebase/dynamic-links/package.json
:react-native-firebase_dynamic-links:version set from package.json: 16.5.0 (16,5,0 - 16005000)
:react-native-firebase_dynamic-links:android.compileSdk using custom value: 33
:react-native-firebase_dynamic-links:android.targetSdk using custom value: 33
:react-native-firebase_dynamic-links:android.minSdk using custom value: 23
:react-native-firebase_dynamic-links:reactNativeAndroidDir /Users/alirezahadjar/Dropbox/Mac/Desktop/Projects/ReactNative/omp-mobile-react-native/node_modules/react-native/android

> Configure project :react-native-firebase_messaging
:react-native-firebase_messaging package.json found at /Users/alirezahadjar/Dropbox/Mac/Desktop/Projects/ReactNative/omp-mobile-react-native/node_modules/@react-native-firebase/messaging/package.json
:react-native-firebase_app package.json found at /Users/alirezahadjar/Dropbox/Mac/Desktop/Projects/ReactNative/omp-mobile-react-native/node_modules/@react-native-firebase/app/package.json
:react-native-firebase_messaging:firebase.bom using default value: 31.1.1
:react-native-firebase_messaging package.json found at /Users/alirezahadjar/Dropbox/Mac/Desktop/Projects/ReactNative/omp-mobile-react-native/node_modules/@react-native-firebase/messaging/package.json
:react-native-firebase_messaging:version set from package.json: 16.5.0 (16,5,0 - 16005000)
:react-native-firebase_messaging:android.compileSdk using custom value: 33
:react-native-firebase_messaging:android.targetSdk using custom value: 33
:react-native-firebase_messaging:android.minSdk using custom value: 23
:react-native-firebase_messaging:reactNativeAndroidDir /Users/alirezahadjar/Dropbox/Mac/Desktop/Projects/ReactNative/omp-mobile-react-native/node_modules/react-native/android

> Configure project :react-native-mmkv
MMKV: node_modules/ found at: /Users/alirezahadjar/Dropbox/Mac/Desktop/Projects/ReactNative/omp-mobile-react-native/node_modules
WARNING:DSL element 'dexOptions' is obsolete and should be removed.
It will be removed in version 8.0 of the Android Gradle plugin.
Using it has no effect, and the AndroidGradle plugin optimizes dexing automatically.

> Configure project :react-native-reanimated
AAR for react-native-reanimated has been found
/Users/alirezahadjar/Dropbox/Mac/Desktop/Projects/ReactNative/omp-mobile-react-native/node_modules/react-native-reanimated/android/react-native-reanimated-68-hermes.aar
WARNING:We recommend using a newer Android Gradle plugin to use compileSdk = 33

This Android Gradle plugin (7.0.4) was tested up to compileSdk = 31

This warning can be suppressed by adding
    android.suppressUnsupportedCompileSdk=33
to this project's gradle.properties

The build will continue, but you are strongly encouraged to update your project to
use a newer Android Gradle Plugin that has been tested with compileSdk = 33
<=============> 100% CONFIGURING [2m 57s]
WARNING:We recommend using a newer Android Gradle plugin to use compileSdk = 33s of :app:localDebugRuntimeClass

This Android Gradle plugin (7.0.4) was tested up to compileSdk = 31

This warning can be suppressed by adding
    android.suppressUnsupportedCompileSdk=33
to this project's gradle.properties

The build will continue, but you are strongly encouraged to update your project to
use a newer Android Gradle Plugin that has been tested with compileSdk = 33

> Task :react-native-track-player:checkDebugAndroidTestDuplicateClasses FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':react-native-track-player:checkDebugAndroidTestDuplicateClasses'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable
   > Duplicate class androidx.appcompat.content.res.AppCompatResources found in modules appcompat-1.0.2-runtime (androidx.appcompat:appcompat:1.0.2) and jetified-appcompat-resources-1.3.1-runtime (androidx.appcompat:appcompat-resources:1.3.1)
     Duplicate class androidx.appcompat.content.res.AppCompatResources$ColorStateListCacheEntry found in modules appcompat-1.0.2-runtime (androidx.appcompat:appcompat:1.0.2) and jetified-appcompat-resources-1.3.1-runtime (androidx.appcompat:appcompat-resources:1.3.1)
     Duplicate class androidx.appcompat.graphics.drawable.AnimatedStateListDrawableCompat found in modules appcompat-1.0.2-runtime (androidx.appcompat:appcompat:1.0.2) and jetified-appcompat-resources-1.3.1-runtime (androidx.appcompat:appcompat-resources:1.3.1)
     Duplicate class androidx.appcompat.graphics.drawable.AnimatedStateListDrawableCompat$1 found in modules appcompat-1.0.2-runtime (androidx.appcompat:appcompat:1.0.2) and jetified-appcompat-resources-1.3.1-runtime (androidx.appcompat:appcompat-resources:1.3.1)
     Duplicate class androidx.appcompat.graphics.drawable.AnimatedStateListDrawableCompat$AnimatableTransition found in modules appcompat-1.0.2-runtime (androidx.appcompat:appcompat:1.0.2) and jetified-appcompat-resources-1.3.1-runtime (androidx.appcompat:appcompat-resources:1.3.1)
     Duplicate class androidx.appcompat.graphics.drawable.AnimatedStateListDrawableCompat$AnimatedStateListState found in modules appcompat-1.0.2-runtime (androidx.appcompat:appcompat:1.0.2) and jetified-appcompat-resources-1.3.1-runtime (androidx.appcompat:appcompat-resources:1.3.1)
     Duplicate class androidx.appcompat.graphics.drawable.AnimatedStateListDrawableCompat$AnimatedVectorDrawableTransition found in modules appcompat-1.0.2-runtime (androidx.appcompat:appcompat:1.0.2) and jetified-appcompat-resources-1.3.1-runtime (androidx.appcompat:appcompat-resources:1.3.1)
     Duplicate class androidx.appcompat.graphics.drawable.AnimatedStateListDrawableCompat$AnimationDrawableTransition found in modules appcompat-1.0.2-runtime (androidx.appcompat:appcompat:1.0.2) and jetified-appcompat-resources-1.3.1-runtime (androidx.appcompat:appcompat-resources:1.3.1)
     Duplicate class androidx.appcompat.graphics.drawable.AnimatedStateListDrawableCompat$FrameInterpolator found in modules appcompat-1.0.2-runtime (androidx.appcompat:appcompat:1.0.2) and jetified-appcompat-resources-1.3.1-runtime (androidx.appcompat:appcompat-resources:1.3.1)
     Duplicate class androidx.appcompat.graphics.drawable.AnimatedStateListDrawableCompat$Transition found in modules appcompat-1.0.2-runtime (androidx.appcompat:appcompat:1.0.2) and jetified-appcompat-resources-1.3.1-runtime (androidx.appcompat:appcompat-resources:1.3.1)
     Duplicate class androidx.appcompat.graphics.drawable.DrawableContainer found in modules appcompat-1.0.2-runtime (androidx.appcompat:appcompat:1.0.2) and jetified-appcompat-resources-1.3.1-runtime (androidx.appcompat:appcompat-resources:1.3.1)
     Duplicate class androidx.appcompat.graphics.drawable.DrawableContainer$1 found in modules appcompat-1.0.2-runtime (androidx.appcompat:appcompat:1.0.2) and jetified-appcompat-resources-1.3.1-runtime (androidx.appcompat:appcompat-resources:1.3.1)
     Duplicate class androidx.appcompat.graphics.drawable.DrawableContainer$BlockInvalidateCallback found in modules appcompat-1.0.2-runtime (androidx.appcompat:appcompat:1.0.2) and jetified-appcompat-resources-1.3.1-runtime (androidx.appcompat:appcompat-resources:1.3.1)
     Duplicate class androidx.appcompat.graphics.drawable.DrawableContainer$DrawableContainerState found in modules appcompat-1.0.2-runtime (androidx.appcompat:appcompat:1.0.2) and jetified-appcompat-resources-1.3.1-runtime (androidx.appcompat:appcompat-resources:1.3.1)
     Duplicate class androidx.appcompat.graphics.drawable.DrawableWrapper found in modules appcompat-1.0.2-runtime (androidx.appcompat:appcompat:1.0.2) and jetified-appcompat-resources-1.3.1-runtime (androidx.appcompat:appcompat-resources:1.3.1)
     Duplicate class androidx.appcompat.graphics.drawable.StateListDrawable found in modules appcompat-1.0.2-runtime (androidx.appcompat:appcompat:1.0.2) and jetified-appcompat-resources-1.3.1-runtime (androidx.appcompat:appcompat-resources:1.3.1)
     Duplicate class androidx.appcompat.graphics.drawable.StateListDrawable$StateListState found in modules appcompat-1.0.2-runtime (androidx.appcompat:appcompat:1.0.2) and jetified-appcompat-resources-1.3.1-runtime (androidx.appcompat:appcompat-resources:1.3.1)
     Duplicate class androidx.appcompat.widget.DrawableUtils found in modules appcompat-1.0.2-runtime (androidx.appcompat:appcompat:1.0.2) and jetified-appcompat-resources-1.3.1-runtime (androidx.appcompat:appcompat-resources:1.3.1)
     Duplicate class androidx.appcompat.widget.ResourcesWrapper found in modules appcompat-1.0.2-runtime (androidx.appcompat:appcompat:1.0.2) and jetified-appcompat-resources-1.3.1-runtime (androidx.appcompat:appcompat-resources:1.3.1)
     Duplicate class androidx.appcompat.widget.TintContextWrapper found in modules appcompat-1.0.2-runtime (androidx.appcompat:appcompat:1.0.2) and jetified-appcompat-resources-1.3.1-runtime (androidx.appcompat:appcompat-resources:1.3.1)
     Duplicate class androidx.appcompat.widget.TintInfo found in modules appcompat-1.0.2-runtime (androidx.appcompat:appcompat:1.0.2) and jetified-appcompat-resources-1.3.1-runtime (androidx.appcompat:appcompat-resources:1.3.1)
     Duplicate class androidx.appcompat.widget.TintResources found in modules appcompat-1.0.2-runtime (androidx.appcompat:appcompat:1.0.2) and jetified-appcompat-resources-1.3.1-runtime (androidx.appcompat:appcompat-resources:1.3.1)
     Duplicate class androidx.appcompat.widget.VectorEnabledTintResources found in modules appcompat-1.0.2-runtime (androidx.appcompat:appcompat:1.0.2) and jetified-appcompat-resources-1.3.1-runtime (androidx.appcompat:appcompat-resources:1.3.1)
     
     Go to the documentation to learn how to <a href="d.android.com/r/tools/classpath-sync-errors">Fix dependency resolution errors</a>.

* 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 8.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from you
@github-actions
Copy link

This issue appears to be a general usage or support question.
In order to get help, please either ask a question on Stack Overflow with the detox tag, or simply join our Discord.
Feel free to post your Stack Overflow question here for more visibility! We'll take a look at it ASAP.
For more information about our policy on issues, refer to this discussion.

@AlirezaHadjar
Copy link
Author

Okay thanks, I already asked my question on Stack Overflow and Discord 12 days ago. But I haven't had any luck.

Any Suggestions would be appreciated.

@jamiewu613
Copy link

It's working in my case, following this guide aapt-resource-linking-failure and setup androidx.appcompat:appcompat version to 1.3.1 same as react-native-track-player.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants