0

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)

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

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

The test apk should have been built successfully.

Alireza Hadjar
  • 450
  • 4
  • 10

0 Answers0