Unable to execute dex: Multiple dex files define Eclipse Android
Try each step separately:
- Restart Eclipse
- Clean project and rebuild
- Create a new project and try it if the problem persists, if no move copy project to other folder, delete project from workspace , create new project same name and copy java, xml etc. files to new project
- Close Eclipse, backup folder c:\Users\myName\workspace\.metadata and delete it. Restart Eclipse try again import project to workspace
- Re-installing the Android Developer Tools
- Re-installing Eclipse - rename old folder with Android to Android_old, create new folder C:\Program Files\Android and copy new Eclipse with sdk into new folder
- Created a new project importing from the file system
- Created a new project from subversion
396LW NO topic_id
AD
Další témata ....(Topics)
Zipalign.exe path on Windows:
c:\Program Files\Android\android-sdk-windows\tools\zipalign.exe
How do signs .apk with your private key - image:
More about Zipalign android.com
c:\Program Files\Android\android-sdk-windows\tools\zipalign.exe
zipalign [-f] [-v] <alignment> infile.apk outfile.apk
// command line in Total Commander
zipalign.exe -f -v 4 infile.apk outfile.apk
When using Eclipse with the ADT plugin, the Export Wizard will automatically zipalign your .apk after it signs it with your private key.
How do signs .apk with your private key - image:
More about Zipalign android.com
Dialog Yes No sample code
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setMessage("Are you sure you want to exit application?")
.setCancelable(false)
.setPositiveButton("Yes", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
MyActivity.this.finish(); //Close this Activity for example: MyActivity.java
}
})
.setNegativeButton("No", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
// some code if you want
dialog.cancel();
}
});
AlertDialog alert = builder.create();
alert.show();
Context context = getApplicationContext();
String DB_PATH = "/data/data/"
+ context.getPackageName()
+ "/databases/";
int occupy 4 bytes (32 bits) in memory
int in Java example of using Integer and Array of Integer and Iteger to String
int in Java example of using Integer and Array of Integer and Iteger to String
// get max end min values of int in Java example 4 bytes (32 bits) PC architecture
System.out.println(Integer.MAX_VALUE); // 2147483647
System.out.println(Integer.MIN_VALUE); // -2147483648
// members variable
private int mProgress = 10;
//integer to string java
int myInteger = 8;
String myString = Integer.toString(myInteger);
// a final variable can only be initialized once
static final int NUM_PARTICLES = 15;
for (int i = 0; i < NUM_PARTICLES ; i++) {
// do something
}
// int as return value of function
public int getCount() {
return 5;
}
// int as a parametr of function
public float getFloatFromInt(int i) {
float fRet = (float) i;
return fRet;
}
//array of int
int[] anArray; // declares an array of integers
anArray = new int[2]; // allocates memory for 2 integers
anArray[0] = 100; // initialize first element
anArray[1] = 200; // initialize second element
for (int i = 0; i < anArray.length; i++) {
// print out values from anArray
System.out.println("Index: " + i);
System.out.println("Value: " + anArray[i]);
}
Difference between "@+id/” and "@id/” in Android
android:id="@+id/xxx" unique identifier of view
@id/ a reference to the unique identifier
android:id="@+id/xxx" unique identifier of view
@id/ a reference to the unique identifier
<TextView
android:id="@+id/first_element_id"
.........
/>
<TextView
android:id="@+id/second_element_id"
android:layout_below="@id/first_element_id"
..........
/>
Editace: 2014-09-14 09:52:49
Počet článků v kategorii: 396
Url:unable-to-execute-dex-multiple-dex-files-define-eclipse-android