Skip to content
This repository has been archived by the owner on Sep 19, 2023. It is now read-only.

Работа метрики на Android S+ #85

Open
MihailovJava opened this issue May 19, 2021 · 4 comments
Open

Работа метрики на Android S+ #85

MihailovJava opened this issue May 19, 2021 · 4 comments

Comments

@MihailovJava
Copy link

Версия метрики
implementation 'com.yandex.android:mobmetricalib:3.20.2'

При targetSdkVersion "S"
в рантайме получаю FATAL

Process: com.amocrm.amomessenger:Metrica, PID: 9422
java.lang.RuntimeException: Unable to create service com.yandex.metrica.ConfigurationJobService: java.lang.IllegalArgumentException: com.amocrm.amomessenger: Targeting S+ (version 10000 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:4405)
at android.app.ActivityThread.access$1600(ActivityThread.java:253)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loopOnce(Looper.java:201)
at android.os.Looper.loop(Looper.java:288)
at android.app.ActivityThread.main(ActivityThread.java:7727)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:975)

@ghost
Copy link

ghost commented May 19, 2021 via email

@ghost
Copy link

ghost commented May 21, 2021 via email

@MihailovJava
Copy link
Author

Данная ситуация наблюдается на эмуляторе Android S. По номеру счетчика не понял вопроса, и скриншоты/скринкасты ничего не покажут кроме моего приложения.

@iskandarshabaev
Copy link

iskandarshabaev commented Oct 29, 2021

Pixel3, Android 12.
targetSdk в проекте 31
Столкнулся с такой же проблемой. Процесс с appmetrica в фоне видимо падает, показывается диалоговвое окно что приложение упало и выдаёт в логах ошибку:

2021-10-29 12:59:41.123 28728-28728/? E/AndroidRuntime: FATAL EXCEPTION: main
    Process: ru.yoo.money.myapplication:Metrica, PID: 28728
    java.lang.RuntimeException: Unable to create service com.yandex.metrica.ConfigurationJobService: java.lang.IllegalArgumentException: ru.yoo.money.myapplication: 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:4504)
        at android.app.ActivityThread.access$1700(ActivityThread.java:247)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2076)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loopOnce(Looper.java:201)
        at android.os.Looper.loop(Looper.java:288)
        at android.app.ActivityThread.main(ActivityThread.java:7842)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)
     Caused by: java.lang.IllegalArgumentException: ru.yoo.money.myapplication: 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:375)
        at android.app.PendingIntent.getBroadcastAsUser(PendingIntent.java:645)
        at android.app.PendingIntent.getBroadcast(PendingIntent.java:632)
        at com.yandex.metrica.impl.ob.Yd.<init>(:4)
        at com.yandex.metrica.ConfigurationJobService.onCreate(:7)
        at android.app.ActivityThread.handleCreateService(ActivityThread.java:4491)
        	... 9 more

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants