# AndroidX support

**URL:** <https://forums.unrealengine.com/t/androidx-support/465584>\
**Category:** Mobile\
**Tags:** gradle, unreal-engine, UE4-25, Android, Packaging, question\
**Created:** [May 21, 2020, 4:21pm UTC](https://forums.unrealengine.com/t/androidx-support/465584 "2020-05-21T16:21:34Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fatorice](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Fatorice](https://forums.unrealengine.com/u/Fatorice)\
**Post date:** [May 21, 2020, 4:21pm UTC](https://forums.unrealengine.com/t/androidx-support/465584/1 "2020-05-21T16:21:34Z")

</div>

Hello!

I’m currently working on an android/ios plugin which relies on androidX, so I activated it using UPL, but since UnrealEngine version 4.25 there are 2 new imports in the GameActivity from support libraries v4 and gradle gives me an error, that those two imports couldn’t be found. Does anyone have an idea on how to replace those two imports with the androidX pendants? I don’t want to manually change the imports after packaging in UnrealEngine because this is for a plugin… 😕 I already tried the command in UPL but it seems, that it can only be used for the current context and not the whole GameActivity.java file…

I hope you can help me to achieve androidX support for UnrealEngine! 🙂

Thanks already:)

---

<div class="post-metadata">

**Author:** ![Fatorice](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Fatorice](https://forums.unrealengine.com/u/Fatorice)\
**Post date:** [May 23, 2020, 10:25pm UTC](https://forums.unrealengine.com/t/androidx-support/465584/2 "2020-05-23T22:25:35Z")

</div>

For those who are struggling too:  
I fixed the issue by using replace string in gradle like this:

```
task replaceImport {
    	ant.replace(token:'import android.support.v4.app.NotificationManagerCompat;', value:'import androidx.core.app.NotificationManagerCompat;') {
    		fileset(dir: 'src/main/java/com/epicgames/ue4', includes: 'GameActivity.java')
    	}
    	ant.replace(token:'import android.support.v4.content.FileProvider;', value:'import androidx.core.content.FileProvider;') {
    		fileset(dir: 'src/main/java/com/epicgames/ue4', includes: 'GameActivity.java')
    	}
}
build.dependsOn replaceImport
```

---

<div class="post-metadata">

**Author:** ![miko1a](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@miko1a](https://forums.unrealengine.com/u/miko1a)\
**Post date:** [July 16, 2020, 1:32pm UTC](https://forums.unrealengine.com/t/androidx-support/465584/3 "2020-07-16T13:32:55Z")

</div>

How did you manage to resolve other dependencies in GameActivity.java? Like android permissions plugin or obb-downloader activity? It’s not just imports. I don’t want to make changes in engine as well.

---

<div class="post-metadata">

**Author:** ![Fatorice](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Fatorice](https://forums.unrealengine.com/u/Fatorice)\
**Post date:** [July 19, 2020, 8:34pm UTC](https://forums.unrealengine.com/t/androidx-support/465584/4 "2020-07-19T20:34:54Z")

</div>

I fixed them by adding a Plugin-Level “ThirdParty”-folder, which contains all files, who are causing issues, with androidX libraries. They can simply replaced in the build process like this:

```
<copyDir src="$S(PluginDir)/../ThirdParty/Android/permission_library" dst="$S(BuildDir)/JavaLibs/permission_library" />

<copyDir src="$S(PluginDir)/../ThirdParty/Android/permission_library" dst="$S(BuildDir)/gradle/permission_library" />

```

Hope that helps!

---

<div class="post-metadata">

**Author:** ![miko1a](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@miko1a](https://forums.unrealengine.com/u/miko1a)\
**Post date:** [July 20, 2020, 6:19am UTC](https://forums.unrealengine.com/t/androidx-support/465584/5 "2020-07-20T06:19:26Z")

</div>

Thanks! That really helped

---

<div class="post-metadata">

**Author:** ![Nineva\_Studios](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/nineva_studios/32/469616_2.png) [@Nineva\_Studios](https://forums.unrealengine.com/u/Nineva_Studios)\
**Post date:** [August 20, 2020, 8:34pm UTC](https://forums.unrealengine.com/t/androidx-support/465584/6 "2020-08-20T20:34:07Z")

</div>

I wrote on article how we are migrating the project to Android X in for our plugins [How to force the Unreal Engine Android project to use AndroidX? | by Taras Leskiv | nineva | Medium](https://medium.com/nineva/how-to-force-the-unreal-engine-android-project-to-use-androidx-f7060abd56ac) - it’s described there in detail.

---

<div class="post-metadata">

**Author:** ![TJushua](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TJushua](https://forums.unrealengine.com/u/TJushua)\
**Post date:** [August 3, 2022, 12:18pm UTC](https://forums.unrealengine.com/t/androidx-support/465584/7 "2022-08-03T12:18:56Z")

</div>

[GitHub - ufna/AndroidX-UE4: AndroidX support for Unreal Engine 4](https://github.com/ufna/AndroidX-UE4) look at this
