wix / react-native-notifications

React Native Notifications
MIT License
3.23k stars 763 forks source link

Is this protect EOL, not compatible with Android API 31+ #890

Closed russmenum closed 1 year ago

russmenum commented 2 years ago

As of this month, all new Android apps must target API 31

compileSdkVersion = 31
targetSdkVersion = 31

As of Nov 2022, All Android Apps must (SEE HERE)

This change requires the android:exported="true" or android:exported="false" to be defined. If it is not the app can not be installed.

When you set API 31 you get an ERROR attributed to this library.

Installation did not succeed.
The application could not be installed: INSTALL_PARSE_FAILED_MANIFEST_MALFORMED

List of apks:
[0] '/Users/[USERNAME]/github/[APP]/android/app/build/outputs/apk/release/app-release.apk'
Installation failed due to: 'Failed to commit install session 1735472622 with command cmd package install-commit 1735472622. Error: INSTALL_PARSE_FAILED_MANIFEST_MALFORMED: Failed parse during installPackageLI: /data/app/vmdl1735472622.tmp/base.apk (at Binary XML file line #148): com.wix.reactnativenotifications.fcm.FcmInstanceIdListenerService: Targeting S+ (version 31 and above) requires that an explicit value for android:exported be defined when intent filters are present'
Retry
Failed to launch an application on all devices

I am digging into the code, but not seeing what lines need to change for this library, sorry. I just know if there is not a patch for this in the next 60 days no one can use this for an RN Android App anymore

claudiozam commented 2 years ago

@russmenum try this:

https://rnfirebase.io/messaging/usage https://notifee.app/

russmenum commented 2 years ago

@claudiozam So this is EOL and your suggestion is to move to that new library that went free you reference? Not even using fire base right now, really just the local notifications

claudiozam commented 2 years ago

@russmenum i don't see another option (production ready) for the moment. Do you have one?

russmenum commented 2 years ago

@claudiozam I guess I need to start looking, we only have a few months. My hope was there was an update or patch pending for this project

RosenTomov commented 2 years ago

We're facing a similar issue and the requirement to target SDK version 31. Is this project really dead @wixmobile?

russmenum commented 2 years ago

@RosenTomov does not look like we are getting any news on this this week, and with API 33 changes coming soon that is also a concern.

Alternatives if this is EOL welcome. Have not had time to look at the one already posted, but at glance it looked like a paid service. Maybe forking this project is also an option, if I can figure out what the heck needs to be updated

max-usenko-aura commented 2 years ago

Add <service android:name="com.wix.reactnativenotifications.xxxx" android:exported="true" /> in the /main/AndroidManifest.xml you can do that for any dependency which doesn't have explicit exported flag

russmenum commented 2 years ago

@max-usenko-aura if I add

<service android:name="com.wix.reactnativenotifications.fcm.FcmInstanceIdListenerService" android:exported="true" />

The error goes away, but the resulting "launched" app just crashes at load on the API 31 simulator. Will run fine on API 30 simulator. No error I can see in debug launch, any idea? Not even sure it is this library, but something is not happy

christiandietz80 commented 2 years ago

Hello everyone,

not sure if this helps; in our project, we have these settings (in file build.gradle), and everything works fine (updating our existing app, not publishing a new one):

buildscript { ext { buildToolsVersion = "30.0.2" minSdkVersion = 21 compileSdkVersion = 31 targetSdkVersion = 31 ndkVersion = "20.1.5948944" androidXAnnotation = "1.2.0" androidXBrowser = "1.4.0" } repositories { google() jcenter() } dependencies { classpath('com.android.tools.build:gradle:4.2.0') classpath('com.google.gms:google-services:4.3.10') } }

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

russmenum commented 1 year ago

Hello everyone,

not sure if this helps; in our project, we have these settings (in file build.gradle), and everything works fine (updating our existing app, not publishing a new one):

buildscript { ext { buildToolsVersion = "30.0.2" minSdkVersion = 21 compileSdkVersion = 31 targetSdkVersion = 31 ndkVersion = "20.1.5948944" androidXAnnotation = "1.2.0" androidXBrowser = "1.4.0" } repositories { google() jcenter() } dependencies { classpath('com.android.tools.build:gradle:4.2.0') classpath('com.google.gms:google-services:4.3.10') } }

Is that running on an API 31 simulator?

stale[bot] commented 1 year ago

The issue has been closed for inactivity.