# Migrating to AndroidX

**URL:** <https://forum.defold.com/t/migrating-to-androidx/66726>\
**Category:** Announcements\
**Created:** [November 2, 2020, 9:10am UTC](https://forum.defold.com/t/migrating-to-androidx/66726 "2020-11-02T09:10:11Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![britzl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/britzl/32/23_2.png) [@britzl](https://forum.defold.com/u/britzl)\
**Post date:** [November 2, 2020, 9:10am UTC](https://forum.defold.com/t/migrating-to-androidx/66726/1 "2020-11-02T09:10:11Z")

</div>

We have begun migrating all of the officially supported extensions to [AndroidX](https://developer.android.com/jetpack/androidx). AndroidX is an improvement to the original Android [Support Library](https://developer.android.com/topic/libraries/support-library), which is no longer maintained. All recent updates to Google Services such as Push, Games, Analytics and more are based on the AndroidX libraries. Facebook has also rolled out new versions of their SDK which only support AndroidX.

We will keep supporting the old versions of the extensions for as long as possible, but it is recommended that you migrate soon to not miss out on important bugfixes.

With this change it is extra important that you never depend directly on the master branch of any dependencies. You should always depend on a specific release to avoid breaking changes as the libraries get updated.

**extension-camera**  
AndroidX: [https://github.com/defold/extension-camera/archive/2.0.0.zip](https://github.com/defold/extension-camera/archive/2.0.0.zip)  
Support Library: [https://github.com/defold/extension-camera/archive/1.0.0.zip](https://github.com/defold/extension-camera/archive/1.0.0.zip)

**extension-gpgs**  
AndroidX: [https://github.com/defold/extension-gpgs/archive/2.0.0.zip](https://github.com/defold/extension-gpgs/archive/2.0.0.zip)  
Support Library: [https://github.com/defold/extension-gpgs/archive/1.3.3.zip](https://github.com/defold/extension-gpgs/archive/1.3.3.zip)

**extension-push**  
AndroidX: [https://github.com/defold/extension-push/archive/3.0.0.zip](https://github.com/defold/extension-push/archive/3.0.0.zip)  
Support Library: [https://github.com/defold/extension-push/archive/2.0.2.zip](https://github.com/defold/extension-push/archive/2.0.2.zip)

**extension-facebook**  
AndroidX: [https://github.com/defold/extension-facebook/archive/3.0.0.zip](https://github.com/defold/extension-facebook/archive/3.0.0.zip) (uses Facebook SDK 7.1.0 for Android and SDK 6.5.1 for iOS)  
Support Library: [https://github.com/defold/extension-facebook/archive/2.6.0.zip](https://github.com/defold/extension-facebook/archive/2.6.0.zip) (uses Facebook SDK 6.5.1 for Android and iOS)

**extension-iac**  
**extension-iap**  
**extension-webview**  
**extension-adinfo**  
**extension-videoplayer-native**  
No dependency on the support libraries.

**extension-firebase**  
Built using the Firebase C++ SDK (v 6.16.0). No dependency on support libraries.

We will update this post with additional libraries as we migrate them to AndroidX.

---

<div class="post-metadata">

**Author:** ![SkaterDad](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/skaterdad/32/41137_2.png) [@SkaterDad](https://forum.defold.com/u/SkaterDad)\
**Post date:** [November 3, 2020, 2:13am UTC](https://forum.defold.com/t/migrating-to-androidx/66726/2 "2020-11-03T02:13:50Z")

</div>

Do you anticipate any breaking changes? Or should this be pretty much seamless?

---

<div class="post-metadata">

**Author:** ![britzl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/britzl/32/23_2.png) [@britzl](https://forum.defold.com/u/britzl)\
**Post date:** [November 3, 2020, 6:08am UTC](https://forum.defold.com/t/migrating-to-androidx/66726/3 "2020-11-03T06:08:49Z")

</div>

There should be no breaking changes. Android X libraries use new package names for all classes but should work the same as the old versions.

The problem is that you can’t mix old and new libraries, so either all of your dependencies need to migrate or none. We will handle migration of all our extensions, and we recommend or community to also migrate theirs.

It is usually just a matter of updating your dependency versions in build.gradle and then importing the AndroidX classes, like this:

[https://github.com/defold/extension-push/commit/a1a8b4ba182d2376ede50d7f3d40a0ff91345eb9](https://github.com/defold/extension-push/commit/a1a8b4ba182d2376ede50d7f3d40a0ff91345eb9)

---

<div class="post-metadata">

**Author:** ![britzl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/britzl/32/23_2.png) [@britzl](https://forum.defold.com/u/britzl)\
**Post date:** [November 28, 2020, 10:27pm UTC](https://forum.defold.com/t/migrating-to-androidx/66726/4 "2020-11-28T22:27:33Z")

</div>

In Defold 1.2.177 we will enabled support for the Android Jetifier tool to the Defold build servers to help with migration to AndroidX. The Jetifier tool is currently running on the beta server ([https://build-stage.defold.com](https://build-stage.defold.com)) and will be available on the main build server when 1.2.177 is released in about a week.

The Jetifier tool will automatically try to migrate dependencies defined in the build.gradle files of extensions and in .jar files in your project. The Jetifier tool is enabled as an application manifest setting for armv7 and arm64:

```lua
    armv7-android:
        context:
            ...
            jetifier: true

    arm64-android:
        context:
            ...
            jetifier: true

```

The online manifest generator has been updated to support the new setting:

> **[Defold App Manifest generator](https://britzl.github.io/manifestation/)**

---

<div class="post-metadata">

**Author:** ![totebo](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/totebo/32/36087_2.png) [@totebo](https://forum.defold.com/u/totebo)\
**Post date:** [January 26, 2021, 2:04pm UTC](https://forum.defold.com/t/migrating-to-androidx/66726/5 "2021-01-26T14:04:42Z")

</div>

> [@britzl](#):
>
> The problem is that you can’t mix old and new libraries, so either all of your dependencies need to migrate or none.

Does this mean that if one extension doesn’t use AndroidX, in my case I think GameAnalytics doesn’t, the game cannot use the latest IAP, Firebase, GPGS, Push and Facebook extensions?

Update: It seems not! Using the manifest generator with GameAnalytics + all the above mentioned dependencies built fine.

---

<div class="post-metadata">

**Author:** ![britzl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/britzl/32/23_2.png) [@britzl](https://forum.defold.com/u/britzl)\
**Post date:** [January 26, 2021, 5:32pm UTC](https://forum.defold.com/t/migrating-to-androidx/66726/6 "2021-01-26T17:32:42Z")

</div>

> [@totebo](#):
>
> Update: It seems not! Using the manifest generator with GameAnalytics + all the above mentioned dependencies built fine.

When you build with AndroidX/Jetifier enabled in the app manifest (we will make this a game.project option) gradle and the Android tools will try to migrate all gradle dependencies to AndroidX.

If GameAnalytics uses old support libraries or similar they will automatically become upgraded to their AndroidX equivalents when you build your project.

The problem is if your project contains Java code or .jar files which references old support support libraries in which case you need to manually migrate those or use the Android Jetifier tool to help with the migration.

---

<div class="post-metadata">

**Author:** ![d954mas](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/d954mas/32/5401_2.png) [@d954mas](https://forum.defold.com/u/d954mas)\
**Post date:** [February 18, 2021, 1:13pm UTC](https://forum.defold.com/t/migrating-to-androidx/66726/7 "2021-02-18T13:13:41Z")

</div>

So if i have a dependecy in build.gradle that use androidX.  
I add jetifer true. And it should work? or i need some more steps?

```lua
 armv7-android:
        context:
            flags: ["-std=c++11"]
            jetifier: true
    arm64-android:
        context:
            flags: ["-std=c++11"]
            jetifier: true

```

It not help me.

```lua
 What went wrong:
Execution failed for task ':downloadDependencies'.
 This project uses AndroidX dependencies, but the 'android.useAndroidX' property is not enabled. Set this property to true in the gradle.properties file and retry.
  The following AndroidX dependencies are detected: androidx.appcompat:appcompat:1.1.0, androidx.core:core:1.1.0, androidx.versionedparcelable:versionedparcelable:1.1.0, androidx.fragment:fragment:1.1.0, androidx.lifecycle:lifecycle-common:2.1.0, androidx.appcompat:appcompat-resources:1.1.0, androidx.customview:customview:1.0.0, androidx.lifecycle:lifecycle-livedata:2.0.0, androidx.lifecycle:lifecycle-viewmodel:2.1.0, androidx.interpolator:interpolator:1.0.0, androidx.loader:loader:1.0.0, androidx.lifecycle:lifecycle-livedata-core:2.0.0, androidx.activity:activity:1.0.0, androidx.drawerlayout:drawerlayout:1.0.0, androidx.collection:collection:1.1.0, androidx.viewpager:viewpager:1.0.0, androidx.arch.core:core-runtime:2.0.0, androidx.arch.core:core-common:2.1.0, androidx.cursoradapter:cursoradapter:1.0.0, androidx.vectordrawable:vectordrawable-animated:1.1.0, androidx.lifecycle:lifecycle-runtime:2.1.0, androidx.vectordrawable:vectordrawable:1.1.0, androidx.savedstate:savedstate:1.0.0, androidx.annotation:annotation:1.1.0

```

---

<div class="post-metadata">

**Author:** ![d954mas](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/d954mas/32/5401_2.png) [@d954mas](https://forum.defold.com/u/d954mas)\
**Post date:** [February 18, 2021, 1:19pm UTC](https://forum.defold.com/t/migrating-to-androidx/66726/8 "2021-02-18T13:19:42Z")

</div>

I understand. I need to add it to game manifest, not library manifest)  
Thanks)

---

<div class="post-metadata">

**Author:** ![britzl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/britzl/32/23_2.png) [@britzl](https://forum.defold.com/u/britzl)\
**Post date:** [February 18, 2021, 1:27pm UTC](https://forum.defold.com/t/migrating-to-androidx/66726/9 "2021-02-18T13:27:24Z")

</div>

> [@d954mas](#):
>
> I need to add it to game manifest, not library manifest)

Correct.It applies AndroidX to your entire project.

(PS We plan to move this to a checkbox in game.project)
