Xamarin Android Admob Test Ads показывается на устройстве только один раз - PullRequest
0 голосов
/ 10 июля 2020

Я разработал приложение Xamarin Forms, недавно я хотел включить Admob Ads и использовал этот учебник. Версия iOS работает идеально, тогда как версия Android показывает тестовые объявления только один раз на эмуляторе fre sh (отформатированном) и никогда больше не появляется. Когда я создаю новый эмулятор, я вижу рекламу только при первом развертывании, при последующих повторных запусках приложения реклама больше не отображается. У моей учетной записи Admob нет никаких проблем.

Учебник, который я использовал, довольно старый, поэтому мне пришлось добавить этот фрагмент в манифест Android:

        <application android:label="MyApp">
             <meta-data android:name="com.google.android.gms.ads.APPLICATION_ID" android:value="my admob app id ~" />
             ....
        </application>

Журналы из приложения показаны ниже, когда реклама не показывается. Я безуспешно пробовал просматривать net. В чем может быть проблема? Был бы признателен за помощь

07-10 11:55:26.256 D/DynamitePackage( 4834): Instantiating com.google.android.gms.ads.ChimeraAdManagerCreatorImpl
07-10 11:55:26.261 I/Ads     ( 4834): This request is sent from a test device.
07-10 11:55:26.318 I/DynamiteModule( 4834): Considering local module com.google.android.gms.ads.dynamite:0 and remote module com.google.android.gms.ads.dynamite:21001
07-10 11:55:26.318 I/DynamiteModule( 4834): Selected remote version of com.google.android.gms.ads.dynamite, version >= 21001
07-10 11:55:27.069 W/Ads     ( 4834): JS: A cookie associated with a resource at http://doubleclick.net/ was set with `SameSite=None` but without `Secure`. A future release of Chrome will only deliver cookies marked `SameSite=None` if they are also marked `Secure`. You can review cookies in developer tools under Application>Storage>Cookies and see more details at https://www.chromestatus.com/feature/5633521622188032. (https://googleads.g.doubleclick.net/mads/static/mad/sdk/native/production/sdk-core-v40-impl.html:0)[INFO:CONSOLE(0)] "A cookie associated with a resource at http://doubleclick.net/ was set with `SameSite=None` but without `Secure`. A future release of Chrome will only deliver cookies marked `SameSite=None` if they are also marked `Secure`. You can review cookies in developer tools under Application>Storage>Cookies and see more details at https://www.chromestatus.com/feature/5633521622188032.", source: https://googleads.g.doubleclick.net/mads/static/mad/sdk/native/production/sdk-core-v40-impl.html (0)

07-10 11:55:27.069 I/chromium( 4834): [INFO:CONSOLE(0)] "A cookie associated with a resource at http://doubleclick.net/ was set with `SameSite=None` but without `Secure`. A future release of Chrome will only deliver cookies marked `SameSite=None` if they are also marked `Secure`. You can review cookies in developer tools under Application>Storage>Cookies and see more details at https://www.chromestatus.com/feature/5633521622188032.", source: https://googleads.g.doubleclick.net/mads/static/mad/sdk/native/production/sdk-core-v40-impl.html (0)
07-10 11:55:27.707 I/art     ( 4834): Background sticky concurrent mark sweep GC freed 2254(133KB) AllocSpace objects, 0(0B) LOS objects, 1% free, 12MB/12MB, paused 7.259ms total 26.738ms
07-10 11:55:27.789 I/art     ( 4834): Background sticky concurrent mark sweep GC freed 481(35KB) AllocSpace objects, 3(220KB) LOS objects, 0% free, 12MB/12MB, paused 56.403ms total 65.828ms
07-10 11:55:28.177 I/DynamiteModule( 4834): Considering local module com.google.android.gms.ads.dynamite:0 and remote module com.google.android.gms.ads.dynamite:21001
07-10 11:55:28.177 I/DynamiteModule( 4834): Selected remote version of com.google.android.gms.ads.dynamite, version >= 21001
[0:] 
Ad just loaded = (this point is the OnLoaded() listerner event)
07-10 11:55:28.225 E/chromium( 4834): [ERROR:tile_manager.cc(779)] WARNING: tile memory limits exceeded, some content may not draw[ERROR:tile_manager.cc(779)] WARNING: tile memory limits exceeded, some content may not draw

