I just moved from Eclipse to Android Studio. In Eclipse I had a project running with facebook and jsoup libraries properly configured and working. But when I imported the project into Android Studio I got build failed. I searched a lot here but I couldn't find a solution. Here is what I got as structure today:
Workspace \TripFinder (package name)
Inside TripFinder: (4 four folders)
.gradle
.idea
facebookSDK
gradle
tripFinder
(7 seven files)
build.gradle
gradlew
gradlew.bat
import-summary
local.properties
settings.gradle
TripFinder.iml
What I think is weird is that inside tripFinder folder besides build and src folder I got build.gradle and tripFinder.iml files (It seems to me redundant). I have the same structure inside Facebook Folder.
In Files > Project Structures... I have two modules> Facebook and TripFinder modules.
Inside Facebook dependencies: com.android.tools.idea.structure.ModuleDependenciesTableItem@668baf3 inside tripFinder dependencies i put:
- admob (stopped giving me errors as was before)
- facebookSDK
- jsoup 1.7.2.jar
- jsoup 1.7.2-sources.jar
- jsoup 1.7.2-javadoc.jar
But When I try to build I got this 2 errors:
: duplicate files during packaging of APK C:\Users\Tiago\Documents\Android\Workspace_appsTMA\TripFinder\tripFinder\build\apk\tripFinder-debug-unaligned.apk
and
Execution failed for task ':tripFinder:packageDebug'.
> Duplicate files copied in APK org/jsoup/nodes/entities-base.properties
File 1: C:\Users\Tiago\Documents\Android\Workspace_appsTMA\TripFinder\tripFinder\src\main\libs\jsoup-1.7.2-sources.jar
File 2: C:\Users\Tiago\Documents\Android\Workspace_appsTMA\TripFinder\tripFinder\src\main\libs\jsoup-1.7.2-sources.jar
Please, if the solution is to write something into build.gradle file, tell me which one should I edit because I got three build.gradle files. One at the root folder (tripfinder), another one inside facebook folder and another one inside tripFinder folder (the nested folder in the root). Thank you guys.
If you need anything else, please, just ask I'll be help to provide it.
Duplicate files copied in APK org/jsoup/nodes/entities-base.properties
Both jsoup 1.7.2.jar
and jsoup 1.7.2-sources.jar
contain org/jsoup/nodes/entities-base.properties
, try removing jsoup 1.7.2-sources.jar
from your build path and rebuild again.