onConsentInfoUpdated или согласияInformation.getConsentStatus () для GDPR не работают в Android Studio - PullRequest
0 голосов
/ 03 апреля 2019

Я пытаюсь внедрить меню согласия для соответствия регулированию GDPR (Общее положение о защите данных).Мне нужно, чтобы пользователь решал получать персонализированную рекламу из Appodeal или нет, когда местоположение устройства находится в пределах Европейского Союза.Поэтому я использую:

    String[] publisherIds = {"pub-XXXXXXXXXXXXXXXX"}; // My admob Publisher ID
    ConsentInformation consentInformation = ConsentInformation.getInstance(this);
    consentInformation.requestConsentInfoUpdate(publisherIds, new ConsentInfoUpdateListener() {
        @Override
        public void onConsentInfoUpdated(ConsentStatus consentStatus) {
            if (ConsentInformation.getInstance(SplashActivity.this).isRequestLocationInEeaOrUnknown()) {
                startActivity(new Intent(SplashActivity.this, GDPRActivity.class));
            } else {
                startMainActivityWithDefaultConsent();
            }
        }

        @Override
        public void onFailedToUpdateConsentInfo(String errorDescription) {
            startMainActivityWithDefaultConsent();
        }
    });

Прослушиватель событий requestConsentInfoUpdate должен определять, когда пользователь меняет статус «Отказ от персонализации рекламы» (путем включенияили отключив его).Однако, когда я запускаю приложение, оно полностью обходит прослушиватель requestConsentInfoUpdate , как будто он может иметь какую-то ошибку.Я использую идентификатор издателя, назначенный мне при регистрации в Google.Это очень странно, потому что код буквально портирован из официального примера Appodeal ...

Чтобы еще больше проверить проблему, если я запускаю команду согласование.getConsentStatus () , я всегдаget: ConsentStatus.UNKNOWN , поэтому переменная не может даже определить текущий статус решения пользователя включить или отключить персонализированную рекламу.

Итак, что происходит?Почему я не могу обнаружить этот простой статус согласия?Что-то не так в коде или здесь чего-то не хватает?Есть идеи?

Чтобы помочь идентифицировать проблему, я включаю содержимое Logcat.Обратите внимание на эту строку: I / ConsentInformation: этот запрос отправляется с тестового устройства. это уместно?

