react-native-google-mobile-ads icon indicating copy to clipboard operation
react-native-google-mobile-ads copied to clipboard

Getting compile error when target sdk version is 33 or lower

Open RohitBansal272 opened this issue 1 year ago • 18 comments

What happened?

I am getting the following error after installing the library

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':app:checkDebugAarMetadata'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.CheckAarMetadataWorkAction
   > An issue was found when checking AAR metadata:
     
       1.  Dependency 'androidx.webkit:webkit:1.11.0-alpha02' requires libraries and applications that
           depend on it to compile against version 34 or later of the
           Android APIs.
     
           :app is currently compiled against android-33.
     
           Also, the maximum recommended compile SDK version for Android Gradle
           plugin 7.4.2 is 33.
     
           Recommended action: Update this project's version of the Android Gradle
           plugin to one that supports 34, then update this project to use
           compileSdkVerion of at least 34.
     
           Note that updating a library or application's compileSdkVersion (which
           allows newer APIs to be used) can be done separately from updating
           targetSdkVersion (which opts the app in to new runtime behavior) and
           minSdkVersion (which determines which devices the app can be installed
           on).

I tried changing targetSdkVersion to 34 and it is breaking other libraries

Platforms

Android, but have not tested behavior on iOS

React Native Info

System:
  OS: macOS 14.5
  CPU: (11) arm64 Apple M3 Pro
  Memory: 93.45 MB / 18.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 20.12.2
    path: ~/.nvm/versions/node/v20.12.2/bin/node
  Yarn:
    version: 1.22.22
    path: /opt/homebrew/bin/yarn
  npm:
    version: 10.5.0
    path: ~/.nvm/versions/node/v20.12.2/bin/npm
  Watchman:
    version: 2024.04.15.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.15.2
    path: /usr/local/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 23.5
      - iOS 17.5
      - macOS 14.5
      - tvOS 17.5
      - visionOS 1.2
      - watchOS 10.5
  Android SDK:
    API Levels:
      - "33"
      - "33"
      - "33"
      - "34"
    Build Tools:
      - 30.0.3
      - 33.0.0
      - 33.0.1
      - 34.0.0
    System Images:
      - android-34 | ARM 64 v8a
      - android-34 | Google Play ARM 64 v8a
    Android NDK: Not Found
IDEs:
  Android Studio: 2023.2 AI-232.10300.40.2321.11668458
  Xcode:
    version: 15.4/15F31d
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.11
    path: /usr/bin/javac
  Ruby:
    version: 2.6.10
    path: /usr/bin/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.2.0
    wanted: 18.2.0
  react-native:
    installed: 0.72.12
    wanted: 0.72.12
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
iOS:
  hermesEnabled: true
  newArchEnabled: false

Are your using Typescript?

  • [X] My project is using Typescript

package.json

