Android教程網
  1. 首頁
  2. Android 技術
  3. Android 手機
  4. Android 系統教程
  5. Android 游戲
 Android教程網 >> Android技術 >> 關於Android編程 >> android.view.InflateException: Binary XML file line #6: Error inflating class com.esri.android.map.M

android.view.InflateException: Binary XML file line #6: Error inflating class com.esri.android.map.M

編輯:關於Android編程

今天上午搞了一上午這個錯誤終於解決了!先貼出異常來吧:  
10-18 10:47:35.210: ERROR/AndroidRuntime(15412): FATAL EXCEPTION: main  
10-18 10:47:35.210: ERROR/AndroidRuntime(15412): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.esri.arcgis.android.samples.helloworld/com.esri.arcgis.android.samples.helloworld.HelloWorld}: android.view.InflateException: Binary XML file line #6: Error inflating class com.esri.android.map.MapView  
10-18 10:47:35.210: ERROR/AndroidRuntime(15412):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1969)  
10-18 10:47:35.210: ERROR/AndroidRuntime(15412):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1994)  
10-18 10:47:35.210: ERROR/AndroidRuntime(15412):     at android.app.ActivityThread.access$600(ActivityThread.java:126)  
10-18 10:47:35.210: ERROR/AndroidRuntime(15412):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1150)  
10-18 10:47:35.210: ERROR/AndroidRuntime(15412):     at android.os.Handler.dispatchMessage(Handler.java:99)  
10-18 10:47:35.210: ERROR/AndroidRuntime(15412):     at android.os.Looper.loop(Looper.java:137)  
10-18 10:47:35.210: ERROR/AndroidRuntime(15412):     at android.app.ActivityThread.main(ActivityThread.java:4439)  
10-18 10:47:35.210: ERROR/AndroidRuntime(15412):     at java.lang.reflect.Method.invokeNative(Native Method)  
10-18 10:47:35.210: ERROR/AndroidRuntime(15412):     at java.lang.reflect.Method.invoke(Method.java:511)  
10-18 10:47:35.210: ERROR/AndroidRuntime(15412):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:787)  
10-18 10:47:35.210: ERROR/AndroidRuntime(15412):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:554)  
10-18 10:47:35.210: ERROR/AndroidRuntime(15412):     at dalvik.system.NativeStart.main(Native Method)  
10-18 10:47:35.210: ERROR/AndroidRuntime(15412): Caused by: android.view.InflateException: Binary XML file line #6: Error inflating class com.esri.android.map.MapView  
10-18 10:47:35.210: ERROR/AndroidRuntime(15412):     at android.view.LayoutInflater.createView(LayoutInflater.java:606)  
10-18 10:47:35.210: ERROR/AndroidRuntime(15412):     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:680)  
10-18 10:47:35.210: ERROR/AndroidRuntime(15412):     at android.view.LayoutInflater.rInflate(sLayoutInflater.java:739)  
10-18 10:47:35.210: ERROR/AndroidRuntime(15412):     at android.view.LayoutInflater.inflate(LayoutInflater.java:489)  
10-18 10:47:35.210: ERROR/AndroidRuntime(15412):     at android.view.LayoutInflater.inflate(LayoutInflater.java:396)  
10-18 10:47:35.210: ERROR/AndroidRuntime(15412):     at android.view.LayoutInflater.inflate(LayoutInflater.java:352)  
10-18 10:47:35.210: ERROR/AndroidRuntime(15412):     at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:253)  
10-18 10:47:35.210: ERROR/AndroidRuntime(15412):     at android.app.Activity.setContentView(Activity.java:1841)  
10-18 10:47:35.210: ERROR/AndroidRuntime(15412):     at com.esri.arcgis.android.samples.helloworld.HelloWorld.onCreate(HelloWorld.java:40)  
10-18 10:47:35.210: ERROR/AndroidRuntime(15412):     at android.app.Activity.performCreate(Activity.java:4471)  
10-18 10:47:35.210: ERROR/AndroidRuntime(15412):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)  
10-18 10:47:35.210: ERROR/AndroidRuntime(15412):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1933)  
10-18 10:47:35.210: ERROR/AndroidRuntime(15412):     ... 11 more  
10-18 10:47:35.210: ERROR/AndroidRuntime(15412): Caused by: java.lang.reflect.InvocationTargetException  
10-18 10:47:35.210: ERROR/AndroidRuntime(15412):     at java.lang.reflect.Constructor.constructNative(Native Method)  
10-18 10:47:35.210: ERROR/AndroidRuntime(15412):     at java.lang.reflect.Constructor.newInstance(Constructor.java:417)  
10-18 10:47:35.210: ERROR/AndroidRuntime(15412):     at android.view.LayoutInflater.createView(LayoutInflater.java:586)  
10-18 10:47:35.210: ERROR/AndroidRuntime(15412):     ... 22 more  
10-18 10:47:35.210: ERROR/AndroidRuntime(15412): Caused by: java.lang.ExceptionInInitializerError  
10-18 10:47:35.210: ERROR/AndroidRuntime(15412):     at com.esri.android.map.MapView.a(Unknown Source)  
10-18 10:47:35.210: ERROR/AndroidRuntime(15412):     at com.esri.android.map.MapView.<init>(Unknown Source)  
10-18 10:47:35.210: ERROR/AndroidRuntime(15412):     ... 25 more  
10-18 10:47:35.210: ERROR/AndroidRuntime(15412): Caused by: java.lang.UnsatisfiedLinkError: Couldn't load runtimecore_java: findLibrary returned null  
10-18 10:47:35.210: ERROR/AndroidRuntime(15412):     at java.lang.Runtime.loadLibrary(Runtime.java:365)  
10-18 10:47:35.210: ERROR/AndroidRuntime(15412):     at java.lang.System.loadLibrary(System.java:535)  
10-18 10:47:35.210: ERROR/AndroidRuntime(15412):     at com.esri.core.internal.util.e$1.initialize(Unknown Source)  
10-18 10:47:35.210: ERROR/AndroidRuntime(15412):     at com.esri.android.io.a.a(Unknown Source)  
10-18 10:47:35.210: ERROR/AndroidRuntime(15412):     at com.esri.android.map.MapSurface.<clinit>(Unknown Source)  
10-18 10:47:35.210: ERROR/AndroidRuntime(15412):     ... 27 more  
10-18 10:47:35.210: WARN/ActivityManager(315):   Force finishing activity com.esri.arcgis.android.samples.helloworld/.HelloWorld  
10-18 10:47:35.340: INFO/ActivityManager(315): Start proc com.android.quicksearchbox for broadcast com.android.quicksearchbox/.CorporaUpdateReceiver: pid=15431 uid=10038 gids={3003}  
10-18 10:47:35.340: INFO/ActivityManager(315): No longer want com.miui.weather2 (pid 15099): hidden #16  

 

    出現這個錯誤主要是底層沒有對mapview進行定義,異常說我com.esri.android.map.MapView 沒有定義    
