-
Notifications
You must be signed in to change notification settings - Fork 374
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
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. #1463
Comments
@kdqtech Can you confirm this is correct from your orignal post?
We address Android 12 (targetSdkversion: 31) in the react-native-onesignal 4.0.0 release. @daviluisb Can yo update to the latest react-native-onesignal 4.x.x SDK? It is required to address this issue, see the migration guide to do so: |
Im currently using "react-native-onesignal": "4.0.6" and api 'com.onesignal:OneSignal:4.3.0' on build.gradle |
@jkasten2 First of all Thank you so much for your quick response We were using "react-native-onesignal": "^4.3.11" when the targetSdkVersion was 30. Everything was working then. Since the time we have changed the targetSdkVersion to 31, the one signal library is not working in both cases (version 4.3.11 and version 4.5.0). To validate the issue, I removed onsignal from my project completely and it worked. let me add here my all the steps and code here when i have integrate onesignal first time in my App When i have integrated onesignal first time i have follow below steps The version of "react-native-onesignal": "^4.3.11", In settings.gradle include ':react-native-onesignal' In android/app/build.gradle
In Main Application import com.geektime.rnonesignalandroid.ReactNativeOneSignalPackage; After intigrating everything i started implemention as below
And then i am just using my above oneSignalToken in my some of axious api |
@kdqtech Thanks for the details. I see in your case the crash is coming from To find out what you can try running one of these to see all the gradle dependences for your Android app.
You can then look up the tree to see what is including If the above doesn't help you could just force update dependencies {
// Keep other dependencies you have
implementation('androidx.work:work-runtime:2.7.1')
} However it is better to find the root plugin downgrading so you don't have to keep this work around. |
Well tks alot, with "react-native-onesignal": "^4.5.0", the notification is working, and ive added the implementation('androidx.work:work-runtime:2.7.1') too |
Thanks @jkasten2 it is resolved by adding anyone option from below in android/app/build.gradle
|
this is working fine so closing issue |
I won't recommend force locking like this: configurations.all {
resolutionStrategy { force 'androidx.work:work-runtime:2.7.1' }
} As this could break things in the future for you, if OneSignal or another library requires a newer version. It is safer to do this instead: implementation('androidx.work:work-runtime:2.7.1') { This well tell gradle that you require at least this version, but something can still upgrade it in your app if it is a requirement. |
Why is this issue closed? I am still facing crashes in production with version 4.1.0 and none of the above workarounds solved the issue. |
On S.O Windows 11: "PS D:\SEA\Cofre\A_Alfa\ProjSEA\Flutter\todo> flutter doctor -v [X] Windows Version (Unable to confirm if installed Windows version is 10 or greater) [√] Android toolchain - develop for Android devices (Android SDK version 33.0.2) [X] Chrome - develop for the web (Cannot find Chrome executable at .\Google\Chrome\Application\chrome.exe) [√] Visual Studio - develop for Windows (Visual Studio Community 2022 17.5.1) [√] Android Studio (version 2022.1) [√] VS Code (version 1.76.2) [√] Connected device (3 available) [√] HTTP Host Availability |
Hi @iamrohitagg, this issue was closed by the original poster as they were able to resolve it. If you are on version Hi @SEAFromJahu I don't see any mention of onesignal in your post. The message seems to come from |
jkasten2 |
I have same issue on flutter |
I'm using the react-native-share package to share a component as an image. It works fine on Android versions below 33, but on Android 33, it throws an error: 'Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a Pending Intent.' How can I fix this issue? After updating react-native-share package its says, react-native-share compile SDK Version is not specified. Please add it to build.gradle. What went wrong: A problem occurred evaluating project ':react-native-share'.
On my app/build.gradle file inside dependencies implementation 'androidx.work:work-runtime:2.7.1' Still got same error |
FATAL EXCEPTION: main |
me also have same issue how to solve it for sketchware development java.lang.RuntimeException: Unable to start activity ComponentInfo{ru.ironcodes.islamicwikipedia/ru.ironcodes.islamicwikipedia.MainActivity}: java.lang.IllegalArgumentException: ru.ironcodes.islamicwikipedia: Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent. |
What happened?
Android 12 recently made it mandatory to use FLAG_IMMUTABLE or FLAG_MUTABLE, this makes the application crash as soon as it's opened.
This is happening when I change my targetSdkversion to 31 / 33
Environment
"react": "17.0.2",
"react-native": "0.66.4",
"react-native-onesignal": "4.5.0",
node : v16.18.1
npm : 8.19.2
yarn : 1.22.19
with Previous version compileSdkVersion and targetSdkVersion it was working fine
After changing compileSdkVersion and targetSdkVersion as below it is not working
Steps to reproduce?
What did you expect to happen?
I expected that app should work properly and should not crash
React Native OneSignal SDK version
api 'com.onesignal:OneSignal:4.8.2'
Which platform(s) are affected?
Relevant log output
Code of Conduct
The text was updated successfully, but these errors were encountered: