how to update androidx.fragment:fragment latest

Recently I’ve just updated one of my apps and Google has show me this message:

Warning

The developer of androidx.fragment:fragment (androidx.fragment:fragment) has reported version 1.0.0 as outdated. Consider upgrading to one of the following versions before publishing a new release: 1.1.0+.

please help me

Learn more about the SDKs that you’re using and make informed SDK choices with Google Play SDK Index 2.

5 Likes

I have been searching for a solution for this for a week and have not found anything remotely useful on how to fix this.

1 Like

Have you tried adding a dependency to a newer version of the library using an EDM4U Dependencies.xml file?

` `

This will override older versions that other android libraries depend upon.

3 Likes

I am still frustrated. Anybody know how to get rid of this warning?

Same problem. Does anybody know how to get rid of this warning?

Mine magically disappeared.

I did change a few unrelated things, just not sure which one solved the issue.

  1. I added admob.
  2. I added unity ads (through admob mediation).
  3. I added facebook ads (through admob mediation).

how??pls make youtube tutorial

Hey everyone.
Have same problem here.
Does anyone managed to fix this?

Any tips to fix this issue? Google Play Console keeps warning me to update it :frowning:

Hi guys, I have fixed it by applying the above solution, I am using Firebase so I added this line

to AnalyticsDependencies.xml located in \Assets\Firebase\Editor

Good luck.

1 Like

I try it but the Google Play Console still warning me!

How you fixed it please let me know make a small video

1 Like

Same here

The reason for me is / was the Google Play Game Services (v0.11.01).
Play Services Source: https://github.com/playgameservices/play-games-plugin-for-unity/tree/master/current-build

The Google Play Services package has not seen a new release within the last year. I find it disturbing that they show a warning in the console while they do not update their own package to prevent said warning. Seems like those two teams are not communicating. Maybe someone from Unity could go poke them so they update the package.

Here is the gradle dependencies graph (notice the outdated androidx.fragment:fragment:1.0.0 instead of the recommended 1.1.0). Created following this guide. The “dependencies” command is very useful to find out where exactly it is coming from.

Task :unityLibrary:dependencies


Project :unityLibrary

±-- com.google.games:gpgs-plugin-support:0.11.01
| ±-- com.google.android.gms:play-services-games-v2:17.0.0
| | ±-- com.google.android.gms:play-services-base:18.0.1
| | | ±-- androidx.collection:collection:1.0.0
| | | | -– androidx.annotation:annotation:1.0.0 → 1.1.0
| | | ±-- androidx.core:core:1.2.0
| | | | ±-- androidx.annotation:annotation:1.1.0
| | | | ±-- androidx.lifecycle:lifecycle-runtime:2.0.0
| | | | | ±-- androidx.lifecycle:lifecycle-common:2.0.0
| | | | | | -– androidx.annotation:annotation:1.0.0 → 1.1.0
| | | | | ±-- androidx.arch.core:core-common:2.0.0
| | | | | | -– androidx.annotation:annotation:1.0.0 → 1.1.0
| | | | | -– androidx.annotation:annotation:1.0.0 → 1.1.0
| | | | -– androidx.versionedparcelable:versionedparcelable:1.1.0
| | | | ±-- androidx.annotation:annotation:1.1.0
| | | | -– androidx.collection:collection:1.0.0 ()
| | | ±-- androidx.fragment:fragment:1.0.0
| | | | ±-- androidx.core:core:1.0.0 → 1.2.0 (
)
| | | | ±-- androidx.legacy:legacy-support-core-ui:1.0.0
| | | | | ±-- androidx.annotation:annotation:1.0.0 → 1.1.0
| | | | | ±-- androidx.core:core:1.0.0 → 1.2.0 ()
| | | | | ±-- androidx.legacy:legacy-support-core-utils:1.0.0
| | | | | | ±-- androidx.annotation:annotation:1.0.0 → 1.1.0
| | | | | | ±-- androidx.core:core:1.0.0 → 1.2.0 (
)
| | | | | | ±-- androidx.documentfile:documentfile:1.0.0
| | | | | | | -– androidx.annotation:annotation:1.0.0 → 1.1.0
| | | | | | ±-- androidx.loader:loader:1.0.0
| | | | | | | ±-- androidx.annotation:annotation:1.0.0 → 1.1.0
| | | | | | | ±-- androidx.core:core:1.0.0 → 1.2.0 ()
| | | | | | | ±-- androidx.lifecycle:lifecycle-livedata:2.0.0
| | | | | | | | ±-- androidx.arch.core:core-runtime:2.0.0
| | | | | | | | | ±-- androidx.annotation:annotation:1.0.0 → 1.1.0
| | | | | | | | | -– androidx.arch.core:core-common:2.0.0 (
)
| | | | | | | | ±-- androidx.lifecycle:lifecycle-livedata-core:2.0.0
| | | | | | | | | ±-- androidx.lifecycle:lifecycle-common:2.0.0 ()
| | | | | | | | | ±-- androidx.arch.core:core-common:2.0.0 (
)
| | | | | | | | | -– androidx.arch.core:core-runtime:2.0.0 ()
| | | | | | | | -– androidx.arch.core:core-common:2.0.0 (
)
| | | | | | | -– androidx.lifecycle:lifecycle-viewmodel:2.0.0
| | | | | | | -– androidx.annotation:annotation:1.0.0 → 1.1.0

