gpt4 book ai didi

android - AdView 导致 Chrome 崩溃?

转载 作者:塔克拉玛干 更新时间:2023-11-02 20:57:22 31 4
gpt4 key购买 nike

我在我的一个 Activity 中有一个广告。当我进行此 Activity 时,我在模拟器上看到一个对话框,告诉我 Chrome 已停止并且广告没有显示任何内容。

我已经检查了代码本身,我相当确定它符合它应该符合的要求 -

Activity.xml

<com.google.android.gms.ads.AdView
android:id="@+id/adView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
ads:adSize="BANNER"
ads:adUnitId="@string/banner_ad_unit_id"></com.google.android.gms.ads.AdView>

Activity.java

mAdView = (AdView) findViewById(R.id.adView);
AdRequest adRequest = new AdRequest.Builder().build();
mAdView.loadAd(adRequest);

这是logcat -

09-08 09:26:47.779 5777-5777/? D/EGL_emulation: eglCreateContext: 0x872ca5e0: maj 2 min 0 rcv 2
09-08 09:26:47.783 5777-5777/? D/EGL_emulation: eglMakeCurrent: 0x872ca5e0: ver 2 0 (tinfo 0x8379e7b0)
09-08 09:26:47.784 5892-5892/? E/asset: setgid: Operation not permitted
09-08 09:26:47.795 5878-5878/? W/ResourceType: Entry identifier 0xc is larger than entry count 0x8
09-08 09:26:47.795 5878-5878/? D/AndroidRuntime: Shutting down VM
09-08 09:26:47.795 5878-5878/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.android.chrome:sandboxed_process0, PID: 5878
android.content.res.Resources$NotFoundException: Array resource ID #0x7f03000c
at android.content.res.Resources.obtainTypedArray(Resources.java:617)
at android.content.res.Resources.preloadFonts(Resources.java:379)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5815)
at android.app.ActivityThread.-wrap1(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1661)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6541)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
at com.android.internal.os.WebViewZygoteInit.main(WebViewZygoteInit.java:121)
09-08 09:26:47.799 1584-1600/? I/ActivityManager: Showing crash dialog for package com.androidandyuk.autobuddy u0
09-08 09:26:47.825 1357-1357/? D/gralloc_ranchu: gralloc_alloc: Creating ashmem region of size 4096
09-08 09:26:47.826 1584-2280/? I/OpenGLRenderer: Initialized EGL, version 1.4
09-08 09:26:47.826 1584-2280/? D/OpenGLRenderer: Swap behavior 1
09-08 09:26:47.826 1584-2280/? W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
09-08 09:26:47.826 1584-2280/? D/OpenGLRenderer: Swap behavior 0
09-08 09:26:47.842 1357-1357/? D/gralloc_ranchu: gralloc_alloc: Creating ashmem region of size 4096
09-08 09:26:47.842 1584-2280/? D/EGL_emulation: eglCreateContext: 0xa44a4be0: maj 2 min 0 rcv 2
09-08 09:26:47.848 1357-1357/? D/gralloc_ranchu: gralloc_alloc: Creating ashmem region of size 4096
09-08 09:26:47.849 1584-2280/? D/EGL_emulation: eglMakeCurrent: 0xa44a4be0: ver 2 0 (tinfo

在我的 Pixel XL 上,它没有崩溃,但没有显示广告,所以我猜是不是哪里不对?

最佳答案

我们的应用程序发生了同样的崩溃。一个临时解决方案是在 AndroidManifest.xml 中禁用 preloaded_fonts 标记。

关于android - AdView 导致 Chrome 崩溃?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46112081/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com