質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
AdMob

AdMobは、事前に指定した条件に従ってアプリに広告を表示するGoogleのサービス。開発者の向けのサービスで、広告を掲載することにより、収益を得ることが可能です。その他、見た目や雰囲気などアプリに合う広告に変更したり、広告表示の場所を指定することもできます。

Java

Javaは、1995年にサン・マイクロシステムズが開発したプログラミング言語です。表記法はC言語に似ていますが、既存のプログラミング言語の短所を踏まえていちから設計されており、最初からオブジェクト指向性を備えてデザインされています。セキュリティ面が強力であることや、ネットワーク環境での利用に向いていることが特徴です。Javaで作られたソフトウェアは基本的にいかなるプラットフォームでも作動します。

Android

Androidは、Google社が開発したスマートフォンやタブレットなど携帯端末向けのプラットフォームです。 カーネル・ミドルウェア・ユーザーインターフェイス・ウェブブラウザ・電話帳などのアプリケーションやソフトウェアをひとつにまとめて構成。 カーネル・ライブラリ・ランタイムはほとんどがC言語/C++、アプリケーションなどはJavaSEのサブセットとAndroid環境で書かれています。

Android Studio

Android Studioは、 Google社によって開発された、 Androidのネイティブアプリケーション開発に特化した統合開発ツールです。

Google

Googleは、アメリカ合衆国に位置する、インターネット関連のサービスや製品を提供している企業です。検索エンジンからアプリケーションの提供まで、多岐にわたるサービスを提供しています。

Q&A

1回答

2890閲覧

androidでEUのgdprのためのフォームを表示したい

itsu

総合スコア4

AdMob

AdMobは、事前に指定した条件に従ってアプリに広告を表示するGoogleのサービス。開発者の向けのサービスで、広告を掲載することにより、収益を得ることが可能です。その他、見た目や雰囲気などアプリに合う広告に変更したり、広告表示の場所を指定することもできます。

Java

Javaは、1995年にサン・マイクロシステムズが開発したプログラミング言語です。表記法はC言語に似ていますが、既存のプログラミング言語の短所を踏まえていちから設計されており、最初からオブジェクト指向性を備えてデザインされています。セキュリティ面が強力であることや、ネットワーク環境での利用に向いていることが特徴です。Javaで作られたソフトウェアは基本的にいかなるプラットフォームでも作動します。

Android

Androidは、Google社が開発したスマートフォンやタブレットなど携帯端末向けのプラットフォームです。 カーネル・ミドルウェア・ユーザーインターフェイス・ウェブブラウザ・電話帳などのアプリケーションやソフトウェアをひとつにまとめて構成。 カーネル・ライブラリ・ランタイムはほとんどがC言語/C++、アプリケーションなどはJavaSEのサブセットとAndroid環境で書かれています。

Android Studio

Android Studioは、 Google社によって開発された、 Androidのネイティブアプリケーション開発に特化した統合開発ツールです。

Google

Googleは、アメリカ合衆国に位置する、インターネット関連のサービスや製品を提供している企業です。検索エンジンからアプリケーションの提供まで、多岐にわたるサービスを提供しています。

0グッド

0クリップ

投稿2019/10/28 12:11

androidでEUのgdprのためのフォームを表示したい

android(java)でAdMobの広告を使ったアプリを作っています。
Consent SDKを使いEUユーザーに確認のフォームを表示したいのですが次のようなエラーが出てアプリは起動しますがフォームは表示されません。
どのようにすればフォームを表示することができますか?

発生している問題・エラーメッセージ

Logcat

