If you're trying to add androidx in the framework, I think this poses a problem because I don't think androidx libraries can co-exists with non androidx libraries (because they'll produce conflicts). This will also force everyone onto androidx. While we will want to force androidx eventually, since non-androidx is deprecated... We can't make a change like this until a major release.
One way to avoid introducing breaking changes is to perhaps have a second template for androidx, which gets used depending if the "AndroidXEnabled" flag is set to true. I'm not sure if this is the best way forward, this is just thinking out loud. Would love to hear feedback. On 2020/08/11 19:41:57, Hans Krywalsky wrote: > Hey everybody,> > > i'm currently developing a new maintained Braintree Plugin. As the latest > mobile SDK of them requires AndroidX, i searched for Issues and found this > one: https://github.com/apache/cordova-android/issues/841> > > As it is mentioned correctly it is nearly enough to change the base class of > the CordovaActivity from android.app.Activity to > androidx.appcompat.app.AppCompatActivity. > > > I forked cordova-android and tested it out. Changing three Java Classes, the > AndroidManifest.xml and adjust the build.gradle Script and it works 😃 > > > Like i comment in the Ticket i thing make the changes based on the > AndroidXEnabled Preference should be a good solution, but the question how. > > > Adjusting the Gradle File is easy:dependencies {> > if (project.hasProperty('android.useAndroidX')) {> > implementation 'androidx.appcompat:appcompat:1.2.0'> > }> > }> > > But how to continue with the other Files? Also the Change in the > AndroidManifest.xml is just on Line:> > Change the android:theme to @style/Theme.AppCompat.NoActionBar - this can be > easy performed in the prepare Script?> > > But what about the Changes in the Java Files? What is the best way to make > this possible? I think changing the single Lines in the prepare Script is not > the best solution?> > > Please give me some hints, so i can create the PR.> > > Greetings,> > Hans> > > ---------------------------------------------------------------------> > To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org> > For additional commands, e-mail: dev-h...@cordova.apache.org> > > Norman Breau Software Developer nor...@normanbreau.com (https://link.getmailspring.com/link/2fb46600-c689-4c14-b85b-b81b7db31...@getmailspring.com/0?redirect=mailto%3Anorman%40normanbreau.com&recipient=ZGV2QGNvcmRvdmEuYXBhY2hlLm9yZw%3D%3D) https://breautek.com (https://link.getmailspring.com/link/2fb46600-c689-4c14-b85b-b81b7db31...@getmailspring.com/2?redirect=https%3A%2F%2Fbreautek.com&recipient=ZGV2QGNvcmRvdmEuYXBhY2hlLm9yZw%3D%3D)