gpt4 book ai didi

android - OnePlus One 设备中的位置图崩溃

转载 作者:IT老高 更新时间:2023-10-28 23:24:31 25 4
gpt4 key购买 nike

我的应用程序在 OnePlus 一台设备上崩溃了。以下是设备的详细信息

一加一(A0001)

氰13.1- ZNH2KAS1KN

Android 6.0.1

阿皮接骨木 (5)

而logcat显示错误

Unable to start activity ComponentInfo{com.test/com.test.DetailsActivity}: android.view.InflateException: Binary XML file line #108: Binary XML file line #108: Error inflating class fragment -- Stack Trace -- java.lang.RuntimeException: Unable to start activity ComponentInfo{com.test/com.test.DetailsActivity}: android.view.InflateException: Binary XML file line #108: Binary XML file line #108: Error inflating class fragment at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2450) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2510) at android.app.ActivityThread.-wrap11(ActivityThread.java) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1363) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:148) at android.app.ActivityThread.main(ActivityThread.java:5461) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) Caused by: android.view.InflateException: Binary XML file line #108: Binary XML file line #108: Error inflating class fragment at android.view.LayoutInflater.inflate(LayoutInflater.java:539) at android.view.LayoutInflater.inflate(LayoutInflater.java:423) at android.view.LayoutInflater.inflate(LayoutInflater.java:374) at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppComapatDelegateImplV7.java:256) at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:109) at com.test.DetailsActivity.onCreate(DetailsActivity.java:313) at android.app.Activity.performCreate(Activity.java:6251) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1108) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2403) ... 9 more Caused by: android.view.InflateException: Binary XML file line #108: Error inflating class fragment at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:782) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704) at android.view.LayoutInflater.rInflate(LayoutInflater.java:835) at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798) at android.view.LayoutInflater.rInflate(LayoutInflater.java:838) at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798) at android.view.LayoutInflater.rInflate(LayoutInflater.java:838) at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798) at android.view.LayoutInflater.rInflate(LayoutInflater.java:838) at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798) at android.view.LayoutInflater.rInflate(LayoutInflater.java:838) at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798) at android.view.LayoutInflater.inflate(LayoutInflater.java:515) ... 17 more Caused by: android.content.res.Resources$NotFoundException: File /data/system/theme/icons/com.test_7f030000_0.png from drawable resource ID #0x7f030000 at android.content.res.Resources.openRawResource(Resources.java:1336) at android.content.res.Resources.openRawResource(Resources.java:1306) at maps.V.N.a(Unknown Source) at maps.D.e.a(Unknown Source) at maps.D.p.a(Unknown Source) at maps.ad.ae.a(Unknown Source) at maps.ad.t.a(Unknown Source) at maps.ad.M.a(Unknown Source) at wd.onTransact(:com.google.android.gms.DynamiteModulesB:107) at android.os.Binder.transact(Binder.java:387) at com.google.android.gms.maps.internal.IMapFragmentDelegate$zza$zza.onCreateView(Unknown Source) at com.google.android.gms.maps.SupportMapFragment$zza.onCreateView(Unknown Source) at com.google.android.gms.dynamic.zza$4.zzb(Unknown Source) at com.google.android.gms.dynamic.zza.zza(Unknown Source) at com.google.android.gms.dynamic.zza.onCreateView(Unknown Source) at com.google.android.gms.maps.SupportMapFragment.onCreateView(Unknown Source) at com.test.fragments.CustomMapFragment.onCreateView(CustomMapFragment.java:39) at android.support.v4.app.Fragment.performCreateView(Fragment.java:1962) at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1036) at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1226) at android.support.v4.app.FragmentManagerImpl.addFragment(FragmentManager.java:1328) at android.support.v4.app.FragmentManagerImpl.onCreateView(FragmentManager.java:2284) at android.support.v4.app.FragmentController.onCreateView(FragmentController.java:111) at android.support.v4.app.FragmentActivity.dispatchFragmentsOnCreateView(FragmentActivity.java:314) at android.support.v4.app.BaseFragmentActivityHoneycomb.onCreateView(BaseFragmentActivityHoneycomb.java:31) at android.support.v4.app.FragmentActivity.onCreateView(FragmentActivity.java:79) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:754) ... 29 more Caused by: java.io.FileNotFoundException: /data/system/theme/icons/com.test_7f030000_0.png at android.content.res.AssetManager.openNonAssetNative(Native Method) at android.content.res.AssetManager.openNonAsset(AssetManager.java:423) at android.content.res.Resources.openRawResource(Resources.java:1333) ... 55 more

我已经在布局文件中添加了 map fragment

  <fragment
android:id="@+id/fragment_map"
android:name="com.test.fragments.CustomMapFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:tag="fragment_map" />


public class CustomMapFragment extends SupportMapFragment {

private OnTouchListener mListener;

@TargetApi(Build.VERSION_CODES.JELLY_BEAN)
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {

View layout = super.onCreateView(inflater, container, savedInstanceState);
TouchableWrapper frameLayout = new TouchableWrapper(getActivity());
((ViewGroup) layout).addView(frameLayout,
new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
return layout;
}

public void setListener(OnTouchListener listener) {
mListener = listener;
}

public interface OnTouchListener {
void onTouch();
}

public class TouchableWrapper extends FrameLayout {

public TouchableWrapper(Context context) {
super(context);
}

@Override
public boolean dispatchTouchEvent(MotionEvent event) {
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
mListener.onTouch();
break;
case MotionEvent.ACTION_UP:
mListener.onTouch();
break;
}
return super.dispatchTouchEvent(event);
}
}
}

如果有人遇到同样的问题并找到解决此崩溃的任何解决方案,请告诉我。

最佳答案

这对我有用,将所有应用程序启动器图标从 mipmap 文件夹移动到相应的可绘制文件夹。删除了 mipmap 文件夹。更改 AndroidManifest.xmlandroid:icon="@mipmap/ic_launcher"android:icon="@drawable/ic_launcher"

注意:Google 不建议这样做,这是一种临时解决方法

关于android - OnePlus One 设备中的位置图崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40109898/

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