[ERROR:tile_manager.cc(779)] WARNING: tile memory limits exceeded, some content may not draw
07-10 11:55:28.226 E/chromium( 4834): [ERROR:tile_manager.cc(779)] WARNING: tile memory limits exceeded, some content may not draw
[ERROR:tile_manager.cc(779)] WARNING: tile memory limits exceeded, some content may not draw07-10 11:55:28.336 E/chromium( 4834): [ERROR:tile_manager.cc(779)] WARNING: tile memory limits exceeded, some content may not draw
[ERROR:tile_manager.cc(779)] WARNING: tile memory limits exceeded, some content may not draw

07-10 11:55:28.337 E/chromium( 4834): [ERROR:tile_manager.cc(779)] WARNING: tile memory limits exceeded, some content may not draw

другой журнал из отдельного прогона:

07-10 12:02:22.996 D/DynamitePackage( 5094): Instantiating com.google.android.gms.ads.ChimeraAdManagerCreatorImpl
07-10 12:02:23.001 I/Ads     ( 5094): This request is sent from a test device.
07-10 12:02:23.039 I/DynamiteModule( 5094): Considering local module com.google.android.gms.ads.dynamite:0 and remote module com.google.android.gms.ads.dynamite:21001
07-10 12:02:23.039 I/DynamiteModule( 5094): Selected remote version of com.google.android.gms.ads.dynamite, version >= 21001
[INFO:CONSOLE(0)] "A cookie associated with a resource at http://doubleclick.net/ was set with `SameSite=None` but without `Secure`. A future release of Chrome will only deliver cookies marked `SameSite=None` if they are also marked `Secure`. You can review cookies in developer tools under Application>Storage>Cookies and see more details at https://www.chromestatus.com/feature/5633521622188032.", source: https://googleads.g.doubleclick.net/mads/static/mad/sdk/native/production/sdk-core-v40-impl.html (0)
07-10 12:02:23.798 W/Ads     ( 5094): JS: A cookie associated with a resource at http://doubleclick.net/ was set with `SameSite=None` but without `Secure`. A future release of Chrome will only deliver cookies marked `SameSite=None` if they are also marked `Secure`. You can review cookies in developer tools under Application>Storage>Cookies and see more details at https://www.chromestatus.com/feature/5633521622188032. (https://googleads.g.doubleclick.net/mads/static/mad/sdk/native/production/sdk-core-v40-impl.html:0)
07-10 12:02:23.798 I/chromium( 5094): [INFO:CONSOLE(0)] "A cookie associated with a resource at http://doubleclick.net/ was set with `SameSite=None` but without `Secure`. A future release of Chrome will only deliver cookies marked `SameSite=None` if they are also marked `Secure`. You can review cookies in developer tools under Application>Storage>Cookies and see more details at https://www.chromestatus.com/feature/5633521622188032.", source: https://googleads.g.doubleclick.net/mads/static/mad/sdk/native/production/sdk-core-v40-impl.html (0)
07-10 12:02:24.374 I/art     ( 5094): Background sticky concurrent mark sweep GC freed 415(25KB) AllocSpace objects, 0(0B) LOS objects, 1% free, 12MB/12MB, paused 6.902ms total 15.970ms
07-10 12:02:24.959 I/DynamiteModule( 5094): Considering local module com.google.android.gms.ads.dynamite:0 and remote module com.google.android.gms.ads.dynamite:21001
07-10 12:02:24.959 I/DynamiteModule( 5094): Selected remote version of com.google.android.gms.ads.dynamite, version >= 21001
[0:] 
Ad just loaded = (this point is the OnLoaded() listerner event)
[ERROR:tile_manager.cc(779)] WARNING: tile memory limits exceeded, some content may not draw
07-10 12:02:25.023 E/chromium( 5094): [ERROR:tile_manager.cc(779)] WARNING: tile memory limits exceeded, some content may not draw[ERROR:tile_manager.cc(779)] WARNING: tile memory limits exceeded, some content may not draw

