Android - ArcGIS for MapView in Android Studio -
i'm trying use arcgis displaying map in application. i'm getting following exception.
04-21 09:47:39.140 12766-12766/com.compo.consumer e/androidruntime﹕ fatal exception: main process: com.compo.consumer, pid: 12766 java.lang.runtimeexception: unable start activity componentinfo{com.compo.consumer/com.compo.consumer.activity.mainactivity}: android.view.inflateexception: binary xml file line #7: error inflating class com.esri.android.map.mapview @ android.app.activitythread.performlaunchactivity(activitythread.java:2195) @ android.app.activitythread.handlelaunchactivity(activitythread.java:2245) @ android.app.activitythread.access$800(activitythread.java:135) @ android.app.activitythread$h.handlemessage(activitythread.java:1196) @ android.os.handler.dispatchmessage(handler.java:102) @ android.os.looper.loop(looper.java:136) @ android.app.activitythread.main(activitythread.java:5017) @ java.lang.reflect.method.invokenative(native method) @ java.lang.reflect.method.invoke(method.java:515) @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:779) @ com.android.internal.os.zygoteinit.main(zygoteinit.java:595) @ dalvik.system.nativestart.main(native method) caused by: android.view.inflateexception: binary xml file line #7: error inflating class com.esri.android.map.mapview @ android.view.layoutinflater.createview(layoutinflater.java:620) @ android.view.layoutinflater.createviewfromtag(layoutinflater.java:696) @ android.view.layoutinflater.rinflate(layoutinflater.java:755) @ android.view.layoutinflater.inflate(layoutinflater.java:492) @ android.view.layoutinflater.inflate(layoutinflater.java:397) @ com.compo.consumer.activity.groupmapfragmentarcgis.oncreateview(groupmapfragmentarcgis.java:104) @ android.support.v4.app.fragment.performcreateview(fragment.java:1500) @ android.support.v4.app.fragmentmanagerimpl.movetostate(fragmentmanager.java:938) @ android.support.v4.app.fragmentmanagerimpl.movetostate(fragmentmanager.java:1115) @ android.support.v4.app.backstackrecord.run(backstackrecord.java:682) @ android.support.v4.app.fragmentmanagerimpl.execpendingactions(fragmentmanager.java:1478) @ android.support.v4.app.fragmentactivity.onstart(fragmentactivity.java:570) @ android.app.instrumentation.callactivityonstart(instrumentation.java:1171) @ android.app.activity.performstart(activity.java:5241) @ android.app.activitythread.performlaunchactivity(activitythread.java:2168) @ android.app.activitythread.handlelaunchactivity(activitythread.java:2245) @ android.app.activitythread.access$800(activitythread.java:135) @ android.app.activitythread$h.handlemessage(activitythread.java:1196) @ android.os.handler.dispatchmessage(handler.java:102) @ android.os.looper.loop(looper.java:136) @ android.app.activitythread.main(activitythread.java:5017) @ java.lang.reflect.method.invokenative(native method) @ java.lang.reflect.method.invoke(method.java:515) @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:779) @ com.android.internal.os.zygoteinit.main(zygoteinit.java:595) @ dalvik.system.nativestart.main(native method) caused by: java.lang.reflect.invocationtargetexception @ java.lang.reflect.constructor.constructnative(native method) @ java.lang.reflect.constructor.newinstance(constructor.java:423) @ android.view.layoutinflater.createview(layoutinflater.java:594) @ android.view.layoutinflater.createviewfromtag(layoutinflater.java:696) @ android.view.layoutinflater.rinflate(layoutinflater.java:755) @ android.view.layoutinflater.inflate(layoutinflater.java:492) @ android.view.layoutinflater.inflate(layoutinflater.java:397) @ com.compo.consumer.activity.groupmapfragmentarcgis.oncreateview(groupmapfragmentarcgis.java:104) @ android.support.v4.app.fragment.performcreateview(fragment.java:1500) @ android.support.v4.app.fragmentmanagerimpl.movetostate(fragmentmanager.java:938) @ android.support.v4.app.fragmentmanagerimpl.movetostate(fragmentmanager.java:1115) @ android.support.v4.app.backstackrecord.run(backstackrecord.java:682) @ android.support.v4.app.fragmentmanagerimpl.execpendingactions(fragmentmanager.java:1478) @ android.support.v4.app.fragmentactivity.onstart(fragmentactivity.java:570) @ android.app.instrumentation.callactivityonstart(instrumentation.java:1171) @ android.app.activity.performstart(activity.java:5241) @ android.app.activitythread.performlaunchactivity(activitythread.java:2168) @ android.app.activitythread.handlelaunchactivity(activitythread.java:2245) @ android.app.activitythread.access$800(activitythread.java:135) @ android.app.activitythread$h.handlemessage(activitythread.java:1196) @ android.os.handler.dispatchmessage(handler.java:102) @ android.os.looper.loop(looper.java:136) @ android.app.activitythread.main(activitythread.java:5017) @ java.lang.reflect.method.invokenative(native method) @ java.lang.reflect.method.invoke(method.java:515) @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:779) @ com.android.internal.os.zygoteinit.main(zygoteinit.java:595) @ dalvik.system.nativestart.main(native method) caused by: java.lang.unsatisfiedlinkerror: couldn't load runtimecore_java loader dalvik.system.pathclassloader[dexpathlist[[zip file "/data/app/com.compo.consumer-1.apk"],nativelibrarydirectories=[/data/app-lib/com.compo.consumer-1, /vendor/lib, /system/lib]]]: findlibrary returned null @ java.lang.runtime.loadlibrary(runtime.java:358) @ java.lang.system.loadlibrary(system.java:526) @ com.esri.core.internal.util.e$1.initialize(unknown source) @ com.esri.android.io.a.a(unknown source) @ com.esri.android.map.mapsurface.<clinit>(unknown source) @ com.esri.android.map.mapview.a(unknown source) @ com.esri.android.map.mapview.<init>(unknown source) @ java.lang.reflect.constructor.constructnative(native method) @ java.lang.reflect.constructor.newinstance(constructor.java:423) @ android.view.layoutinflater.createview(layoutinflater.java:594) @ android.view.layoutinflater.createviewfromtag(layoutinflater.java:696) @ android.view.layoutinflater.rinflate(layoutinflater.java:755) @ android.view.layoutinflater.inflate(layoutinflater.java:492) @ android.view.layoutinflater.inflate(layoutinflater.java:397) @ com.compo.consumer.activity.groupmapfragmentarcgis.oncreateview(groupmapfragmentarcgis.java:104) @ android.support.v4.app.fragment.performcreateview(fragment.java:1500) @ android.support.v4.app.fragmentmanagerimpl.movetostate(fragmentmanager.java:938) @ android.support.v4.app.fragmentmanagerimpl.movetostate(fragmentmanager.java:1115) @ android.support.v4.app.backstackrecord.run(backstackrecord.java:682) @ android.support.v4.app.fragmentmanagerimpl.execpendingactions(fragmentmanager.java:1478) @ android.support.v4.app.fragmentactivity.onstart(fragmentactivity.java:570) @ android.app.instrumentation.callactivityonstart(instrumentation.java:1171) @ android.app.activity.performstart(activity.java:5241) @ android.app.activitythread.performlaunchactivity(activitythread.java:2168) @ android.app.activitythread.handlelaunchactivity(activitythread.java:2245) @ android.app.activitythread.access$800(activitythread.java:135) @ android.app.activitythread$h.handlemessage(activitythread.java:1196) @ android.os.handler.dispatchmessage(handler.java:102) @ android.os.looper.loop(looper.java:136) @ android.app.activitythread.main(activitythread.java:5017) @ java.lang.reflect.method.invokenative(native method) @ java.lang.reflect.method.invoke(method.java:515) @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:779) @ com.android.internal.os.zygoteinit.main(zygoteinit.java:595) @ dalvik.system.nativestart.main(native method)
this xml layout:
<framelayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent"> <!-- mapview layout , initial extent --> <com.esri.android.map.mapview android:id="@+id/my_custom_map" android:layout_width="fill_parent" android:layout_height="fill_parent" initextent = "-1.3296373526814876e7 3930962.41823043 -1.2807176545789773e7 4201243.7502468005"> </com.esri.android.map.mapview>
and i'm initializing map:
public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) { super.oncreateview(inflater,container,savedinstancestate); // inflate layout fragment log.d("on createview()","on createview()"); groupmapfragmentview = inflater.inflate(r.layout.map_arcgis, container, false); mapview = (mapview)groupmapfragmentview.findviewbyid(r.id.my_custom_map); return groupmapfragmentview; }
my app module's build.gradle:
apply plugin: 'android' android { compilesdkversion 19 buildtoolsversion '19.0.1' defaultconfig { minsdkversion 10 targetsdkversion 19 versioncode 1 versionname "1.0" } buildtypes { release { runproguard false proguardfiles getdefaultproguardfile('proguard-android.txt'), 'proguard-rules.txt' } } } dependencies { compile 'com.android.support:appcompat-v7:19.1.0' compile 'com.android.support:support-v4:19.1.0' compile 'com.google.android.gms:play-services:+' compile filetree(dir: 'libs', include: ['*.jar']) compile files('libs/arcgis-android-api.jar') compile files('libs/jackson-core-lgpl-1.9.5.jar') compile files('libs/jackson-mapper-lgpl-1.9.5.jar') compile files('libs/jcifs-1.3.17.jar') } android { packagingoptions { exclude 'meta-inf/lgpl2.1' exclude 'meta-inf/dependencies' exclude 'meta-inf/notice' exclude 'meta-inf/license' exclude 'meta-inf/license.txt' exclude 'meta-inf/notice.txt' } }
it's late answer posting facing same issue , else in future can face it. solution worked me is: "i had forgotten add jnilibs folder in /src/main/ path , placing .so files on there" mentioned @ https://developers.arcgis.com/android/guide/install-and-set-up.htm
in case, working "offline" in android studio , had downloaded sdk solely rather downloading via gradle.
Comments
Post a Comment