** @tessellation 's solution is working.**

Step by step guide:

  1. Create a folder Assets/Editor

  2. Add a file (name ending with “Dependencies.xml”). I Chose “OverrideDependencies.xml”
    Content of the file:

<!-- see https://discussions.unity.com/t/922516/3 -->
<dependencies>
  <androidPackages>
    <repositories>
      <repository>https://repo.maven.apache.org/maven2</repository>
    </repositories>
    <androidPackage spec="androidx.fragment:fragment:1.1.0" />
  </androidPackages>
</dependencies>
  1. Force resolve with the dependency mananger from google (formerly jar resolver):
    9240729--1291470--upload_2023-8-22_12-13-35.png

If you are using GameService you may have to apply this fix too.

13 Likes

I try your methods but It is still showing the Google Play Console Error

Have you tried using the gradle “dependencies” command to check where the dependency is coming from? You can run the command on the created gradle file in the build and it will show you the source.

Also, Google did show the warning for me even after upgrading. That’s when I noticed that they are also checking any old alpha or beta releases. It’s a bit confusing but maybe your build is already fine and it’s just an old beta that’s causing it.

2 Likes

From youtube, you need add constraints.implementation 'androidx.fragment:fragment:1.3.6' to mainTemplate.gradle

The dependency list in mainTemplate.gradle is actually generated by the Android Resolver and adding something into that list might result in it being overridden next time the resolver runs (maybe if you add it outside the Android Resolver comments it won’t be erased depending on whether your gradle file is set to be auto-generated or not, haven’t tested)

See how on each dependency line in the gradle file there’s a commented out XML dependency file name? This actually ties in with the solution posed by tesselation and geo – these dependencies are actually being parsed from the Assets/*Dependency.XML files listed.

I added my own Assets/Editor/MyDependencies.xml and then ran the resolver (Assets → External Dependency Manager → Android Resolver → Force resolve) and checked mainTemplate.gradle, and the androidx.fragment dependency override appeared in the same spot as in restush96’s post. So I’d advise taking the XML approach instead!

4 Likes

@bitterness You are right. My bad.

1 Like

It works. Thank you guys.

but in my case helped this dependency file

<dependencies>
  <androidPackages>
    <androidPackage spec="androidx.fragment:fragment:1.1.0">
      <androidSdkPackageIds>
        <androidSdkPackageId>extra-google-m2repository</androidSdkPackageId>
      </androidSdkPackageIds>
    </androidPackage>
  </androidPackages>
</dependencies>

And IMPORTANT things to do is:

  1. Force Resolve (Assets > External Dependency Manager > Android Resolver > Force Resolve)
  2. Then remove {yourProject}/Libraries/Bee/Android folder
  3. Build

Cheers. Hope it will help

6 Likes