1I/.example.adtes: Not late-enabling -Xcheck:jni (already on) 2W/.example.adtes: Unexpected CPU variant for X86 using defaults: x86 3V/FA: Deferring to Google Analytics for Firebase for event data collection. https://goo.gl/J1sWQy 4W/.example.adtes: Unsupported class loader 5I/DynamiteModule: Considering local module com.google.android.gms.ads.dynamite:0 and remote module com.google.android.gms.ads.dynamite:310 6I/DynamiteModule: Selected remote version of com.google.android.gms.ads.dynamite, version >= 310 7W/DynamiteModule: Dynamite loader version < 2, falling back to loadModule2 8W/.example.adtes: Unsupported class loader 9W/.example.adtes: Skipping duplicate class check due to unsupported classloader 10V/FA: Registered activity lifecycle callback 11I/FirebaseInitProvider: FirebaseApp initialization successful 12V/FA: onActivityCreated 13V/FA: Collection enabled 14V/FA: App package, google app id: com.example.adtest, 1:189935235105:android:a12a736c001ea5ecfe7360 15I/FA: App measurement is starting up, version: 18202 16I/FA: To enable debug logging run: adb shell setprop log.tag.FA VERBOSE 17I/FA: To enable faster debug mode event logging run:adb shell setprop debug.firebase.analytics.app com.example.adtest 18D/FA: Debug-level message logging enabled 19V/FA: Connecting to remote service 20V/FA: Detected application was in foreground 21W/.example.adtes: Accessing hidden method Landroid/view/View;->computeFitSystemWindows(Landroid/graphics/Rect;Landroid/graphics/Rect;)Z (light greylist, reflection) 22W/.example.adtes: Accessing hidden method Landroid/view/ViewGroup;->makeOptionalFitsSystemWindows()V (light greylist, reflection) 23V/FA: Session started, time: 10182399 24D/FA: Setting user property (FE): _sid, 1572262989 25V/FA: Connection attempt already in progress 26I/FA: Tag Manager is not found and thus will not be used 27D/FA: Logging event (FE): session_start(_s), Bundle[{ga_event_origin(_o)=auto, ga_session_id(_sid)=1572262989}] 28V/FA: Connection attempt already in progress 29V/FA: Connection attempt already in progress 30I/WebViewFactory: Loading com.android.chrome version 69.0.3497.100 (code 349710017) 31D/NetworkSecurityConfig: Using Network Security Config from resource network_security_config debugBuild: true 32I/.example.adtes: The ClassLoaderContext is a special shared library. 33I/cr_LibraryLoader: Time to load native libraries: 6 ms (timestamps 2832-2838) 34I/chromium: [INFO:library_loader_hooks.cc(36)] Chromium logging enabled: level = 0, default verbosity = 0 35I/cr_LibraryLoader: Expected native library version number "69.0.3497.100", actual native library version number "69.0.3497.100" 36E/cr_VariationsUtils: Failed reading seed file "/data/user/0/com.example.adtest/app_webview/variations_seed": /data/user/0/com.example.adtest/app_webview/variations_seed (No such file or directory) 37W/cr_ChildProcLH: Create a new ChildConnectionAllocator with package name = com.android.chrome, sandboxed = true 38I/cr_BrowserStartup: Initializing chromium process, singleProcess=false 39W/cr_media: Requires BLUETOOTH permission 40E/Ads: Google Mobile Ads SDK initialization functionality unavailable for this session. Ad requests can be made at any time. 41I/ConsentInformation: This request is sent from a test device. 42I/ConsentInformation: This request is sent from a test device. 43V/FA: Activity resumed, time: 10183065 44D/OpenGLRenderer: Skia GL Pipeline 45I/ConfigStore: android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasWideColorDisplay retrieved: 0 46I/ConfigStore: android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasHDRDisplay retrieved: 0 47D/FA: Logging event (FE): screen_view(_vs), Bundle[{ga_event_origin(_o)=auto, ga_screen_class(_sc)=MainActivity, ga_screen_id(_si)=-9006671786484008695}] 48D/EGL_emulation: eglCreateContext: 0xebdfa420: maj 3 min 0 rcv 3 49D/EGL_emulation: eglMakeCurrent: 0xebdfa420: ver 3 0 (tinfo 0xd7260210) 50V/FA: Connection attempt already in progress 51V/FA: Connection attempt already in progress 52W/VideoCapabilities: Unrecognized profile 4 for video/hevc 53I/OpenGLRenderer: Initialized EGL, version 1.4 54D/OpenGLRenderer: Swap behavior 1 55W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without... 56D/OpenGLRenderer: Swap behavior 0 57I/VideoCapabilities: Unsupported profile 4 for video/mp4v-es 58W/cr_MediaCodecUtil: HW encoder for video/avc is not available on this device. 59I/.example.adtes: Background concurrent copying GC freed 20489(1366KB) AllocSpace objects, 7(136KB) LOS objects, 49% free, 2MB/5MB, paused 525us total 195.847ms 60D/FA: Connected to remote service 61V/FA: Processing queued up service tasks: 6 62W/cr_CrashFileManager: /data/user/0/com.example.adtest/cache/WebView/Crash Reports does not exist or is not a directory 63D/forGDPR: -> onConsentFormErrorCould not parse Event FE preflight response. 64E/TAG: END THIS APP

