Ionic 6. Критует приложение после обновления compileSdkVersion. @Capacitor/share
Наш проект написан на Angular 14, Ionic 6, Capacitor 5.
Всё работало корректно, но после обновления compileSdkVersion и targetSdkVersion с 33й до 34й версии - приложение стало выбрасывать ошибку.
Нашли причину в плагине, оказалось, что @capacitor/share не работает с такой версией SDK.
Ошибка с Logcat
FATAL EXCEPTION: main
Process: com.hps.developer, PID: 1992 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.hps.developer/com.hps.developer.MainActivity}: java.lang.SecurityException: com.hps.developer: One of RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED should be specified when a receiver isn't being registered exclusively for system broadcasts at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:4164) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:4322) at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:103) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:139) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:96) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2685) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loopOnce(Looper.java:230) at android.os.Looper.loop(Looper.java:319) at android.app.ActivityThread.main(ActivityThread.java:8919) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:578) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1103) Caused by: java.lang.SecurityException: com.hps.developer: One of RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED should be specified when a receiver isn't being registered exclusively for system broadcasts at android.os.Parcel.createExceptionOrNull(Parcel.java:3069) at android.os.Parcel.createException(Parcel.java:3053) at android.os.Parcel.readException(Parcel.java:3036) at android.os.Parcel.readException(Parcel.java:2978) at android.app.IActivityManager$Stub$Proxy.registerReceiverWithFeature(IActivityManager.java:6157) at android.app.ContextImpl.registerReceiverInternal(ContextImpl.java:1913) at android.app.ContextImpl.registerReceiver(ContextImpl.java:1853) at android.app.ContextImpl.registerReceiver(ContextImpl.java:1841) at android.content.ContextWrapper.registerReceiver(ContextWrapper.java:772) at android.content.ContextWrapper.registerReceiver(ContextWrapper.java:772) at com.capacitorjs.plugins.share.SharePlugin.load(SharePlugin.java:44) at com.getcapacitor.PluginHandle.loadInstance(PluginHandle.java:115) at com.getcapacitor.PluginHandle.load(PluginHandle.java:105) at com.getcapacitor.PluginHandle.(PluginHandle.java:65) at com.getcapacitor.Bridge.registerPlugin(Bridge.java:669) at com.getcapacitor.Bridge.registerAllPlugins(Bridge.java:625) at com.getcapacitor.Bridge.(Bridge.java:223) at com.getcapacitor.Bridge.(Unknown Source:0) at com.getcapacitor.Bridge$Builder.create(Bridge.java:1544) at com.getcapacitor.BridgeActivity.load(BridgeActivity.java:42) at com.getcapacitor.BridgeActivity.onCreate(BridgeActivity.java:36) at android.app.Activity.performCreate(Activity.java:8975) at android.app.Activity.performCreate(Activity.java:8944) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1456) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:4146) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:4322) at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:103) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:139) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:96) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2685) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loopOnce(Looper.java:230) at android.os.Looper.loop(Looper.java:319) at android.app.ActivityThread.main(ActivityThread.java:8919) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:578) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1103)
По ошибке вижу, что что-то с методом плагина load, а именно со строкой
getActivity().registerReceiver(broadcastReceiver, new IntentFilter(Intent.EXTRA_CHOSEN_COMPONENT));
Как пофиксить ошибку или какие есть альтернативы этого плагина?