java - Cannot add a map in android studio without crashing -
i've tried million things fix map can't life of me. in app, have button open map locally , crashes every time press it.
activity_map.xml:
<fragment xmlns:android="http://schemas.android.com/apk/res/android" xmlns:map="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/map" android:name="com.google.android.gms.maps.supportmapfragment" android:layout_width="match_parent" android:layout_height="match_parent" tools:context="com.jayster.jayster_app.mapsactivity" />
mapsactivity.java:
package com.jayster.jayster_app; import android.support.v4.app.fragmentactivity; import android.os.bundle; import com.google.android.gms.maps.cameraupdatefactory; import com.google.android.gms.maps.googlemap; import com.google.android.gms.maps.onmapreadycallback; import com.google.android.gms.maps.supportmapfragment; import com.google.android.gms.maps.model.latlng; import com.google.android.gms.maps.model.markeroptions; import com.jayster.proto_jayster.r; public class mapsactivity extends fragmentactivity implements onmapreadycallback { private googlemap mmap; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_map); // obtain supportmapfragment , notified when map ready used. supportmapfragment mapfragment = (supportmapfragment) getsupportfragmentmanager() .findfragmentbyid(r.id.map); mapfragment.getmapasync(this); } @override public void onmapready(googlemap googlemap) { mmap = googlemap; } }
this error catlog
:
07-25 19:06:03.427 12487-12487/com.jayster.proto_jayster w/system: classloader referenced unknown path: /data/app/com.jayster.proto_jayster-2/lib/x86 07-25 19:06:03.463 12487-12487/com.jayster.proto_jayster i/firebaseinitprovider: firebaseapp initialization unsuccessful 07-25 19:06:03.464 12487-12487/com.jayster.proto_jayster i/instantrun: starting instant run server: main process 07-25 19:06:03.863 12487-12487/com.jayster.proto_jayster e/jayster: bluetooth le not supported 07-25 19:06:03.863 12487-12487/com.jayster.proto_jayster e/bluetoothadapter: bluetooth binder null 07-25 19:06:06.897 12487-12487/com.jayster.proto_jayster d/gralloc_ranchu: emulator without host-side gpu emulation detected. loading gralloc.default.so /vendor/lib/hw/gralloc.default.so... 07-25 19:06:06.897 12487-12487/com.jayster.proto_jayster d/gralloc_ranchu: gralloc.default.so not found in /vendor. trying /system/lib/hw/gralloc.default.so... 07-25 19:06:06.941 12487-12564/com.jayster.proto_jayster i/openglrenderer: initialized egl, version 1.4 07-25 19:06:06.941 12487-12564/com.jayster.proto_jayster d/openglrenderer: swap behavior 1 07-25 19:06:06.933 12487-12487/com.jayster.proto_jayster w/renderthread: type=1400 audit(0.0:215): avc: denied { search } name="graphics" dev="tmpfs" ino=4274 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:graphics_device:s0 tclass=dir permissive=0 07-25 19:06:07.871 12487-12487/com.jayster.proto_jayster i/choreographer: skipped 53 frames! application may doing work on main thread. 07-25 19:06:20.070 12487-12487/com.jayster.proto_jayster i/zzbx: making creator dynamically 07-25 19:06:20.087 12487-12487/com.jayster.proto_jayster w/system: classloader referenced unknown path: /system/priv-app/prebuiltgmscore/lib/x86 07-25 19:06:20.099 12487-12487/com.jayster.proto_jayster w/system: classloader referenced unknown path: 07-25 19:06:20.099 12487-12487/com.jayster.proto_jayster w/system: classloader referenced unknown path: /system/priv-app/prebuiltgmscore/lib/x86 07-25 19:06:20.136 12487-12487/com.jayster.proto_jayster i/google maps android api: google play services client version: 11020000 07-25 19:06:20.139 12487-12487/com.jayster.proto_jayster i/google maps android api: google play services package version: 11055470 07-25 19:06:20.196 12487-12487/com.jayster.proto_jayster d/androidruntime: shutting down vm 07-25 19:06:20.197 12487-12487/com.jayster.proto_jayster e/androidruntime: fatal exception: main process: com.jayster.proto_jayster, pid: 12487 java.lang.runtimeexception: unable start activity componentinfo{com.jayster.proto_jayster/com.jayster.jayster_app.mapsactivity}: android.view.inflateexception: binary xml file line #1: binary xml file line #1: error inflating class fragment @ android.app.activitythread.performlaunchactivity(activitythread.java:2646) @ android.app.activitythread.handlelaunchactivity(activitythread.java:2707) @ android.app.activitythread.-wrap12(activitythread.java) @ android.app.activitythread$h.handlemessage(activitythread.java:1460) @ android.os.handler.dispatchmessage(handler.java:102) @ android.os.looper.loop(looper.java:154) @ android.app.activitythread.main(activitythread.java:6077) @ java.lang.reflect.method.invoke(native method) @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:866) @ com.android.internal.os.zygoteinit.main(zygoteinit.java:756) caused by: android.view.inflateexception: binary xml file line #1: binary xml file line #1: error inflating class fragment caused by: android.view.inflateexception: binary xml file line #1: error inflating class fragment caused by: java.lang.runtimeexception: api key can specified once. recommended use meta-data tag name: com.google.android.geo.api_key in <application> element of androidmanifest.xml @ com.google.maps.api.android.lib6.drd.q.b(:com.google.android.gms.dynamitemodulesb:37) @ com.google.maps.api.android.lib6.auth.e.a(:com.google.android.gms.dynamitemodulesb:12) @ com.google.android.gms.maps.internal.creatorimpl.a(:com.google.android.gms.dynamitemodulesb:121) @ com.google.android.gms.maps.internal.creatorimpl.newmapfragmentdelegate(:com.google.android.gms.dynamitemodulesb:25) @ com.google.android.gms.maps.internal.g.ontransact(:com.google.android.gms.dynamitemodulesb:35) @ android.os.binder.transact(binder.java:499) @ uni.newmapfragmentdelegate(:com.google.android.gms:1) @ com.google.android.gms.maps.internal.creatorimpl.newmapfragmentdelegate(:com.google.android.gms:1) @ unh.ontransact(:com.google.android.gms:13) @ android.os.binder.transact(binder.java:499) @ com.google.android.gms.internal.zzed.zza(unknown source) @ com.google.android.gms.maps.internal.zzf.zzh(unknown source) @ com.google.android.gms.maps.supportmapfragment$zzb.zzwg(unknown source) @ com.google.android.gms.maps.supportmapfragment$zzb.zza(unknown source) @ com.google.android.gms.dynamic.zza.zza(unknown source) @ com.google.android.gms.dynamic.zza.oninflate(unknown source) @ com.google.android.gms.maps.supportmapfragment.oninflate(unknown source) @ android.support.v4.app.fragment.oninflate(fragment.java:1184) @ android.support.v4.app.fragmentmanagerimpl.oncreateview(fragmentmanager.java:3439) @ android.support.v4.app.fragmentcontroller.oncreateview(fragmentcontroller.java:120) @ android.support.v4.app.fragmentactivity.dispatchfragmentsoncreateview(fragmentactivity.java:378) @ android.support.v4.app.basefragmentactivityhoneycomb.oncreateview(basefragmentactivityhoneycomb.java:33) @ android.support.v4.app.fragmentactivity.oncreateview(fragmentactivity.java:79) @ android.view.layoutinflater.createviewfromtag(layoutinflater.java:777) @ android.view.layoutinflater.createviewfromtag(layoutinflater.java:727) @ android.view.layoutinflater.inflate(layoutinflater.java:495) @ android.view.layoutinflater.inflate(layoutinflater.java:426) @ android.view.layoutinflater.inflate(layoutinflater.java:377) @ com.android.internal.policy.phonewindow.setcontentview(phonewindow.java:414) @ android.app.activity.setcontentview(activity.java:2414) @ com.jayster.jayster_app.mapsactivity.oncreate(mapsactivity.java:19) @ android.app.activity.performcreate(activity.java:6662) @ android.app.instrumentation.callactivityoncreate(instrumentation.java:1118) @ android.app.activitythread.performlaunchactivity(activitythread.java:2599) 07-25 19:06:20.197 12487-12487/com.jayster.proto_jayster e/androidruntime: @ android.app.activitythread.handlelaunchactivity(activitythread.java:2707) @ android.app.activitythread.-wrap12(activitythread.java) @ android.app.activitythread$h.handlemessage(activitythread.java:1460) @ android.os.handler.dispatchmessage(handler.java:102) @ android.os.looper.loop(looper.java:154) @ android.app.activitythread.main(activitythread.java:6077) @ java.lang.reflect.method.invoke(native method) @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:866) @ com.android.internal.os.zygoteinit.main(zygoteinit.java:756) 07-25 19:10:33.736 12487-12494/com.jayster.proto_jayster w/art: suspending threads took: 9.787ms
Comments
Post a Comment