該当のソースコード

プロジェクトレベルのGradle

Gradle

1buildscript { 2 repositories { 3 google() 4 jcenter() 5 } 6 dependencies { 7 classpath 'com.android.tools.build:gradle:3.5.1' 8 classpath 'com.google.gms:google-services:4.2.0' 9 10 // NOTE: Do not place your application dependencies here; they belong 11 // in the individual module build.gradle files 12 } 13} 14 15allprojects { 16 repositories { 17 google() 18 jcenter() 19 20 maven { 21 url "https://maven.google.com" 22 } 23 } 24} 25 26task clean(type: Delete) { 27 delete rootProject.buildDir 28}

アプリレベルのGradle

Gradle

1apply plugin: 'com.android.application' 2apply plugin: 'com.google.gms.google-services' 3 4android { 5 compileSdkVersion 29 6 buildToolsVersion "29.0.2" 7 defaultConfig { 8 applicationId "com.example.adtest" 9 minSdkVersion 16 10 targetSdkVersion 29 11 versionCode 1 12 versionName "1.0" 13 testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 14 } 15 buildTypes { 16 release { 17 minifyEnabled false 18 proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' 19 } 20 } 21} 22 23dependencies { 24 implementation fileTree(dir: 'libs', include: ['*.jar']) 25 implementation 'androidx.appcompat:appcompat:1.0.2' 26 implementation 'androidx.constraintlayout:constraintlayout:1.1.3' 27 implementation 'com.google.firebase:firebase-ads:17.0.0' 28 testImplementation 'junit:junit:4.12' 29 androidTestImplementation 'androidx.test.ext:junit:1.1.0' 30 androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1' 31 implementation 'com.google.android.ads.consent:consent-library:1.0.7' 32 implementation 'com.google.firebase:firebase-analytics:17.2.0' 33 apply plugin: 'com.google.gms.google-services' 34 implementation 'com.google.android.gms:play-services-ads:18.2.0' 35} 36

https://qiita.com/tokisuzume/items/de41f901ce772c7880c4にendAppを追加してエラーだけ吐くように追加しました。
またパブリッシャーIDなどはしっかりと自分のものに変えてあります。

MainActivity

1 public void endApp(){ 2 Log.e("TAG","END THIS APP"); 3 }

PersonalizedAdManager.javaはhttps://github.com/tokisuzume/PersonalizedAdManager/blob/master/src/PersonalizedAdManager.javaにある内容をそのまま移してあります。

試したこと

https://developers.google.com/admob/android/eu-consent#consent_sdkにしたがってコードの書き直し

エミュレータとAndroidStudioの再インストール及びアップデート

SDKのバージョンによって不具合があると言う書き込みを見つけたのでバージョンを総当りで変更

補足情報

AndroidStudio 3.5.1

参考:https://qiita.com/tokisuzume/items/de41f901ce772c7880c4

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答1

0

私も補足情報にある参考ページを参考に組込、上手く表示されました。
注意点としては、プライバシーポリシーのURLを存在するものに変更するのと、参考ページの「テスト・動作確認」の設定を行って、EU圏に自分が居ることにしてテストを開始することでした。

投稿2019/11/30 14:30

jun74

総合スコア338

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

itsu

2019/12/13 10:20 編集

回答ありがとうございました。 ですが私も参考ページ通りに組み込みましたが、 Could not parse Event FE preflight response. と出て表示されません。 よろしければ使用したconsent-libraryのバージョンを教えて下さい。よろしくおねがいします。
jun74

2019/12/13 10:26

以下です。 あと、関係ないかもですがAndroidxにしてます。 implementation 'com.google.android.ads.consent:consent-library:1.0.6'
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

まだベストアンサーが選ばれていません

会員登録して回答してみよう

アカウントをお持ちの方は

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問