gpt4 book ai didi

空对象引用上的 android.content.res.Resources.getConfiguration()'

转载 作者:行者123 更新时间:2023-12-03 16:18:56 26 4
gpt4 key购买 nike

我有一个服务,当用户点击这个 chatHead 我弹出一个 MapView (v2) 时,它就像一个带有聊天头的叠加层(比如 facebook messenger)

它适用于我的大多数用户,但在错误报告中,所有小米小米红米 Note 3 用户都有同样的崩溃

java.lang.RuntimeException: Unable to create service com.package.MyService: java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.res.Configuration android.content.res.Resources.getConfiguration()' on a null object reference at android.app.ActivityThread.handleCreateService(ActivityThread.java) at android.app.ActivityThread.access$1800(ActivityThread.java) at android.app.ActivityThread$H.handleMessage(ActivityThread.java) at android.os.Handler.dispatchMessage(Handler.java) at android.os.Looper.loop(Looper.java) at android.app.ActivityThread.main(ActivityThread.java) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java) Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.res.Configuration android.content.res.Resources.getConfiguration()' on a null object reference at android.view.SurfaceView.init(SurfaceView.java) at android.view.SurfaceView.(SurfaceView.java) at maps.V.x.(Unknown Source) at maps.V.v.(Unknown Source) at maps.D.v.(Unknown Source) at maps.D.v.a(Unknown Source) at maps.ad.ae.a(Unknown Source) at maps.ad.u.a(Unknown Source) at maps.ad.R.a(Unknown Source) at wc.onTransact(:com.google.android.gms.DynamiteModulesB:66) at android.os.Binder.transact(Binder.java) at com.google.android.gms.maps.a.e$a$a.a(Unknown Source) at com.google.android.gms.maps.MapView$a.a(Unknown Source) at com.google.android.gms.dynamic.e.a(Unknown Source) at com.google.android.gms.dynamic.c.a(Unknown Source) at com.google.android.gms.maps.MapView$b.g(Unknown Source) at com.google.android.gms.maps.MapView$b.a(Unknown Source) at com.google.android.gms.dynamic.b.a(Unknown Source) at com.google.android.gms.dynamic.b.a(Unknown Source) at com.google.android.gms.maps.MapView.a(Unknown Source)

似乎失败的代码在这里

    this.setTheme(R.style.AppTheme);
this.myView = LayoutInflater.from(this).inflate(R.layout.my_map, null);
this.mapView = (MapView) myView.findViewById(R.id.map);
this.mapView.onCreate(null);
this.mapView.getMapAsync(this);

抛出这个错误的行是

this.mapView.getMapAsync(this);

有人对此有解决方案吗?

最佳答案

尝试在 list 中打开硬件加速

android:hardwareAccelerated="true"

对我有用来源:https://code.google.com/p/gmaps-api-issues/issues/detail?id=9071

关于空对象引用上的 android.content.res.Resources.getConfiguration()',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39278242/

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