Open NorthFred opened 1 month ago
@NorthFred I've tested Android 34 in our apps with the latest version of this plugin + Capacitor 5 and I dont get this error.
Are you running the latest version + Capacitor 5?
Also - I don't see anything in this trace that references the plugin.
I only test Android 34 at this point - so I'm sure this supports it.
I have the same issue trying to use the plugin on an API 34 emulator (no matching API 34 device available sadly). https://github.com/ingageco/capacitor-music-controls-plugin/blob/main/android/src/main/java/com/ingageco/capacitormusiccontrols/CapacitorMusicControls.java I was adjusting the same file for the orignal cordova plugin to fit the requirement and I figure one will need the same adjustments in this version?
I used the androidx compat library to not cause issues with older versions, and also changed all mentions of FLAG_MUTABLE to FLAG_IMMUTABLE, because this seems to cause issues too.
Here's the things I changed that make it work on my end: https://github.com/ingageco/capacitor-music-controls-plugin/compare/main...heffthedev:capacitor-music-controls-plugin:main
@heffthedev Thank you! i'll take a look at your changes and probably merge them once i confirm everything is working.
@ingageco When could we get this merged? I'm eager to start testing! :)
@ingageco @heffthedev Any updates, please? Can I get the commit with changes merged to this master branch, or a separate branch that can be used for testing?
My time is limited right now- I'm happy to review a PR
@ingageco I am not able to create a PR from the changes done by @heffthedev since I am not a collaborator in the project. Could you merge the changes, they look good to me.
@NorthFred You can try the review branch where i have merged these changes - but I may not keep the changes to method names updateElapsed
and music-controls-skip-to
. I'll let you know once you review and prepare to merge into main.
@ingageco Thanks for the help! I'm however running now into following error for RECEIVER_NOT_EXPORTED:
error: cannot find symbol
ContextCompat.registerReceiver(context, (BroadcastReceiver)mMessageReceiver, new IntentFilter("music-controls-previous"), ContextCompat.RECEIVER_NOT_EXPORTED);
^
symbol: variable RECEIVER_NOT_EXPORTED
location: class ContextCompat
@NorthFred I'm sorry but at this moment I'm too tied up in paid client work to dig into this.
@ingageco @heffthedev
I realized my variables.gradle
file was outdated. It needs following settings for Capacitor 5+:
ext {
minSdkVersion = 22
compileSdkVersion = 34
targetSdkVersion = 34
androidxActivityVersion = '1.7.0'
androidxAppCompatVersion = '1.6.1'
androidxCoordinatorLayoutVersion = '1.2.0'
androidxCoreVersion = '1.10.0'
androidxFragmentVersion = '1.5.6'
coreSplashScreenVersion = '1.0.0'
androidxWebkitVersion = '1.6.1'
junitVersion = '4.13.2'
androidxJunitVersion = '1.1.5'
androidxEspressoCoreVersion = '3.5.1'
cordovaAndroidVersion = '10.1.1'
}
Then the RECEIVER_NOT_EXPORTED issue no longer appears.
I will continue testing tomorrow...
@ingageco This can now be merged.
Please exclude the commits with changes to updateElapsed
and music-controls-skip-to
.
Worth noting also is that the manifest file AndroidManifest.xml
requires this permission for Android 14:
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_MEDIA_PLAYBACK" />
@ingageco The review
branch can be merged to the main branch.
(The updateElapsed
and music-controls-skip-to
changes affect only to the README.md
.)
I have received positive feedback from Android 14 users, so all is good!
App updates must target targetSdk 34 by August 31st 2024. When targetting the app for API level 34, following error occurs:
The app keeps closing when trying to run it.