Search code examples
androidreact-nativesdkgoogle-play-console

(SDK issues) com.google.android.play:core has added this note for core:1.9.0


I use react-native 0.69.7 and I got this email:

com.google.android.play:core has added this note for core:1.9.0:

Update your Play Core Maven dependency to an Android 14 compatible version! Your current Play Core library is incompatible with targetSdkVersion 34 (Android 14), which introduces a backwards-incompatible change to broadcast receivers to improve user security.

As a reminder, from August 31, Google Play requires all new app releases to target Android 14. Update to the latest Play Core library version dependency to avoid app crashes: https://developer.android.com/guide/playcore#playcore-migration

I tried following the doc but it doesn't work. Is there any solution for react-native?


Solution

  • In our case, com.google.android.play:core was a transitive dependency. This means it was included indirectly through another library. To resolve this, we needed to identify which dependency was using it and update that dependency to the latest version.

    Steps to Identify the Dependency Using com.google.android.play:core:

    1. Navigate to the Android Folder:

      • Open a terminal and navigate to the android directory of your React Native project:

        cd android
        
    2. Run the Gradle Dependencies Command:

      • Execute the following command to generate a list of all dependencies and their transitive dependencies:

        ./gradlew app:dependencies > dependencies.txt
        
    3. Search for com.google.android.play:core:

      • Open the dependencies.txt file and search for com.google.android.play:core to find which library is including it.

    Example:

    In our project, we found that the library sp-react-native-in-app-updates was using com.google.android.play:core as a transitive dependency:

    \--- project :sp-react-native-in-app-updates
         +--- com.facebook.react:react-native:+ -> 0.68.2 (*)
         \--- com.google.android.play:core:1.9.1
    

    After identifying the dependency, we updated sp-react-native-in-app-updates to its latest version to ensure it uses the latest version of com.google.android.play:core.