{
  "name": "pimpyourcart",
  "displayName": "PimpYourCart",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "android": "./scripts/setup-env.sh dev;react-native run-android",
    "ios:prod": "./scripts/setup-env.sh prod",
    "ios": "react-native run-ios ",
    "lint": "eslint .",
    "start": "react-native start",
    "test": "jest"
  },
  "dependencies": {
    "@notifee/react-native": "^7.8.0",
    "@react-native-async-storage/async-storage": "^1.18.2",
    "@react-native-community/blur": "^4.3.2",
    "@react-native-community/clipboard": "^1.5.1",
    "@react-native-community/datetimepicker": "^7.3.0",
    "@react-native-community/masked-view": "^0.1.11",
    "@react-native-community/netinfo": "^9.4.1",
    "@react-native-firebase/analytics": "^19.0.0",
    "@react-native-firebase/app": "^19.0.0",
    "@react-native-firebase/auth": "^19.0.0",
    "@react-native-firebase/crashlytics": "^19.0.0",
    "@react-native-firebase/database": "^19.0.0",
    "@react-native-firebase/messaging": "^19.0.0",
    "@react-navigation/material-top-tabs": "^6.6.3",
    "@react-navigation/native": "^6.1.6",
    "@react-navigation/native-stack": "^6.9.12",
    "@react-navigation/stack": "^6.3.16",
    "@reduxjs/toolkit": "^1.9.5",
    "@shopify/flash-list": "^1.4.3",
    "@twotalltotems/react-native-otp-input": "^1.3.11",
    "@types/lodash": "^4.14.200",
    "@types/yup": "^0.32.0",
    "appcenter-cli": "^2.14.0",
    "axios": "^1.4.0",
    "axios-long-polling": "^1.2.0",
    "date-fns": "^2.30.0",
    "deprecated-react-native-prop-types": "^4.2.1",
    "formik": "^2.4.2",
    "lodash": "^4.17.21",
    "lottie-react-native": "^6.6.0",
    "react": "18.2.0",
    "react-devtools": "^4.28.0",
    "react-native": "0.72.12",
    "react-native-app-auth": "^7.1.0",
    "react-native-clarity": "^2.1.0",
    "react-native-code-push": "^8.1.0",
    "react-native-device-info": "^10.8.0",
    "react-native-dotenv": "^3.4.9",
    "react-native-error-boundary": "^1.2.3",
    "react-native-fast-image": "^8.6.3",
    "react-native-gesture-handler": "^2.13.4",
    "react-native-google-mobile-ads": "^13.6.0",
    "react-native-linear-gradient": "^2.8.3",
    "react-native-media-controls": "^2.3.0",
    "react-native-modal-datetime-picker": "^17.0.0",
    "react-native-pager-view": "^6.2.1",
    "react-native-paper": "^5.11.1",
    "react-native-reanimated": "^3.5.4",
    "react-native-reanimated-carousel": "^3.5.1",
    "react-native-render-html": "^6.3.4",
    "react-native-responsive-screen": "^1.4.2",
    "react-native-safe-area-context": "^4.6.2",
    "react-native-screens": "^3.21.1",
    "react-native-slider": "^0.11.0",
    "react-native-tab-view": "^3.5.2",
    "react-native-vector-icons": "^9.2.0",
    "react-native-version-info": "^1.1.1",
    "react-native-video": "^5.2.1",
    "react-native-walkthrough-tooltip": "^1.5.0",
    "react-native-webview": "^13.3.1",
    "react-redux": "^8.1.1",
    "redux-persist": "^6.0.0",
    "yup": "^1.2.0"
  },
  "devDependencies": {
    "@babel/core": "^7.20.0",
    "@babel/preset-env": "^7.20.0",
    "@babel/runtime": "^7.20.0",
    "@react-native-community/eslint-config": "^0.72.2",
    "@react-native/metro-config": "^0.72.12",
    "@svgr/webpack": "^8.0.1",
    "@testing-library/react-native": "^12.1.2",
    "@tsconfig/react-native": "^3.0.0",
    "@types/jest": "^29.2.1",
    "@types/react": "^18.0.24",
    "@types/react-native-vector-icons": "^6.4.13",
    "@types/react-test-renderer": "^18.0.0",
    "babel-jest": "^29.2.1",
    "babel-loader": "^9.1.3",
    "babel-plugin-react-native-web": "^0.19.7",
    "babel-plugin-transform-remove-console": "^6.9.4",
    "eslint": "^8.19.0",
    "html-webpack-plugin": "^5.5.3",
    "jest": "^29.2.1",
    "metro-react-native-babel-preset": "^0.76.9",
    "prettier": "^2.4.1",
    "react-dom": "^18.2.0",
    "react-test-renderer": "18.2.0",
    "typescript": "4.8.4",
    "url-loader": "^4.1.1",
    "webpack": "^5.88.2",
    "webpack-cli": "^5.1.4",
    "webpack-dev-server": "^4.15.1"
  },
  "engines": {
    "node": ">=16"
  }
}

app.json

{
  "name": "pimpyourcart",
  "displayName": "pimpyourcart",
  "react-native-google-mobile-ads": {
    "android_app_id": "ca-app-pub-.......",
    "ios_app_id": "ca-app-pub-........"
  }
}

ios/Podfile

No response

android/build.gradle

No response

android/app/build.gradle

No response

android/settings.gradle

No response

AndroidManifest.xml

No response

RohitBansal272 avatar Jun 25 '24 15:06 RohitBansal272

Uninstall the current version with then reinstall with lower version works for me

MinhTamjs avatar Jun 27 '24 03:06 MinhTamjs

Same here. I'm trying to build with the latest version of the package with Android SDK 33

