I want to create Android Library with jar file and resources without sources.
Dependency structure :
- Android Library Sample :
- depends on support v4, v7 and some jars included
- SampleApp
- depends on Android Library Sample and v4, v7 support
I can generate jar file by compiling Android Sample Library, but I when I create new workspace with Android Library Sample with generated jar I get errors like this :
Error:Execution failed for task ':sampleAppProject:dexDebug'.
com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Library/Java/JavaVirtualMachines/jdk1.7.0_71.jdk/Contents/Home/bin/java'' finished with non-zero exit value 2
It seems to be cause by duplicated support v4, v7 which are include in my generated jar. When I remove from gradle dependencies support v7 and v4 libraries I get :
Error:(1) Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light'. Error:(1) Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light'. Error:(1) Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light.DarkActionBar'.
So there are missing support resources. How can I solve this?
UPDATE:
After tips from @dawidgdanski I've was able to compile my project. My error changes to finished with non-zero exit value 1 which was caused by duplicated package name I think. I change package name in manifest, but now I get
java.lang.ClassNotFoundException: Didn't find clas "**.android.R$layout" on path: DexPathList[[zip file ...
It seems to by caused by that I change package in manifest and during the compilation R class is not consistent with class included with jar file
From Gradle console :