04-02 23:11:55.037 8302-8302/? I/art: Not late-enabling -Xcheck:jni (already on)
04-02 23:11:55.112 8302-8302/education.languagepractice.languagepractice W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg  --debuggable --instruction-set=x86 --instruction-set-features=smp,ssse3,-sse4.1,-sse4.2,-avx,-avx2 --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --instruction-set-variant=x86 --instruction-set-features=default --dex-file=/data/app/education.languagepractice.languagepractice-1/split_lib_dependencies_apk.apk --oat-file=/data/dalvik-cache/x86/data@app@education.languagepractice.languagepractice-1@split_lib_dependencies_apk.apk@classes.dex) because non-0 exit status
04-02 23:11:55.697 8302-8302/education.languagepractice.languagepractice W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg  --debuggable --instruction-set=x86 --instruction-set-features=smp,ssse3,-sse4.1,-sse4.2,-avx,-avx2 --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --instruction-set-variant=x86 --instruction-set-features=default --dex-file=/data/app/education.languagepractice.languagepractice-1/split_lib_slice_0_apk.apk --oat-file=/data/dalvik-cache/x86/data@app@education.languagepractice.languagepractice-1@split_lib_slice_0_apk.apk@classes.dex) because non-0 exit status
04-02 23:11:55.713 8302-8302/education.languagepractice.languagepractice W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg  --debuggable --instruction-set=x86 --instruction-set-features=smp,ssse3,-sse4.1,-sse4.2,-avx,-avx2 --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --instruction-set-variant=x86 --instruction-set-features=default --dex-file=/data/app/education.languagepractice.languagepractice-1/split_lib_slice_1_apk.apk --oat-file=/data/dalvik-cache/x86/data@app@education.languagepractice.languagepractice-1@split_lib_slice_1_apk.apk@classes.dex) because non-0 exit status
04-02 23:11:55.733 8302-8302/education.languagepractice.languagepractice W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg  --debuggable --instruction-set=x86 --instruction-set-features=smp,ssse3,-sse4.1,-sse4.2,-avx,-avx2 --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --instruction-set-variant=x86 --instruction-set-features=default --dex-file=/data/app/education.languagepractice.languagepractice-1/split_lib_slice_2_apk.apk --oat-file=/data/dalvik-cache/x86/data@app@education.languagepractice.languagepractice-1@split_lib_slice_2_apk.apk@classes.dex) because non-0 exit status
04-02 23:11:55.745 8302-8302/education.languagepractice.languagepractice W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg  --debuggable --instruction-set=x86 --instruction-set-features=smp,ssse3,-sse4.1,-sse4.2,-avx,-avx2 --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --instruction-set-variant=x86 --instruction-set-features=default --dex-file=/data/app/education.languagepractice.languagepractice-1/split_lib_slice_3_apk.apk --oat-file=/data/dalvik-cache/x86/data@app@education.languagepractice.languagepractice-1@split_lib_slice_3_apk.apk@classes.dex) because non-0 exit status
04-02 23:11:55.766 8302-8302/education.languagepractice.languagepractice W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg  --debuggable --instruction-set=x86 --instruction-set-features=smp,ssse3,-sse4.1,-sse4.2,-avx,-avx2 --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --instruction-set-variant=x86 --instruction-set-features=default --dex-file=/data/app/education.languagepractice.languagepractice-1/split_lib_slice_4_apk.apk --oat-file=/data/dalvik-cache/x86/data@app@education.languagepractice.languagepractice-1@split_lib_slice_4_apk.apk@classes.dex) because non-0 exit status
04-02 23:11:55.777 8302-8302/education.languagepractice.languagepractice W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg  --debuggable --instruction-set=x86 --instruction-set-features=smp,ssse3,-sse4.1,-sse4.2,-avx,-avx2 --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --instruction-set-variant=x86 --instruction-set-features=default --dex-file=/data/app/education.languagepractice.languagepractice-1/split_lib_slice_5_apk.apk --oat-file=/data/dalvik-cache/x86/data@app@education.languagepractice.languagepractice-1@split_lib_slice_5_apk.apk@classes.dex) because non-0 exit status
04-02 23:11:55.799 8302-8302/education.languagepractice.languagepractice W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg  --debuggable --instruction-set=x86 --instruction-set-features=smp,ssse3,-sse4.1,-sse4.2,-avx,-avx2 --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --instruction-set-variant=x86 --instruction-set-features=default --dex-file=/data/app/education.languagepractice.languagepractice-1/split_lib_slice_6_apk.apk --oat-file=/data/dalvik-cache/x86/data@app@education.languagepractice.languagepractice-1@split_lib_slice_6_apk.apk@classes.dex) because non-0 exit status
04-02 23:11:55.811 8302-8302/education.languagepractice.languagepractice W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg  --debuggable --instruction-set=x86 --instruction-set-features=smp,ssse3,-sse4.1,-sse4.2,-avx,-avx2 --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --instruction-set-variant=x86 --instruction-set-features=default --dex-file=/data/app/education.languagepractice.languagepractice-1/split_lib_slice_7_apk.apk --oat-file=/data/dalvik-cache/x86/data@app@education.languagepractice.languagepractice-1@split_lib_slice_7_apk.apk@classes.dex) because non-0 exit status
04-02 23:11:55.828 8302-8302/education.languagepractice.languagepractice W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg  --debuggable --instruction-set=x86 --instruction-set-features=smp,ssse3,-sse4.1,-sse4.2,-avx,-avx2 --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --instruction-set-variant=x86 --instruction-set-features=default --dex-file=/data/app/education.languagepractice.languagepractice-1/split_lib_slice_8_apk.apk --oat-file=/data/dalvik-cache/x86/data@app@education.languagepractice.languagepractice-1@split_lib_slice_8_apk.apk@classes.dex) because non-0 exit status
04-02 23:11:55.841 8302-8302/education.languagepractice.languagepractice W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg  --debuggable --instruction-set=x86 --instruction-set-features=smp,ssse3,-sse4.1,-sse4.2,-avx,-avx2 --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --instruction-set-variant=x86 --instruction-set-features=default --dex-file=/data/app/education.languagepractice.languagepractice-1/split_lib_slice_9_apk.apk --oat-file=/data/dalvik-cache/x86/data@app@education.languagepractice.languagepractice-1@split_lib_slice_9_apk.apk@classes.dex) because non-0 exit status
04-02 23:11:55.880 8302-8302/education.languagepractice.languagepractice I/InstantRun: starting instant run server: is main process
04-02 23:11:56.001 8302-8345/education.languagepractice.languagepractice W/DynamiteModule: Local module descriptor class for com.google.android.gms.measurement.dynamite not found.
04-02 23:11:56.011 8302-8340/education.languagepractice.languagepractice I/DynamiteModule: Considering local module com.google.android.gms.ads.dynamite:0 and remote module com.google.android.gms.ads.dynamite:310
04-02 23:11:56.011 8302-8340/education.languagepractice.languagepractice I/DynamiteModule: Selected remote version of com.google.android.gms.ads.dynamite, version >= 310
04-02 23:11:56.013 8302-8340/education.languagepractice.languagepractice W/DynamiteModule: Dynamite loader version < 2, falling back to loadModule2
04-02 23:11:56.014 8302-8345/education.languagepractice.languagepractice I/DynamiteModule: Considering local module com.google.android.gms.measurement.dynamite:0 and remote module com.google.android.gms.measurement.dynamite:0
04-02 23:11:56.015 8302-8345/education.languagepractice.languagepractice W/Ads: Data collection startup failed. No data will be collected.
com.google.android.gms.dynamite.DynamiteModule$LoadingException: No acceptable module found. Local version is 0 and remote version is 0.
    at com.google.android.gms.dynamite.DynamiteModule.load(Unknown Source)
    at com.google.android.gms.internal.measurement.zzea.zzg(Unknown Source)
    at com.google.android.gms.internal.measurement.zzeb.zzgd(Unknown Source)
    at com.google.android.gms.internal.measurement.zzea$zzb.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
    at java.lang.Thread.run(Thread.java:818)