fbsoares avatar Jun 27 '24 22:06 fbsoares

Same problem here, on iOS it built normally, but on Android it returns the same error.

jeandiasl avatar Jun 27 '24 22:06 jeandiasl

Update build.gradle (Project)

buildToolsVersion = "33.0.0" compileSdkVersion = 34 targetSdkVersion = 34

classpath("com.android.tools.build:gradle:7.1.2")

baontq23 avatar Jun 28 '24 04:06 baontq23

Update build.gradle (Project)

buildToolsVersion = "33.0.0" compileSdkVersion = 34 targetSdkVersion = 34

classpath("com.android.tools.build:gradle:7.1.2")

FAILURE: Build 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 com.google.android.gms.internal.measurement.zzhx found in modules jetified-play-services-measurement-base-20.1.2-runtime (com.google.android.gms:play-services-measurement-base:20.1.2) and jetified-play-services-measurement-impl-19.0.2-runtime (com.google.android.gms:play-services-measurement-impl:19.0.2) Duplicate class com.google.android.gms.internal.measurement.zzna found in modules jetified-play-services-measurement-base-20.1.2-runtime (com.google.android.gms:play-services-measurement-base:20.1.2) and jetified-play-services-measurement-impl-19.0.2-runtime (com.google.android.gms:play-services-measurement-impl:19.0.2) Duplicate class com.google.android.gms.internal.measurement.zznb found in modules jetified-play-services-measurement-base-20.1.2-runtime (com.google.android.gms:play-services-measurement-base:20.1.2) and jetified-play-services-measurement-impl-19.0.2-runtime (com.google.android.gms:play-services-measurement-impl:19.0.2) Duplicate class com.google.android.gms.internal.measurement.zznc found in modules jetified-play-services-measurement-base-20.1.2-runtime (com.google.android.gms:play-services-measurement-base:20.1.2) and jetified-play-services-measurement-impl-19.0.2-runtime (com.google.android.gms:play-services-measurement-impl:19.0.2) Duplicate class com.google.android.gms.internal.measurement.zznd found in modules jetified-play-services-measurement-base-20.1.2-runtime (com.google.android.gms:play-services-measurement-base:20.1.2) and jetified-play-services-measurement-impl-19.0.2-runtime (com.google.android.gms:play-services-measurement-impl:19.0.2) Duplicate class com.google.android.gms.measurement.internal.zzga found in modules jetified-play-services-measurement-19.0.2-runtime (com.google.android.gms:play-services-measurement:19.0.2) and jetified-play-services-measurement-base-20.1.2-runtime (com.google.android.gms:play-services-measurement-base:20.1.2) Duplicate class com.google.android.gms.measurement.internal.zzhe found in modules jetified-play-services-measurement-base-20.1.2-runtime (com.google.android.gms:play-services-measurement-base:20.1.2) and jetified-play-services-measurement-impl-19.0.2-runtime (com.google.android.gms:play-services-measurement-impl:19.0.2) Duplicate class com.google.android.gms.measurement.internal.zzhf found in modules jetified-play-services-measurement-base-20.1.2-runtime (com.google.android.gms:play-services-measurement-base:20.1.2) and jetified-play-services-measurement-impl-19.0.2-runtime (com.google.android.gms:play-services-measurement-impl:19.0.2) Duplicate class com.google.android.gms.measurement.internal.zzhg found in modules jetified-play-services-measurement-base-20.1.2-runtime (com.google.android.gms:play-services-measurement-base:20.1.2) and jetified-play-services-measurement-impl-19.0.2-runtime (com.google.android.gms:play-services-measurement-impl:19.0.2) Duplicate class com.google.android.gms.measurement.internal.zzhh found in modules jetified-play-services-measurement-base-20.1.2-runtime (com.google.android.gms:play-services-measurement-base:20.1.2) and jetified-play-services-measurement-impl-19.0.2-runtime (com.google.android.gms:play-services-measurement-impl:19.0.2) Duplicate class com.google.android.gms.measurement.internal.zzhi found in modules jetified-play-services-measurement-base-20.1.2-runtime (com.google.android.gms:play-services-measurement-base:20.1.2) and jetified-play-services-measurement-impl-19.0.2-runtime (com.google.android.gms:play-services-measurement-impl:19.0.2) Duplicate class com.google.android.gms.measurement.internal.zzhj found in modules jetified-play-services-measurement-base-20.1.2-runtime (com.google.android.gms:play-services-measurement-base:20.1.2) and jetified-play-services-measurement-impl-19.0.2-runtime (com.google.android.gms:play-services-measurement-impl:19.0.2) Duplicate class com.google.android.gms.measurement.internal.zzio found in modules jetified-play-services-measurement-base-20.1.2-runtime (com.google.android.gms:play-services-measurement-base:20.1.2) and jetified-play-services-measurement-impl-19.0.2-runtime (com.google.android.gms:play-services-measurement-impl:19.0.2) Duplicate class com.google.android.gms.measurement.internal.zzit found in modules jetified-play-services-measurement-base-20.1.2-runtime (com.google.android.gms:play-services-measurement-base:20.1.2) and jetified-play-services-measurement-impl-19.0.2-runtime (com.google.android.gms:play-services-measurement-impl:19.0.2)

 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

