I have an Android library project (projA
) that depends on another library project (projB
). I also have an internal Maven server (Archiva). projA
contains these lines:
dependencies {
maven { url 'http://company.com/internal/repository' }
compile 'com.company:projB:2.0.7@aar'
...
}
projB
is an AAR that was built with the Android library plugin, published to the company.com Archiva server, and it contains native code. Extracting the AAR shows the .so files exist where they should be, and the wrapper JAR file exists as well. If I run: ./gradlew clean build
the build fails with unresolved symbols. However, if I run
./gradlew clean build
./gradlew build
then the second build will succeed!
This is a problem, for example, on build servers that always use clean, or get a fresh copy from source control.
Why is this happening, and how do I fix it?