04-02 23:11:56.015 8302-8345/education.languagepractice.languagepractice W/Ads: Failed to connect to measurement client.
04-02 23:11:56.035 8302-8340/education.languagepractice.languagepractice W/System: ClassLoader referenced unknown path: /data/data/com.google.android.gms/app_chimera/m/00000000/n/x86
04-02 23:11:56.067 8302-8302/education.languagepractice.languagepractice I/ConsentInformation: This request is sent from a test device.
04-02 23:11:56.079 8302-8347/education.languagepractice.languagepractice D/OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true
04-02 23:11:56.116 8302-8347/education.languagepractice.languagepractice I/OpenGLRenderer: Initialized EGL, version 1.4
04-02 23:11:56.116 8302-8347/education.languagepractice.languagepractice W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
04-02 23:11:56.130 8302-8347/education.languagepractice.languagepractice D/EGL_emulation: eglCreateContext: 0xaf195200: maj 3 min 1 rcv 4
04-02 23:11:56.133 8302-8347/education.languagepractice.languagepractice D/EGL_emulation: eglMakeCurrent: 0xaf195200: ver 3 1 (tinfo 0xa21ff210)
04-02 23:11:56.133 8302-8347/education.languagepractice.languagepractice E/eglCodecCommon: glUtilsParamSize: unknow param 0x000082da
04-02 23:11:56.133 8302-8347/education.languagepractice.languagepractice E/eglCodecCommon: glUtilsParamSize: unknow param 0x00008cdf
04-02 23:11:56.133 8302-8347/education.languagepractice.languagepractice E/eglCodecCommon: glUtilsParamSize: unknow param 0x00008824
04-02 23:11:56.147 8302-8347/education.languagepractice.languagepractice D/EGL_emulation: eglMakeCurrent: 0xaf195200: ver 3 1 (tinfo 0xa21ff210)
...