BUILD FAILED in 1m 21s error Failed to install the app. info Run CLI with --verbose flag for more details. error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

jeandiasl avatar Jun 28 '24 12:06 jeandiasl

Update build.gradle (Project) buildToolsVersion = "33.0.0" compileSdkVersion = 34 targetSdkVersion = 34 classpath("com.android.tools.build:gradle:7.1.2")

FAILURE: Build 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 com.google.android.gms.internal.measurement.zzhx found in modules jetified-play-services-measurement-base-20.1.2-runtime (com.google.android.gms:play-services-measurement-base:20.1.2) and jetified-play-services-measurement-impl-19.0.2-runtime (com.google.android.gms:play-services-measurement-impl:19.0.2) Duplicate class com.google.android.gms.internal.measurement.zzna found in modules jetified-play-services-measurement-base-20.1.2-runtime (com.google.android.gms:play-services-measurement-base:20.1.2) and jetified-play-services-measurement-impl-19.0.2-runtime (com.google.android.gms:play-services-measurement-impl:19.0.2) Duplicate class com.google.android.gms.internal.measurement.zznb found in modules jetified-play-services-measurement-base-20.1.2-runtime (com.google.android.gms:play-services-measurement-base:20.1.2) and jetified-play-services-measurement-impl-19.0.2-runtime (com.google.android.gms:play-services-measurement-impl:19.0.2) Duplicate class com.google.android.gms.internal.measurement.zznc found in modules jetified-play-services-measurement-base-20.1.2-runtime (com.google.android.gms:play-services-measurement-base:20.1.2) and jetified-play-services-measurement-impl-19.0.2-runtime (com.google.android.gms:play-services-measurement-impl:19.0.2) Duplicate class com.google.android.gms.internal.measurement.zznd found in modules jetified-play-services-measurement-base-20.1.2-runtime (com.google.android.gms:play-services-measurement-base:20.1.2) and jetified-play-services-measurement-impl-19.0.2-runtime (com.google.android.gms:play-services-measurement-impl:19.0.2) Duplicate class com.google.android.gms.measurement.internal.zzga found in modules jetified-play-services-measurement-19.0.2-runtime (com.google.android.gms:play-services-measurement:19.0.2) and jetified-play-services-measurement-base-20.1.2-runtime (com.google.android.gms:play-services-measurement-base:20.1.2) Duplicate class com.google.android.gms.measurement.internal.zzhe found in modules jetified-play-services-measurement-base-20.1.2-runtime (com.google.android.gms:play-services-measurement-base:20.1.2) and jetified-play-services-measurement-impl-19.0.2-runtime (com.google.android.gms:play-services-measurement-impl:19.0.2) Duplicate class com.google.android.gms.measurement.internal.zzhf found in modules jetified-play-services-measurement-base-20.1.2-runtime (com.google.android.gms:play-services-measurement-base:20.1.2) and jetified-play-services-measurement-impl-19.0.2-runtime (com.google.android.gms:play-services-measurement-impl:19.0.2) Duplicate class com.google.android.gms.measurement.internal.zzhg found in modules jetified-play-services-measurement-base-20.1.2-runtime (com.google.android.gms:play-services-measurement-base:20.1.2) and jetified-play-services-measurement-impl-19.0.2-runtime (com.google.android.gms:play-services-measurement-impl:19.0.2) Duplicate class com.google.android.gms.measurement.internal.zzhh found in modules jetified-play-services-measurement-base-20.1.2-runtime (com.google.android.gms:play-services-measurement-base:20.1.2) and jetified-play-services-measurement-impl-19.0.2-runtime (com.google.android.gms:play-services-measurement-impl:19.0.2) Duplicate class com.google.android.gms.measurement.internal.zzhi found in modules jetified-play-services-measurement-base-20.1.2-runtime (com.google.android.gms:play-services-measurement-base:20.1.2) and jetified-play-services-measurement-impl-19.0.2-runtime (com.google.android.gms:play-services-measurement-impl:19.0.2) Duplicate class com.google.android.gms.measurement.internal.zzhj found in modules jetified-play-services-measurement-base-20.1.2-runtime (com.google.android.gms:play-services-measurement-base:20.1.2) and jetified-play-services-measurement-impl-19.0.2-runtime (com.google.android.gms:play-services-measurement-impl:19.0.2) Duplicate class com.google.android.gms.measurement.internal.zzio found in modules jetified-play-services-measurement-base-20.1.2-runtime (com.google.android.gms:play-services-measurement-base:20.1.2) and jetified-play-services-measurement-impl-19.0.2-runtime (com.google.android.gms:play-services-measurement-impl:19.0.2) Duplicate class com.google.android.gms.measurement.internal.zzit found in modules jetified-play-services-measurement-base-20.1.2-runtime (com.google.android.gms:play-services-measurement-base:20.1.2) and jetified-play-services-measurement-impl-19.0.2-runtime (com.google.android.gms:play-services-measurement-impl:19.0.2)

 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

