Hi, I have a problem with Gradle and AndroidX in Unity 2017.4.22f1. Starting from a certain moment Android Resolver in our project started resolving AndroidX libraries as dependencies. (They should replace Android Support Library.) But one cannot simply start using it; documentation requires to add a couple of lines to gradle.properties and set the compile SDK to Android 9.0 (API level 28) or higher. 1) How can I change gradle.properties file? (Not to be confused with mainTemplate.gradle file.) 2) What is the value of placeholder **APIVERSION** in mainTemplate.gradle? Code (csharp): compileSdkVersion **APIVERSION** (Not to be confused with minSdkVersion or targetSdkVersion.) @Yury-Habets @JoshPeterson
Unfortunately, as far as i know, you can't set jetifier flags in gradle.properties automatically as you are below 2018.2 version. Also, Unity didn't backport gradle post processor callback to 2017.4 LTS so, its a kind of problem now for the users who are less than 2018.2 and need to add to gradle.properties automatically. However, you can move on to 2018.4 LTS if its possible to automate it.
@Voxel-Busters Thanks a lot for your reply! Oh, I see you mentioning this in recent thread... We indeed consider moving to 2018.4 LTS in a month or two. Then, how can I add these two flags (android.useAndroidX and android.enableJetifier) to (generated?) gradle.properties file in Unity 2018? Are there any examples of using OnPostGenerateGradleAndroidProject API?
Its too late over here. I will share the code which we used to automate it in Cross Platform Native Plugins May be that will help.