I followed tutorial(Hello world) but it doesn't work
I made some app using eclipse&arcgis sdk before, it work well in that time...
But Android Studio is unfamilliar
I searched for the same problem and advices are just for eclipse..
here are codes, I just wonder why android studio can't read class com.esri.android.map.MapView
Logcat-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
01-20 04:55:28.590 2151-2151/com.esri.android.tutorials.helloworld E/art﹕ dlopen("/data/app/com.esri.android.tutorials.helloworld-1/lib/x86/libruntimecore_java.so", RTLD_LAZY) failed: dlopen failed: "/data/app/com.esri.android.tutorials.helloworld-1/lib/x86/libruntimecore_java.so" has unexpected e_machine: 40
01-20 04:55:28.590 2151-2151/com.esri.android.tutorials.helloworld D/AndroidRuntime﹕ Shutting down VM
01-20 04:55:28.590 2151-2151/com.esri.android.tutorials.helloworld E/AndroidRuntime﹕ FATAL EXCEPTION: main
Process: com.esri.android.tutorials.helloworld, PID: 2151
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.esri.android.tutorials.helloworld/com.esri.android.tutorials.helloworld.MainActivity}: android.view.InflateException: Binary XML file line #8: Error inflating class com.esri.android.map.MapView
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2298)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2360)
at android.app.ActivityThread.access$800(ActivityThread.java:144)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5221)
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:899)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
Caused by: android.view.InflateException: Binary XML file line #8: Error inflating class com.esri.android.map.MapView
at android.view.LayoutInflater.createView(LayoutInflater.java:633)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:743)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:806)
at android.view.LayoutInflater.inflate(LayoutInflater.java:504)
at android.view.LayoutInflater.inflate(LayoutInflater.java:414)
at android.view.LayoutInflater.inflate(LayoutInflater.java:365)
at android.support.v7.app.ActionBarActivityDelegateBase.setContentView(ActionBarActivityDelegateBase.java:228)
at android.support.v7.app.ActionBarActivity.setContentView(ActionBarActivity.java:102)
at com.esri.android.tutorials.helloworld.MainActivity.onCreate(MainActivity.java:14)
at android.app.Activity.performCreate(Activity.java:5933)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2251)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2360)
at android.app.ActivityThread.access$800(ActivityThread.java:144)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5221)
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:899)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Constructor.newInstance(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:288)
at android.view.LayoutInflater.createView(LayoutInflater.java:607)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:743)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:806)
at android.view.LayoutInflater.inflate(LayoutInflater.java:504)
at android.view.LayoutInflater.inflate(LayoutInflater.java:414)
at android.view.LayoutInflater.inflate(LayoutInflater.java:365)
at android.support.v7.app.ActionBarActivityDelegateBase.setContentView(ActionBarActivityDelegateBase.java:228)
at android.support.v7.app.ActionBarActivity.setContentView(ActionBarActivity.java:102)
at com.esri.android.tutorials.helloworld.MainActivity.onCreate(MainActivity.java:14)
at android.app.Activity.performCreate(Activity.java:5933)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2251)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2360)
at android.app.ActivityThread.access$800(ActivityThread.java:144)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5221)
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:899)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
Caused by: java.lang.UnsatisfiedLinkError: dlopen failed: "/data/app/com.esri.android.tutorials.helloworld-1/lib/x86/libruntimecore_java.so" has unexpected e_machine: 40
at java.lang.Runtime.loadLibrary(Runtime.java:371)
at java.lang.System.loadLibrary(System.java:989)
at com.esri.core.internal.RuntimeHelper.a(SourceFile:85)
at com.esri.core.internal.RuntimeHelper.initialize(SourceFile:47)
at com.esri.android.map.MapSurface.<clinit>(SourceFile:68)
at com.esri.android.map.MapView.a(SourceFile:585)
at com.esri.android.map.MapView.<init>(SourceFile:620)
at java.lang.reflect.Constructor.newInstance(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:288)
at android.view.LayoutInflater.createView(LayoutInflater.java:607)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:743)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:806)
at android.view.LayoutInflater.inflate(LayoutInflater.java:504)
at android.view.LayoutInflater.inflate(LayoutInflater.java:414)
at android.view.LayoutInflater.inflate(LayoutInflater.java:365)
at android.support.v7.app.ActionBarActivityDelegateBase.setContentView(ActionBarActivityDelegateBase.java:228)
at android.support.v7.app.ActionBarActivity.setContentView(ActionBarActivity.java:102)
at com.esri.android.tutorials.helloworld.MainActivity.onCreate(MainActivity.java:14)
at android.app.Activity.performCreate(Activity.java:5933)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2251)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2360)
at android.app.ActivityThread.access$800(ActivityThread.java:144)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5221)
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:899)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
activity_main.xml--------------------------------------------------------------------------------------------------------------------------------------------------------
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin" tools:context=".MainActivity">
<com.esri.android.map.MapView
android:id="@+id/map"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
mapoptions.MapType="Streets"
mapoptions.center="34.056215, -117.195668"
mapoptions.ZoomLevel="16">
</com.esri.android.map.MapView>
</RelativeLayout>
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
MainActivity.java-------------------------------------------------------------------------------------------------------------------------------------------------------
package com.esri.android.tutorials.helloworld;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
public class MainActivity extends ActionBarActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.menu_main, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
//noinspection SimplifiableIfStatement
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}
}
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
build.gradle(Project HelloWorld)-------------------------------------------------------------------------------------------------------------------------------------------------------
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
maven {
url 'http://dl.bintray.com/esri/arcgis'
}
}
}
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
build.gradle(Module: app)-------------------------------------------------------------------------------------------------------------------------------------------------------
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
packagingOptions{
exclude 'META-INF/LGPL2.1'
exclude 'META-INF/LICENSE'
exclude 'META-INF/NOTICE'
}
defaultConfig {
applicationId "com.esri.android.tutorials.helloworld"
minSdkVersion 15
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile 'com.esri.arcgis.android:arcgis-android:10.2.5'
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:21.0.3'
}
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
How can I solve this Problem in Android Studio
Solved! Go to Solution.
Looks like you ran this sample with the emulator? Specifically the x86 emulator? We have a known issue with respect to using our AAR SDK bundle with x86 emulators. From our release notes:
> x86 native *.so files bundled in AAR do not work on android stock x86
> emulator. They do work on device. If you need to test on x86 emulator then you
> need to should not use the AAR bundle and instead add all the libs manually.
You can either create an ARM based emulator or use a physical device. If you must use an x86 emulator than you need to set up your app manually
Can you share what your projects's 2 Gradle build files look like?
Also...are there any errors showing up in your layout XML file?
Looks like you ran this sample with the emulator? Specifically the x86 emulator? We have a known issue with respect to using our AAR SDK bundle with x86 emulators. From our release notes:
> x86 native *.so files bundled in AAR do not work on android stock x86
> emulator. They do work on device. If you need to test on x86 emulator then you
> need to should not use the AAR bundle and instead add all the libs manually.
You can either create an ARM based emulator or use a physical device. If you must use an x86 emulator than you need to set up your app manually
O Dan. Thanks...
It Surey Works!!!!
I don't know why it doesn't work in emulator exactly...
But it works in physical Device....
Thanks again, Your coorporation is highly appreciated..!!