Eclipse was complaining about multiple dex files; eventually I found out that I was exporting out multiple jar files with the same classes and I had to toggle off the duplicate jar files in Eclipse. The following steps ensure that my project could compile successfully with the two libraries.
Add the Google Play Services and Google Maps Android Utility libraries
- In Eclipse, select the Android project in the Package Explorer. Right click and choose Properties.
The Properties for xxx project appears. - Choose Android. Click Add.
The Project Selection dialog appears. - Choose Google Play Services library. Click OK.
The library is added. - Repeat steps 2 and 3 to add the Google Maps Android Utility library.
The library is added.
- Click Java Build Path.
The Java Build Path page appears. - Click the Libraries tab.
- In the JARS and class folders tree, expand the top level nodes.
- Make a note of any duplicate JAR files.
Note: In this example, the android-support-v4.jar is duplicated. There is a copy in my Android project and there is another copy in the Google Maps Android Utility library. - Click the Order and Export tab.
- Toggle off one the items that contain the duplicate JAR files e.g. the android-support-v4.jar file in my Android project.
- Click OK.
The Properties for XXXX project is closed. - If necessary, select Project | Clean to clean up the previous compilation temporary files and compile/run the project again.
The project should now compile successfully.
Hi I want know how to create and use multiple dex files. Please help in that. My E-mail is malli.paidala@gmail.com
ReplyDelete