BUILD FAILED in 1m 21s error Failed to install the app. info Run CLI with --verbose flag for more details. error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Can you share build.gradle ?

baontq23 avatar Jun 28 '24 12:06 baontq23

Update build.gradle (Project)

buildToolsVersion = "33.0.0" compileSdkVersion = 34 targetSdkVersion = 34

classpath("com.android.tools.build:gradle:7.1.2")

I tried this method and it is giving me other libraries error because they don't support target 34

RohitBansal272 avatar Jun 28 '24 12:06 RohitBansal272

Update build.gradle (Project) buildToolsVersion = "33.0.0" compileSdkVersion = 34 targetSdkVersion = 34 classpath("com.android.tools.build:gradle:7.1.2")

FAILURE: Build 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 com.google.android.gms.internal.measurement.zzhx found in modules jetified-play-services-measurement-base-20.1.2-runtime (com.google.android.gms:play-services-measurement-base:20.1.2) and jetified-play-services-measurement-impl-19.0.2-runtime (com.google.android.gms:play-services-measurement-impl:19.0.2) Duplicate class com.google.android.gms.internal.measurement.zzna found in modules jetified-play-services-measurement-base-20.1.2-runtime (com.google.android.gms:play-services-measurement-base:20.1.2) and jetified-play-services-measurement-impl-19.0.2-runtime (com.google.android.gms:play-services-measurement-impl:19.0.2) Duplicate class com.google.android.gms.internal.measurement.zznb found in modules jetified-play-services-measurement-base-20.1.2-runtime (com.google.android.gms:play-services-measurement-base:20.1.2) and jetified-play-services-measurement-impl-19.0.2-runtime (com.google.android.gms:play-services-measurement-impl:19.0.2) Duplicate class com.google.android.gms.internal.measurement.zznc found in modules jetified-play-services-measurement-base-20.1.2-runtime (com.google.android.gms:play-services-measurement-base:20.1.2) and jetified-play-services-measurement-impl-19.0.2-runtime (com.google.android.gms:play-services-measurement-impl:19.0.2) Duplicate class com.google.android.gms.internal.measurement.zznd found in modules jetified-play-services-measurement-base-20.1.2-runtime (com.google.android.gms:play-services-measurement-base:20.1.2) and jetified-play-services-measurement-impl-19.0.2-runtime (com.google.android.gms:play-services-measurement-impl:19.0.2) Duplicate class com.google.android.gms.measurement.internal.zzga found in modules jetified-play-services-measurement-19.0.2-runtime (com.google.android.gms:play-services-measurement:19.0.2) and jetified-play-services-measurement-base-20.1.2-runtime (com.google.android.gms:play-services-measurement-base:20.1.2) Duplicate class com.google.android.gms.measurement.internal.zzhe found in modules jetified-play-services-measurement-base-20.1.2-runtime (com.google.android.gms:play-services-measurement-base:20.1.2) and jetified-play-services-measurement-impl-19.0.2-runtime (com.google.android.gms:play-services-measurement-impl:19.0.2) Duplicate class com.google.android.gms.measurement.internal.zzhf found in modules jetified-play-services-measurement-base-20.1.2-runtime (com.google.android.gms:play-services-measurement-base:20.1.2) and jetified-play-services-measurement-impl-19.0.2-runtime (com.google.android.gms:play-services-measurement-impl:19.0.2) Duplicate class com.google.android.gms.measurement.internal.zzhg found in modules jetified-play-services-measurement-base-20.1.2-runtime (com.google.android.gms:play-services-measurement-base:20.1.2) and jetified-play-services-measurement-impl-19.0.2-runtime (com.google.android.gms:play-services-measurement-impl:19.0.2) Duplicate class com.google.android.gms.measurement.internal.zzhh found in modules jetified-play-services-measurement-base-20.1.2-runtime (com.google.android.gms:play-services-measurement-base:20.1.2) and jetified-play-services-measurement-impl-19.0.2-runtime (com.google.android.gms:play-services-measurement-impl:19.0.2) Duplicate class com.google.android.gms.measurement.internal.zzhi found in modules jetified-play-services-measurement-base-20.1.2-runtime (com.google.android.gms:play-services-measurement-base:20.1.2) and jetified-play-services-measurement-impl-19.0.2-runtime (com.google.android.gms:play-services-measurement-impl:19.0.2) Duplicate class com.google.android.gms.measurement.internal.zzhj found in modules jetified-play-services-measurement-base-20.1.2-runtime (com.google.android.gms:play-services-measurement-base:20.1.2) and jetified-play-services-measurement-impl-19.0.2-runtime (com.google.android.gms:play-services-measurement-impl:19.0.2) Duplicate class com.google.android.gms.measurement.internal.zzio found in modules jetified-play-services-measurement-base-20.1.2-runtime (com.google.android.gms:play-services-measurement-base:20.1.2) and jetified-play-services-measurement-impl-19.0.2-runtime (com.google.android.gms:play-services-measurement-impl:19.0.2) Duplicate class com.google.android.gms.measurement.internal.zzit found in modules jetified-play-services-measurement-base-20.1.2-runtime (com.google.android.gms:play-services-measurement-base:20.1.2) and jetified-play-services-measurement-impl-19.0.2-runtime (com.google.android.gms:play-services-measurement-impl:19.0.2)

 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

