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' } }
<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 and 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> </FrameLayout>
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { super.onCreateView(inflater,container,savedInstanceState); // Inflate the layout for this fragment Log.d("ON CREATEVIEW()","ON CREATEVIEW()"); meterGroupMapFragmentView = inflater.inflate(R.layout.map_arcgis, container, false); mapView = (MapView)meterGroupMapFragmentView.findViewById(R.id.my_custom_map); mapView.addLayer(new ArcGISTiledMapServiceLayer("" + "http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer")); return meterGroupMapFragmentView; }
Solved! Go to Solution.
06-26 16:36:15.678: E/AndroidRuntime(2672): Caused by: java.lang.reflect.InvocationTargetException 06-26 16:36:15.678: E/AndroidRuntime(2672): at java.lang.reflect.Constructor.constructNative(Native Method) 06-26 16:36:15.678: E/AndroidRuntime(2672): at java.lang.reflect.Constructor.newInstance(Constructor.java:417) 06-26 16:36:15.678: E/AndroidRuntime(2672): at android.view.LayoutInflater.createView(LayoutInflater.java:587) 06-26 16:36:15.678: E/AndroidRuntime(2672): ... 22 more 06-26 16:36:15.678: E/AndroidRuntime(2672): Caused by: java.lang.ExceptionInInitializerError 06-26 16:36:15.678: E/AndroidRuntime(2672): at com.esri.android.map.MapView.a(Unknown Source) 06-26 16:36:15.678: E/AndroidRuntime(2672): at com.esri.android.map.MapView.<init>(Unknown Source) 06-26 16:36:15.678: E/AndroidRuntime(2672): ... 25 more 06-26 16:36:15.678: E/AndroidRuntime(2672): Caused by: java.lang.UnsatisfiedLinkError: Couldn't load runtimecore_java: findLibrary returned null 06-26 16:36:15.678: E/AndroidRuntime(2672): at java.lang.Runtime.loadLibrary(Runtime.java:365) 06-26 16:36:15.678: E/AndroidRuntime(2672): at java.lang.System.loadLibrary(System.java:535) 06-26 16:36:15.678: E/AndroidRuntime(2672): at com.esri.core.internal.util.e$1.initialize(Unknown Source) 06-26 16:36:15.678: E/AndroidRuntime(2672): at com.esri.android.io.a.a(Unknown Source) 06-26 16:36:15.678: E/AndroidRuntime(2672): at com.esri.android.map.MapSurface.<clinit>(Unknown Source) 06-26 16:36:15.678: E/AndroidRuntime(2672): ... 27 more
tasks.withType(com.android.build.gradle.tasks.PackageApplication) { pkgTask -> pkgTask.jniFolders = new HashSet<File>() pkgTask.jniFolders.add(new File(buildDir, 'native-libs')) } 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' } }
06-26 16:36:15.678: E/AndroidRuntime(2672): Caused by: java.lang.reflect.InvocationTargetException 06-26 16:36:15.678: E/AndroidRuntime(2672): at java.lang.reflect.Constructor.constructNative(Native Method) 06-26 16:36:15.678: E/AndroidRuntime(2672): at java.lang.reflect.Constructor.newInstance(Constructor.java:417) 06-26 16:36:15.678: E/AndroidRuntime(2672): at android.view.LayoutInflater.createView(LayoutInflater.java:587) 06-26 16:36:15.678: E/AndroidRuntime(2672): ... 22 more 06-26 16:36:15.678: E/AndroidRuntime(2672): Caused by: java.lang.ExceptionInInitializerError 06-26 16:36:15.678: E/AndroidRuntime(2672): at com.esri.android.map.MapView.a(Unknown Source) 06-26 16:36:15.678: E/AndroidRuntime(2672): at com.esri.android.map.MapView.<init>(Unknown Source) 06-26 16:36:15.678: E/AndroidRuntime(2672): ... 25 more 06-26 16:36:15.678: E/AndroidRuntime(2672): Caused by: java.lang.UnsatisfiedLinkError: Couldn't load runtimecore_java: findLibrary returned null 06-26 16:36:15.678: E/AndroidRuntime(2672): at java.lang.Runtime.loadLibrary(Runtime.java:365) 06-26 16:36:15.678: E/AndroidRuntime(2672): at java.lang.System.loadLibrary(System.java:535) 06-26 16:36:15.678: E/AndroidRuntime(2672): at com.esri.core.internal.util.e$1.initialize(Unknown Source) 06-26 16:36:15.678: E/AndroidRuntime(2672): at com.esri.android.io.a.a(Unknown Source) 06-26 16:36:15.678: E/AndroidRuntime(2672): at com.esri.android.map.MapSurface.<clinit>(Unknown Source) 06-26 16:36:15.678: E/AndroidRuntime(2672): ... 27 more
tasks.withType(com.android.build.gradle.tasks.PackageApplication) { pkgTask -> pkgTask.jniFolders = new HashSet<File>() pkgTask.jniFolders.add(new File(buildDir, 'native-libs')) } 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' } }
dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) }
apply plugin: 'android' android { compileSdkVersion 19 buildToolsVersion "19.0.3" defaultConfig { minSdkVersion 15 targetSdkVersion 19 versionCode 1 versionName "1.0" } packagingOptions{ exclude 'META-INF/LGPL2.1' exclude 'META-INF/LICENSE' exclude 'META-INF/NOTICE' } buildTypes { release { runProguard false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' } } } dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) compile 'com.android.support:appcompat-v7:19.+' }