07-10 12:02:25.024 E/chromium( 5094): [ERROR:tile_manager.cc(779)] WARNING: tile memory limits exceeded, some content may not draw
[ERROR:tile_manager.cc(779)] WARNING: tile memory limits exceeded, some content may not draw07-10 12:02:25.143 E/chromium( 5094): [ERROR:tile_manager.cc(779)] WARNING: tile memory limits exceeded, some content may not draw

[ERROR:tile_manager.cc(779)] WARNING: tile memory limits exceeded, some content may not draw07-10 12:02:25.144 E/chromium( 5094): [ERROR:tile_manager.cc(779)] WARNING: tile memory limits exceeded, some content may not draw

07-10 12:03:35.001 I/Ads     ( 5094): This request is sent from a test device.
07-10 12:03:35.944 I/DynamiteModule( 5094): Considering local module com.google.android.gms.ads.dynamite:0 and remote module com.google.android.gms.ads.dynamite:21001
07-10 12:03:35.944 I/DynamiteModule( 5094): Selected remote version of com.google.android.gms.ads.dynamite, version >= 21001
07-10 12:03:35.962 W/Ads     ( 5094): #004 The webview is destroyed. Ignoring action.
07-10 12:03:35.965 W/Ads     ( 5094): #004 The webview is destroyed. Ignoring action.
07-10 12:03:35.966 W/Ads     ( 5094): #004 The webview is destroyed. Ignoring action.
[0:] 
Ad just loaded
07-10 12:03:35.992 W/Ads     ( 5094): #004 The webview is destroyed. Ignoring action.
07-10 12:03:35.994 W/Ads     ( 5094): #004 The webview is destroyed. Ignoring action.
07-10 12:03:36.478 E/chromium( 5094): [ERROR:tile_manager.cc(779)] WARNING: tile memory limits exceeded, some content may not draw[ERROR:tile_manager.cc(779)] WARNING: tile memory limits exceeded, some content may not draw

[ERROR:tile_manager.cc(779)] WARNING: tile memory limits exceeded, some content may not draw07-10 12:03:36.480 E/chromium( 5094): [ERROR:tile_manager.cc(779)] WARNING: tile memory limits exceeded, some content may not draw

[ERROR:tile_manager.cc(779)] WARNING: tile memory limits exceeded, some content may not draw07-10 12:03:36.586 E/chromium( 5094): [ERROR:tile_manager.cc(779)] WARNING: tile memory limits exceeded, some content may not draw

07-10 12:03:36.587 E/chromium( 5094): [ERROR:tile_manager.cc(779)] WARNING: tile memory limits exceeded, some content may not draw
[ERROR:tile_manager.cc(779)] WARNING: tile memory limits exceeded, some content may not draw

1 Ответ

1 голос
/ 27 июля 2020

У меня была точно такая же проблема, и она решена прямо сейчас.

Первое: 1- Рекомендую вам использовать этот пакет nuget: https://github.com/marcojak/TestMTAdmob

2 - Объявление показывается только один раз, потому что у вас нет размера. Решаю проблему именно таким кодом:

<admob:MTAdView x:Name="myAds" IsVisible="true" PersonalizedAds="true" AdsId="ca-app-pub-3940256099942544/6300978111" VerticalOptions="EndAndExpand" >
                <admob:MTAdView.HeightRequest>
                    <x:OnIdiom>
                        <x:OnIdiom.Phone>50</x:OnIdiom.Phone>
                        <x:OnIdiom.Tablet>90</x:OnIdiom.Tablet>
                        <x:OnIdiom.Desktop>90</x:OnIdiom.Desktop>
                    </x:OnIdiom>
                </admob:MTAdView.HeightRequest>
            </admob:MTAdView>
...