Rolamix / cordova-plugin-playlist

🎶 A Cordova plugin for Android and iOS with native support for audio playlists, background support, and lock screen controls 🎶
MIT License
33 stars 33 forks source link

Updated Android Support Library to Android X library #43

Open aitJess opened 3 years ago

aitJess commented 3 years ago

Description

Updated use of support library for annotations to the androidx library. This is due to the support library no longer being maintained and the androidx library replacing it.

Related Issue

https://github.com/Rolamix/cordova-plugin-playlist/issues/42

Motivation and Context

This change is required due to android's maintenance of the support library stopping, which may eventually lead to them deprecating the library. This is to future proof the plugin and allow it to work with other updated plugins.

How Has This Been Tested?

Since all it changed was the used libraries for certain function tags -- namely FloatRange, IntRange, NotNull, and Nullable -- I've tested it in my own cordova app and was able to successfully build with Android X Support.

Types of changes

Checklist:

daveshirman commented 3 years ago

I tried to use this today and I just get the application crashing when it loads on the emulator or my device, this is with Capacitor and Ionic 5 and no other plugins installed.

Error:

android.app.Application cannot be cast to __PACKAGE_NAME__.MainApplication

Any ideas?

aitJess commented 3 years ago

Hello @daveshirman , I cannot think of anything that may cause that off the top of my head but when I have time I'll look into it and update my branch. For the moment there is a plugin that should auto-replace any outdated support libraries for androidx you may use in the future. I had wanted to solve this issue permanently rather than relying on yet another plugin. Here is said plugin, try it with the normal branch for the playlist plugin and see if it resolves your issue. https://www.npmjs.com/package/cordova-plugin-androidx-adapter