BUILD FAILED in 1m 21s error Failed to install the app. info Run CLI with --verbose flag for more details. error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Can you share build.gradle ?

ANDROID

// Top-level build file where you can add configuration options common to all sub-projects/modules. //def REACT_NATIVE_VERSION = new File(['node', '--print',"JSON.parse(require('fs').readFileSync(require.resolve('react-native/package.json'), 'utf-8')).version"].execute(null, rootDir).text.trim())

buildscript { ext { // kotlinVersion = '1.7.0' buildToolsVersion = "33.0.0" minSdkVersion = 21 compileSdkVersion = 34 targetSdkVersion = 34 // RNVUseExoplayerIMA = true useExoplayerIMA = true useExoplayerRtsp = true useExoplayerSmoothStreaming = true useExoplayerDash = true useExoplayerHls = true // We use NDK 23 which has both M1 support and is the side-by-side NDK version from AGP. ndkVersion = "23.1.7779620" } repositories { google() mavenCentral() } dependencies { classpath("com.android.tools.build:gradle") classpath("com.facebook.react:react-native-gradle-plugin") // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files classpath('com.google.gms:google-services:4.3.15') classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.0") // classpath("com.android.tools.build:gradle") // classpath("com.facebook.react:react-native-gradle-plugin") // classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } }

ANDROID/APP

apply plugin: "com.android.application" apply plugin: "com.facebook.react"

apply plugin: 'com.google.gms.google-services'

/**

  • This is the configuration block to customize your React Native Android app.
  • By default you don't need to apply any configuration, just uncomment the lines you need. / react { / Folders / // The root of your project, i.e. where "package.json" lives. Default is '..' // root = file("../") // The folder where the react-native NPM package is. Default is ../node_modules/react-native // reactNativeDir = file("../node_modules/react-native") // The folder where the react-native Codegen package is. Default is ../node_modules/@react-native/codegen // codegenDir = file("../node_modules/@react-native/codegen") // The cli.js file which is the React Native CLI entrypoint. Default is ../node_modules/react-native/cli.js // cliFile = file("../node_modules/react-native/cli.js") / Variants / // The list of variants to that are debuggable. For those we're going to // skip the bundling of the JS bundle and the assets. By default is just 'debug'. // If you add flavors like lite, prod, etc. you'll have to list your debuggableVariants. // debuggableVariants = ["liteDebug", "prodDebug"] / Bundling / // A list containing the node command and its flags. Default is just 'node'. // nodeExecutableAndArgs = ["node"] // // The command to run when bundling. By default is 'bundle' // bundleCommand = "ram-bundle" // // The path to the CLI configuration file. Default is empty. // bundleConfig = file(../rn-cli.config.js) // // The name of the generated asset file containing your JS bundle // bundleAssetName = "MyApplication.android.bundle" // // The entry file for bundle generation. Default is 'index.android.js' or 'index.js' // entryFile = file("../js/MyApplication.android.js") // // A list of extra flags to pass to the 'bundle' commands. // See https://github.com/react-native-community/cli/blob/main/docs/commands.md#bundle // extraPackagerArgs = [] / Hermes Commands / // The hermes compiler command to run. By default it is 'hermesc' // hermesCommand = "$rootDir/my-custom-hermesc/bin/hermesc" // // The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map" // hermesFlags = ["-O", "-output-source-map"] } /*
  • Set this to true to Run Proguard on Release builds to minify the Java bytecode. / def enableProguardInReleaseBuilds = false /*
  • The preferred build flavor of JavaScriptCore (JSC)
  • For example, to use the international variant, you can use:
  • def jscFlavor = 'org.webkit:android-jsc-intl:+'
  • The international variant includes ICU i18n library and necessary data
  • allowing to use e.g. Date.toLocaleString and String.localeCompare that
  • give correct results when using with locales other than en-US. Note that
  • this variant is about 6MiB larger per architecture than default. */ def jscFlavor = 'org.webkit:android-jsc:+'

android {

ndkVersion rootProject.ext.ndkVersion

compileSdkVersion rootProject.ext.compileSdkVersion

namespace 'br.com.tiindiquei.ntgospel'
defaultConfig {
    applicationId "br.com.tiindiquei.ntgospel"
    minSdkVersion rootProject.ext.minSdkVersion
    targetSdkVersion rootProject.ext.targetSdkVersion
    versionCode 6
    versionName "2.0.0"
}

signingConfigs {
    debug {
        storeFile file('debug.keystore')
        storePassword 'android'
        keyAlias 'androiddebugkey'
        keyPassword 'android'
    }
    release {
        if (project.hasProperty('MYAPP_UPLOAD_STORE_FILE')) {
            storeFile file(MYAPP_UPLOAD_STORE_FILE)
            storePassword MYAPP_UPLOAD_STORE_PASSWORD
            keyAlias MYAPP_UPLOAD_KEY_ALIAS
            keyPassword MYAPP_UPLOAD_KEY_PASSWORD
        }
    }
}

buildTypes {
    debug {
        signingConfig signingConfigs.debug
    }
    release {
        // Caution! In production, you need to generate your own keystore file.
        // see https://reactnative.dev/docs/signed-apk-android.
        signingConfig signingConfigs.release
        minifyEnabled enableProguardInReleaseBuilds
        proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
    }
}

}

dependencies {

// The version of react-native is set by the React Native Gradle Plugin implementation("com.facebook.react:react-android")

debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}")
debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
    exclude group:'com.squareup.okhttp3', module:'okhttp'
}

implementation platform('com.google.firebase:firebase-bom:28.4.2')

implementation 'com.google.firebase:firebase-analytics'

implementation 'com.google.firebase:firebase-messaging'

implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0"

// implementation("com.google.android.gms:play-services-ads:23.1.0")

implementation project(':react-native-video')
// implementation "androidx.appcompat:appcompat:1.0.0"

constraints {
    implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.8.0") {
        because("kotlin-stdlib-jdk7 is now a part of kotlin-stdlib")
    }
    implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.0") {
        because("kotlin-stdlib-jdk8 is now a part of kotlin-stdlib")
    }
}

