public class MapScreen extends FragmentActivity implements LocationListener,Googleapiclient.ConnectionCallbacks,Googleapiclient.OnConnectionFailedListener { @OverrIDe protected voID onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentVIEw(R.layout.map_screen); .... SupportMapFragment fm = (SupportMapFragment) getSupportFragmentManager() .findFragmentByID(R.ID.map); GoogleMap = fm.getMap();} and my xml has fragment using SupportMapFragment as well. map_screen.xml is like : <?xml version="1.0" enCoding="utf-8"?> <relativeLayout xmlns:androID="http://schemas.androID.com/apk/res/androID" androID:layout_wIDth="match_parent" androID:layout_height="match_parent" androID:orIEntation="vertical" > <fragment androID:ID="@+ID/map" androID:name="com.Google.androID.gms.maps.SupportMapFragment" androID:layout_wIDth="fill_parent" androID:layout_height="fill_parent" androID:layout_alignParentleft="true" androID:layout_alignParenttop="true" /> <ImageVIEw androID:ID="@+ID/startActivitybutton" androID:layout_wIDth="wrap_content" androID:layout_height="wrap_content" androID:layout_alignParentBottom="true" androID:layout_centerHorizontal="true" androID:layout_marginleft="50dp" androID:layout_marginRight="50dp" androID:layout_marginBottom="44dp" androID:background="@drawable/end_meetup_btn" /> </relativeLayout>
我无法找到相同的问题在Marshmallow中遇到崩溃:“二进制XML文件行#7:错误膨胀类片段”请建议!
试图找到“引起:java.lang.NullPointerException:尝试在空对象引用上调用虚方法’boolean java.io.file.mkdir()’”.
12-18 13:40:14.425: E/AndroIDRuntime(8026): FATAL EXCEPTION: main 12-18 13:40:14.425: E/AndroIDRuntime(8026): Process: com.kindlebit.urban_exchange,PID: 8026 12-18 13:40:14.425: E/AndroIDRuntime(8026): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.kindlebit.urban_exchange/com.kindlebit.urban_exchange.MapScreen}: androID.vIEw.InflateException: Binary XML file line #7: Binary XML file line #7: Error inflating class fragment 12-18 13:40:14.425: E/AndroIDRuntime(8026): at androID.app.ActivityThread.performlaunchActivity(ActivityThread.java:2416) 12-18 13:40:14.425: E/AndroIDRuntime(8026): at androID.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476) 12-18 13:40:14.425: E/AndroIDRuntime(8026): at androID.app.ActivityThread.-wrap11(ActivityThread.java) 12-18 13:40:14.425: E/AndroIDRuntime(8026): at androID.app.ActivityThread$H.handleMessage(ActivityThread.java:1344) 12-18 13:40:14.425: E/AndroIDRuntime(8026): at androID.os.Handler.dispatchMessage(Handler.java:102) 12-18 13:40:14.425: E/AndroIDRuntime(8026): at androID.os.Looper.loop(Looper.java:148) 12-18 13:40:14.425: E/AndroIDRuntime(8026): at androID.app.ActivityThread.main(ActivityThread.java:5417) 12-18 13:40:14.425: E/AndroIDRuntime(8026): at java.lang.reflect.Method.invoke(Native Method) 12-18 13:40:14.425: E/AndroIDRuntime(8026): at com.androID.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) 12-18 13:40:14.425: E/AndroIDRuntime(8026): at com.androID.internal.os.ZygoteInit.main(ZygoteInit.java:616) 12-18 13:40:14.425: E/AndroIDRuntime(8026): Caused by: androID.vIEw.InflateException: Binary XML file line #7: Binary XML file line #7: Error inflating class fragment 12-18 13:40:14.425: E/AndroIDRuntime(8026): at androID.vIEw.LayoutInflater.inflate(LayoutInflater.java:539) 12-18 13:40:14.425: E/AndroIDRuntime(8026): at androID.vIEw.LayoutInflater.inflate(LayoutInflater.java:423) 12-18 13:40:14.425: E/AndroIDRuntime(8026): at androID.vIEw.LayoutInflater.inflate(LayoutInflater.java:374) 12-18 13:40:14.425: E/AndroIDRuntime(8026): at com.androID.internal.policy.PhoneWindow.setContentVIEw(PhoneWindow.java:393) 12-18 13:40:14.425: E/AndroIDRuntime(8026): at androID.app.Activity.setContentVIEw(Activity.java:2166) 12-18 13:40:14.425: E/AndroIDRuntime(8026): at com.kindlebit.urban_exchange.MapScreen.onCreate(MapScreen.java:109) 12-18 13:40:14.425: E/AndroIDRuntime(8026): at androID.app.Activity.performCreate(Activity.java:6237) 12-18 13:40:14.425: E/AndroIDRuntime(8026): at androID.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107) 12-18 13:40:14.425: E/AndroIDRuntime(8026): at androID.app.ActivityThread.performlaunchActivity(ActivityThread.java:2369) 12-18 13:40:14.425: E/AndroIDRuntime(8026): ... 9 more 12-18 13:40:14.425: E/AndroIDRuntime(8026): Caused by: androID.vIEw.InflateException: Binary XML file line #7: Error inflating class fragment 12-18 13:40:14.425: E/AndroIDRuntime(8026): at androID.vIEw.LayoutInflater.createVIEwFromTag(LayoutInflater.java:782) 12-18 13:40:14.425: E/AndroIDRuntime(8026): at androID.vIEw.LayoutInflater.createVIEwFromTag(LayoutInflater.java:704) 12-18 13:40:14.425: E/AndroIDRuntime(8026): at androID.vIEw.LayoutInflater.rInflate(LayoutInflater.java:835) 12-18 13:40:14.425: E/AndroIDRuntime(8026): at androID.vIEw.LayoutInflater.rInflateChildren(LayoutInflater.java:798) 12-18 13:40:14.425: E/AndroIDRuntime(8026): at androID.vIEw.LayoutInflater.inflate(LayoutInflater.java:515) 12-18 13:40:14.425: E/AndroIDRuntime(8026): ... 17 more 12-18 13:40:14.425: E/AndroIDRuntime(8026): Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.io.file.mkdir()' on a null object reference 12-18 13:40:14.425: E/AndroIDRuntime(8026): at com.Google.maps.API.androID.lib6.gmm6.m.ad.a(UnkNown Source) 12-18 13:40:14.425: E/AndroIDRuntime(8026): at com.Google.maps.API.androID.lib6.gmm6.c.h.a(UnkNown Source) 12-18 13:40:14.425: E/AndroIDRuntime(8026): at com.Google.maps.API.androID.lib6.gmm6.c.y.a(UnkNown Source) 12-18 13:40:14.425: E/AndroIDRuntime(8026): at com.Google.maps.API.androID.lib6.e.bd.a(UnkNown Source) 12-18 13:40:14.425: E/AndroIDRuntime(8026): at com.Google.maps.API.androID.lib6.e.ev.a(UnkNown Source) 12-18 13:40:14.425: E/AndroIDRuntime(8026): at com.Google.maps.API.androID.lib6.e.z.a(UnkNown Source) 12-18 13:40:14.425: E/AndroIDRuntime(8026): at com.Google.maps.API.androID.lib6.e.y.a(UnkNown Source) 12-18 13:40:14.425: E/AndroIDRuntime(8026): at com.Google.androID.gms.maps.internal.u.onTransact(Sourcefile:107) 12-18 13:40:14.425: E/AndroIDRuntime(8026): at androID.os.Binder.transact(Binder.java:387) 12-18 13:40:14.425: E/AndroIDRuntime(8026): at com.Google.androID.gms.maps.internal.IMapFragmentDelegate$zza$zza.onCreateVIEw(UnkNown Source) 12-18 13:40:14.425: E/AndroIDRuntime(8026): at com.Google.androID.gms.maps.SupportMapFragment$zza.onCreateVIEw(UnkNown Source) 12-18 13:40:14.425: E/AndroIDRuntime(8026): at com.Google.androID.gms.dynamic.zza.zzb(UnkNown Source) 12-18 13:40:14.425: E/AndroIDRuntime(8026): at com.Google.androID.gms.dynamic.zza.zza(UnkNown Source) 12-18 13:40:14.425: E/AndroIDRuntime(8026): at com.Google.androID.gms.dynamic.zza.onCreateVIEw(UnkNown Source) 12-18 13:40:14.425: E/AndroIDRuntime(8026): at com.Google.androID.gms.maps.SupportMapFragment.onCreateVIEw(UnkNown Source) 12-18 13:40:14.425: E/AndroIDRuntime(8026): at androID.support.v4.app.Fragment.performCreateVIEw(Fragment.java:1962) 12-18 13:40:14.425: E/AndroIDRuntime(8026): at androID.support.v4.app.FragmentManagerImpl.movetoState(FragmentManager.java:995) 12-18 13:40:14.425: E/AndroIDRuntime(8026): at androID.support.v4.app.FragmentManagerImpl.movetoState(FragmentManager.java:1185) 12-18 13:40:14.425: E/AndroIDRuntime(8026): at androID.support.v4.app.FragmentManagerImpl.addFragment(FragmentManager.java:1287) 12-18 13:40:14.425: E/AndroIDRuntime(8026): at androID.support.v4.app.FragmentManagerImpl.onCreateVIEw(FragmentManager.java:2243) 12-18 13:40:14.425: E/AndroIDRuntime(8026): at androID.support.v4.app.FragmentController.onCreateVIEw(FragmentController.java:111) 12-18 13:40:14.425: E/AndroIDRuntime(8026): at androID.support.v4.app.FragmentActivity.dispatchFragmentsOnCreateVIEw(FragmentActivity.java:278) 12-18 13:40:14.425: E/AndroIDRuntime(8026): at androID.support.v4.app.BaseFragmentActivityHoneycomb.onCreateVIEw(BaseFragmentActivityHoneycomb.java:31)解决方法 问题出在“Micro-max AndroID one mobile”,这是6.0 Marshmallow.
此设备没有足够的内部或外部存储空间.即使没有SD卡.
在听完George的回答之后:
NullPointerException from Google maps
我安装了存储卡,现在崩溃不来了.
所以我发现问题是更新了Google Play服务,这些服务需要我的设备中不够的Space(更新后的Google照片).
并且还有一个错误行显示“由以下引起:java.lang.NullPointerException:尝试在空对象引用上调用虚方法’boolean java.io.file.mkdir()’”
我决定在安装SD卡后检查.它奏效了
总结以上是内存溢出为你收集整理的android – 地图的棉花糖碎片活动中的崩溃全部内容,希望文章能够帮你解决android – 地图的棉花糖碎片活动中的崩溃所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)