1***@qq.com
1***@qq.com
  • 发布:2022-04-29 16:36
  • 更新:2022-04-29 16:36
  • 阅读:318

【报Bug】android集成ad组件启动失败。

分类:uni-app

产品分类: uniapp/App

PC开发环境操作系统: Windows

PC开发环境操作系统版本号: windows10

HBuilderX类型: 正式

HBuilderX版本号: 3.4.7

手机系统: Android

手机系统版本号: Android 10

手机厂商: 小米

手机机型: mi10

页面类型: vue

vue版本: vue2

打包方式: 云端

项目创建方式: HBuilderX

操作步骤:

退出应用(完全退出),一般重复一两次就能重现。通过异常信息发现是ad取icon时报错,尝试去掉ad模块重新打包,貌似问题能解决,估计是ad模块读取存储方面有问题,可能跟权限相关因素有关。

预期结果:

应用能正常启动

实际结果:

应用启动失败,后台有异常。

bug描述:

3个月前是没有问题的,这两天打包后(代码没有做改变)就出现了问题,一般第一次启动没有问题,强制退出应用,再启动,一般一两次就会出现异常,应用无法启动,通过android studio的logcat看到启动时在ad模块有报错:
2022-04-29 16:24:39.641 23835-23835/? E/AndroidRuntime: FATAL EXCEPTION: main
java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.String.length()' on a null object reference
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3312)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3461)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2048)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:227)
at android.app.ActivityThread.main(ActivityThread.java:7582)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:953)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.String.length()' on a null object reference
at java.lang.String.startsWith(String.java:1404)
at java.lang.String.startsWith(String.java:1431)
at io.dcloud.common.util.PdrUtil.isDeviceRootDir(SourceFile:1)
at io.dcloud.feature.ad.gdt.AdGdtHandler.getIcon(AdGdtHandler.java:221)
at io.dcloud.feature.ad.gdt.AdGdtSplashView.initView(AdGdtSplashView.java:60)
at io.dcloud.feature.ad.gdt.AdGdtSplashView.<init>(AdGdtSplashView.java:41)
at io.dcloud.feature.ad.gdt.AdGdtHandler.getNativeSplashAd(AdGdtHandler.java:93)
at io.dcloud.feature.ad.gdt.AdGdtHandler.pullAds(AdGdtHandler.java:78)
at io.dcloud.feature.ad.gdt.AdGdtHandler.pullAds(AdGdtHandler.java:276)
at io.dcloud.feature.gg.dcloud.mgr.SplashAd.orderPull(SourceFile:17)
at io.dcloud.feature.gg.dcloud.mgr.SplashAdManager.pullSplash(SourceFile:5)
at io.dcloud.feature.gg.dcloud.AdFeatureImpl.doForFeature(SourceFile:252)
at io.dcloud.feature.gg.AdFeatureImplMgr.doForFeature(SourceFile:5)
at io.dcloud.a.a(SourceFile:18)
at io.dcloud.b.checkAndRequestStoragePermission(SourceFile:28)
at io.dcloud.WebAppActivity.checkAndRequestStoragePermission(SourceFile:1)
at io.dcloud.b$c.a(SourceFile:7)
at io.dcloud.common.ui.b.a(SourceFile:336)
at io.dcloud.b.onCreate(SourceFile:47)
at io.dcloud.WebAppActivity.onCreate(SourceFile:24)
at android.app.Activity.performCreate(Activity.java:7893)
at android.app.Activity.performCreate(Activity.java:7880)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1307)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3287)

2022-04-29 16:36 负责人:DCloud_Android_zl 分享
已邀请:

该问题目前已经被锁定, 无法添加新回复