<?xml version="1.0" encoding="utf-8"?>  
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"  
    android:layout_width="fill_parent"  
    android:layout_height="fill_parent"  
    android:orientation="vertical" >  
    <com.esri.android.map.MapView  
        android:id="@+id/map"   
        android:layout_width="fill_parent"  
        android:layout_height="fill_parent"  
        initExtent="-19332033.11, -3516.27, -1720941.80, 11737211.28"/>  
</LinearLayout>  

 

  所以這樣就簡單了,說明我們還有需要的東西需要導入進行定義底層的mapview,也就是.so文件樓. 所以要將ArcGISAndroidSDK_v10.1.1-u1/plugins/com.esri.arcgis.android.samples_10.1.1.201306271100.jar文件解壓,解壓出來的有jar包,還有sample! 我是用的裡面的helloword裡面的demo,但是裡面只有jar包沒有.so文件, .so文件添加: ArcGISAndroidSDK_v10.1.1-u1\plugins這個路徑下利用rar解壓com.esri.arcgis.android.core_10.1.1.201306271100.jar 解壓之後就會得到lib,libs兩個文件,jar包我們剛才已經得到,我們現在需要的是libs裡面的armeabi,armeabi-v7a裡面的兩個文件, 把這兩個文件夾都拷貝到我們的工程目錄下,直接放到那裡面,編譯部署即可!
  1. 上一頁:
  2. 下一頁:
熱門文章
閱讀排行版
Copyright © Android教程網 All Rights Reserved