implementation project(':react-native-music-control')

implementation 'com.facebook.fresco:animated-gif:2.0.0'   //use

debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
    exclude group:'com.facebook.flipper'
    exclude group:'com.squareup.okhttp3', module:'okhttp'
}

debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}")
if (hermesEnabled.toBoolean()) {
    implementation("com.facebook.react:hermes-android")
} else {
    implementation jscFlavor
}

//implementation project(':reactnativeradioplayer')
implementation 'com.android.support:multidex:1.0.3'

}

apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)

jeandiasl avatar Jun 28 '24 12:06 jeandiasl

Getting this same issue, I can't go to 34 as it breaks other dependencies. Any solution would be appreciated??

aliwaqar981 avatar Jul 06 '24 18:07 aliwaqar981

@mikehardy Can you check this issue please

RohitBansal272 avatar Jul 06 '24 22:07 RohitBansal272

for planning release, my workaround is downgrade to 13.1.0 and the error gone

guide-vinh avatar Jul 08 '24 17:07 guide-vinh

@vinhguide can you guide me what have you downgraded? What do I need to do for this?

aliwaqar981 avatar Jul 09 '24 07:07 aliwaqar981

because the latest version depends on androidx.webkit:webkit:1.11.0-alpha07 that required sdk34 when compile. sdk34 make other libraries broken so i downgraded to the version that require sdk33 for avoid errors

