New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Android] crash with no logs - Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE #1484
Comments
@okevino47 can you please see if you have this issue with |
Actually, after reading this it sounds like you're trying to upgrade to apiVersion 31. This is supported in the RC I mentioned, it's actually the minimum level. You can see this comment for more details |
Thank you for you quick answer 🙂 Hope it will be release soon, good luck for your job 🙂 |
For quick fix with old version 1.2.7 Step 1. Inside react-native-track-player -> build.gradle Update |
This issue means we can't update our app to React Native 0.68. Is there likely to be a release soon? |
@gavrichards Please see my comment |
Thanks @jspizziri I've seen all the relevant comments, I just wondered if there's any news of when the next release is likely to be? Thanks |
@gavrichards The next RC? Or a final version of 2.2. The issue in question is solved in 2.2.0-rc3 |
@jspizziri a release that contains a fix for this issue, whatever that happens to be :) |
@gavrichards As I mentioned please install v2.2.0-rc3 |
@jspizziri ok I was concerned about using that in production in case it wasn't ready, and there's no changelog so I can understand what's new and any breaking changes. |
@gavrichards , there are known issues so I don't consider it production ready. Several fixes in the way. It's it's a minor version release meaning there should not be any BC breaks. If there are they would be considered bugs that would be fixed. You can always look at the commit history since the last tag to see what's changed if you want. The big thing is the android rewrite. |
For anyone who is not in a position to update to 2.x, and needs to stay on 1.2.7 for a while, I've forked the repo at the 1.2.7 tag and made the changes suggested above. This works for me in my project, and I'm going to keep it live in my company's repo. Repo is here: https://github.com/world50/react-native-track-player Update your
|
@ProtoJoe |
* fix: Targeting S+ version 31 and above source: #1484 (comment) * fix: Targeting S+ version 31 and above source: #1484 (comment) * chore: pump version
Just catching up here. I haven't seen the issue referenced in that comment. We've been running w/ the updated form of the library since I patched it back in May, and it's been working well for us. I'll do a bit of digging and see if I see the same issues you've mentioned, but I don't believe we have. |
Hello! I don't want to update to version 3.x This issue was solved in version 2.1.4 ?? Thanks :) just editing comment.. with 2.1.4 seems like it was solved. I am not testing in production yet, only locally |
Describe the Bug
App crash (android only) when starting or reseting a playtrack, i do not have any logs affiliated to this crash and i only found some indication with flipper debugger
Before i update my sdk version from 30 to 31 and i was on lib version 2.1.2 i didn't get any crash
error given :
Strongly consider using FLAG_IMMUTABLE, only use FLAG_MUTABLE if some functionality depends on the PendingIntent being mutable, e.g. if it needs to be used with inline replies or bubbles.
FATAL EXCEPTION: main
Process: com.appname, PID: 15830
java.lang.RuntimeException: Unable to start service com.guichaguri.trackplayer.service.MusicService@8f5629a with Intent { cmp=com.appname/com.guichaguri.trackplayer.service.MusicService }: java.lang.IllegalArgumentException: com.appname: Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent.
Strongly consider using FLAG_IMMUTABLE, only use FLAG_MUTABLE if some functionality depends on the PendingIntent being mutable, e.g. if it needs to be used with inline replies or bubbles.
at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:5110)
at android.app.ActivityThread.access$2200(ActivityThread.java:310)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2319)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loopOnce(Looper.java:226)
at android.os.Looper.loop(Looper.java:313)
at android.app.ActivityThread.main(ActivityThread.java:8663)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:567)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1135)
Caused by: java.lang.IllegalArgumentException: com.appname: Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent.
Strongly consider using FLAG_IMMUTABLE, only use FLAG_MUTABLE if some functionality depends on the PendingIntent being mutable, e.g. if it needs to be used with inline replies or bubbles.
at android.app.PendingIntent.checkFlags(PendingIntent.java:382)
at android.app.PendingIntent.getBroadcastAsUser(PendingIntent.java:673)
at android.app.PendingIntent.getBroadcast(PendingIntent.java:660)
at android.support.v4.media.session.MediaSessionCompat.(MediaSessionCompat.java:559)
at android.support.v4.media.session.MediaSessionCompat.(MediaSessionCompat.java:530)
at android.support.v4.media.session.MediaSessionCompat.(MediaSessionCompat.java:494)
at com.guichaguri.trackplayer.service.metadata.MetadataManager.(MetadataManager.java:62)
at com.guichaguri.trackplayer.service.MusicManager.(MusicManager.java:68)
at com.guichaguri.trackplayer.service.MusicService.onStartCommand(MusicService.java:108)
at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:5092)
... 9 more
Steps To Reproduce
Use target and compileSdkVersion = 31 and set lib version to 2.1.3
after this call any function from TrackPlayerInstance
Code To Reproduce
Due to some complexe integration in my application (a mix between redux, sagas) i m not able to provide sample of code.
But this occur at any function call of "TrackPlayerInstance"
Environment Info:
System:
OS: macOS 12.3.1
CPU: (8) x64 Apple M1
Memory: 24.67 MB / 16.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 14.19.1 - ~/.nvm/versions/node/v14.19.1/bin/node
Yarn: 1.22.18 - ~/.nvm/versions/node/v14.19.1/bin/yarn
npm: 6.14.16 - ~/.nvm/versions/node/v14.19.1/bin/npm
Watchman: 2022.03.21.00 - /opt/homebrew/bin/watchman
Managers:
CocoaPods: 1.11.3 - /opt/homebrew/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 21.4, iOS 15.4, macOS 12.3, tvOS 15.4, watchOS 8.5
Android SDK: Not Found
IDEs:
Android Studio: 2021.1 AI-211.7628.21.2111.8309675
Xcode: 13.3.1/13E500a - /usr/bin/xcodebuild
Languages:
Java: 11.0.11 - /usr/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: 17.0.2 => 17.0.2
react-native: 0.67.4 => 0.67.4
react-native-macos: Not Found
npmGlobalPackages:
react-native: Not Found
"react-native-track-player": "2.1.3",
Real device - galaxy s10 + - android version 12
How I can Help
Actually i am looking for a solution and it seems to be a recognized error on some others libs with ancient / outdated libraries but i am actually not able to provide a patch
The text was updated successfully, but these errors were encountered: