我想提出一個簡單的地圖應用程序,但上運行它,會顯示錯誤,我不明白....類型轉換的Dalvik格式失敗:無法執行DEX:java.nio.BufferOverflowException
我項目min SDK是android 2.2(Froyo)API 8,目標SDK是android 4.4(kitkat)API 19,app是用Google API 2 rev 8編譯的.....
我真的不知道應該是什麼min,target和編譯apis的組合,以便使我的應用程序能夠運行....幫助我以正確的組合。
以下是我的清單文件代碼
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.margallahillhikedroid"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="19" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.INTERNET"/>
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<uses-library android:name="com.google.android.maps"/>"
<activity
android:name="com.example.margallahillhikedroid.MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
//以下是主要的Java源
//包com.example.margallahillhikedroid;
import com.google.android.maps.MapActivity;
import com.google.android.maps.MapView;
import android.os.Bundle;
import android.view.Menu;
public class MainActivity extends MapActivity {
MapView map;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
map=(MapView)findViewById(R.id.mymap);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
@Override
protected boolean isRouteDisplayed() {
// TODO Auto-generated method stub
return false;
}
}
以下是運行在以下顯示控制檯部錯誤應用的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:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".MainActivity" >
<com.google.android.maps.MapView
android:id="@+id/mymap"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:apiKey="AIzaSyBcTxeirTSzthVlMal5JDDC-SK-Mw7s_CE"/>
</RelativeLayout>
;
[2014-04-14 07:37:14 - MargallahillHikedroid] Dx
trouble writing output: already prepared
[2014-04-14 07:37:14 - Dex Loader] Unable to execute dex: java.nio.BufferOverflowException. Check the Eclipse log for stack trace.
[2014-04-14 07:37:14 - MargallahillHikedroid] Conversion to Dalvik format failed: Unable to execute dex: java.nio.BufferOverflowException. Check the Eclipse log for stack trace.
的問題部分下面的錯誤
顯示
Description Resource Path Location Type
Conversion to Dalvik format failed: Unable to execute dex: java.nio.BufferOverflowException. Check the Eclipse log for stack trace. MargallahillHikedroid Unknown Android Packaging Problem
我想提出一個地圖應用,但在運行上述提到它的錯誤顯示在問題部分以及控制檯部分。
你的兩個鏈接不打開! – user3431536
我的博客服務器出現了一些問題,應該現在就去吧:) –