@vinhguide can you guide me what have you downgraded? What do I need to do for this?

guide-vinh avatar Jul 09 '24 07:07 guide-vinh

@aliwaqar981 The last version of react-native-google-mobile-ads that compiles with Android SDK33 seems to be 13.3.1 To regress to the working version I did the following:

yarn remove react-native-google-mobile-ads yarn add [email protected]

unstableair avatar Jul 15 '24 17:07 unstableair

I just downgraded to "react-native-video": "^5.0.2". Everythink works for me

Azimjon1111 avatar Jul 19 '24 03:07 Azimjon1111

Hello 👋, to help manage issues we automatically close stale issues.

This issue has been automatically marked as stale because it has not had activity for quite some time.Has this issue been fixed, or does it still require attention?

This issue will be closed in 15 days if no further activity occurs.

Thank you for your contributions.

github-actions[bot] avatar Aug 16 '24 03:08 github-actions[bot]

I am having the same problem does anyone have a solution?

firatbadur avatar Aug 20 '24 07:08 firatbadur

@firatbadur From Target API level requirements for Google Play apps

Starting August 31 2024: New apps and app updates must target Android 14 (API level 34) to be submitted to Google Play

There is little point in trying to get this compiled against SDK 33 as your submission will not be accepted by Google after the 31st. I solved this by updating my app to React Native 0.73 which targets 34.

unstableair avatar Aug 20 '24 09:08 unstableair

Hello 👋, to help manage issues we automatically close stale issues.

This issue has been automatically marked as stale because it has not had activity for quite some time.Has this issue been fixed, or does it still require attention?

This issue will be closed in 15 days if no further activity occurs.

Thank you for your contributions.

github-actions[bot] avatar Sep 30 '24 07:09 github-actions[bot]

This issue cannot be resolved on my end. I have tried all possible solutions, but nothing seems to work. Could you kindly assist in resolving this or provide guidance on how to handle it?

Thank you.

aliisher avatar Sep 30 '24 12:09 aliisher

There will not be progress here. You must target API34 or higher, it's a requirement. If that doesn't work for you read the above comments and use either the last version that worked with API <= 33 (version 13.3.1 here) or patch whatever packages don't work with API34

API34+ is a requirement for google play store access now, there is no point in spending any time doing anything but getting your app to work with API34 (and then API35 etc)

mikehardy avatar Sep 30 '24 14:09 mikehardy