yandexmobile / react-native-appmetrica

React Native bridge to the AppMetrica on both iOS and Android.
MIT License
52 stars 132 forks source link

Android 12 + ошибка #66

Open plus24-library opened 1 year ago

plus24-library commented 1 year ago

Ошибка на 12+ андроидах, исправьте пожалуйста

устанавливаем приложение на андроид 12+, AppMetrica.reportEvent('My event'); - краш ошибка происходит только 1 раз - после установки приложения, если приложение установлено и поверх установим заново краша не будет

sed by: java.lang.IllegalArgumentException: * для таргетинга S+ (версия 31 и выше) требуется, чтобы при создании PendingIntent был указан один из FLAG_IMMUTABLE или FLAG_MUTABLE. Настоятельно рассмотрите возможность использования FLAG_IMMUTABLE, используйте FLAG_MUTABLE только в том случае, если некоторые функции зависят от изменяемости PendingIntent, например. если его нужно использовать со встроенными ответами или пузырьками.

мой форк который был сделан пару лет назад работает без этой ошибки, но при переходе на старую версию библиотеки получаю ошибку миграции у пользователей которые скачали приложение ранее : android.database.sqlite.SQLiteException: Can't downgrade database from version 87 to 67 at android.database.sqlite.SQLiteOpenHelper.onDowngrade(SQLiteOpenHelper.java:360) at android.database.sqlite.SQLiteOpenHelper.getDatabaseLocked(SQLiteOpenHelper.java:254) at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:163)

plus24-library commented 1 year ago

java.lang.RuntimeException: Unable to create service com.yandex.metrica.ConfigurationJobService: java.lang.IllegalArgumentException: : 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.handleCreateService(ActivityThread.java:4650) at android.app.ActivityThread.access$1800(ActivityThread.java:269) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2151) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loopOnce(Looper.java:211) at android.os.Looper.loop(Looper.java:300) at android.app.ActivityThread.main(ActivityThread.java:8301) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:556) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1043) Caused by: java.lang.IllegalArgumentException: : 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:378) at android.app.PendingIntent.getBroadcastAsUser(PendingIntent.java:648) at android.app.PendingIntent.getBroadcast(PendingIntent.java:635) at com.yandex.metrica.impl.ob.dw.(SourceFile:49) at com.yandex.metrica.ConfigurationJobService.onCreate(SourceFile:75) at android.app.ActivityThread.handleCreateService(ActivityThread.java:4637) ... 9 more

pavelprudnikov commented 1 year ago

i fixed it https://github.com/pavelprudnikov/react-native-appmetrica