Comments (9)
After android gradle plugin 2.3.0 was released, something about file path has been changed.
That results in the hard-code build script working wrong.
AFAIK, there are 2 points below:
build/intermediates/bundles/debug
is changed tobuild/intermediates/bundles/default
in some case.exploded-aar
is moved tobuild-cache
for performance improvement. To restore this, we can disable build-cache.
I have created a new repo to try to support all these.
Even so disable build-cache
is also needed. Or you should use the version prior to 2.2.3.
If the build script is really puzzle you, you can try mine.
from android-fat-aar.
I just ran into the same problem.
I got as far as working out that the string 'unspecified' in your error tty comes from - in blibrary's build file - not having an entry for project.version, so I added project.version = android.defaultConfig.versionName in that library's defaultConfig.
Adding that changes
...ploded-aar\trunk<blibrary>\unspecified\AndroidManifest.xml (The system cannot find the path specified)
to
...ploded-aar\trunk<blibrary>\1.0\AndroidManifest.xml (The system cannot find the path specified)
Update: I'm not sure that exploded-aar folder is ever created, maybe it's moved or something's changed? (Studio version 2.3, Gradle 3.3)
from android-fat-aar.
I think that I found a solution for this issue.
I figure out the new default configuration for Android Studio 2.3: (android.enableBuildCache=true). When a change it to false in gradle.properties it stops in line 356:
Error:Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
FAILURE: Build failed with an exception.
-
Where:
Script 'https://raw.githubusercontent.com/roremeol/android-fat-aar/master/fat-aar.gradle' line: 356 -
What went wrong:
Execution failed for task ':qLibAds:embedManifests'.
java.io.FileNotFoundException: /Users/romulo/Desenvolvimento/develLibs/qLibAds_and/qLibAdsProject/qLibAds/build/intermediates/bundles/release/AndroidManifest.orig.xml (No such file or directory)
- Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Fix
I fix it! Please see issue #62
from android-fat-aar.
Well I'm getting closer.
Setting android.enableBuildCache=false in gradle.properties does make the exploded-aar folder appear.
However, the build process didn't explode the sub-library's aar in question into there. So to progress matters, I manually unzipped the aar into exploded-aar/
I then had to change the path in embedJavaJars() from "$aarPath/jars/classes.jar" to "$aarPath/classes.jar", and skip the call to embedManifests() - as that was crashing, and I don't need to merge the manifests in this case.
With that (still with the manual unzip which I'll have to fix later), it looks like I now have a merged aar file. (Though I still have problems building my app with it....)
from android-fat-aar.
Update:
R$... classes from the sub-library were missing from the output aar.
They are in \build\fat-aar\ as well as in a .jar file in build\intermediates\bundles\release\libs
After manually copying them from build\intermediates\bundles\release\libs<sub-library>.jar into classes.jar within the output aar, I am now able to compile the aar into a separate apk project.
So I now just need to figure out how to replace the two manual steps, i.e.
- unzip the contents of the sub-library's aar file into build\intermediates\exploded-aar\
- manually copy contents of build\intermediates\bundles\release\libs<sub-library>.jar into classes.jar in the output aar
- (I'm not worried that I disabled manifest merging)
from android-fat-aar.
It could help you:
#copy file sample
task copyHeaders {
copy {
from("${srcLibs}")
into "../../Classes"
}
dependsOn ':app:preBuild'
}
#unzip file sample
task unzip {
copy {
def zipFile = file("${binLibs}/lib.aar")
def outputDir = file("../../libs")
from zipTree(zipFile)
into outputDir
}
dependsOn ':app:preBuild'
}
from android-fat-aar.
it seems that it does not work with maven dependencies. @JohnSFR
from android-fat-aar.
Update:
I think that this issue is related to #62 .
I do not know why. When "Flavors" is in debug in Android Studio, gradle makes other intermediates build folder ({libary dir}/build/intermediates/bundles/debug) and it seems to use it.
When i change the "Flavors" to release, it uses the correct one ({libary dir}/build/intermediates/bundles/default). And now the fat-aar works.
I figure out this curious issue on Androis's project
from android-fat-aar.
I have the same question as you 。finally I change gradle to 2.3.1 to 2.2.3 solve it
classpath 'com.android.tools.build:gradle:2.2.3'
I found this way can solve it.
from android-fat-aar.
Related Issues (20)
- Support apply plugin: 'com.android.application'? HOT 1
- unknown property 'packageReleaseResources' HOT 1
- Error:(61, 0) Could not find method compile() for arguments [project ':croplibrary', build_dijfgbzqt6st566goauqc2hu4$_run_closure3@60f84416] on project ':imageeditlibrary' of type org.gradle.api.Project. <a href="openFile:C:\Users\kingdee\Desktop\ImageEditor-Android-master\imageeditlibrary\build.gradle">Open File</a> HOT 1
- Doesn't work with new Android Gradle 3.0 plugin HOT 18
- java.lang.NoClassDefFoundError: Failed resolution of: *****/R$raw; HOT 8
- can't merge libs in a aar library HOT 4
- Error:Could not get unknown property 'prepareReleaseDependencies' for project ':someLib' of type org.gradle.api.Project. HOT 9
- why it accurs error ? HOT 5
- how to embedded .aar file HOT 4
- The fixed version !!!
- task generateRJava generates attr that can't find HOT 1
- Error:Could not get unknown property 'generateReleaseAssets' for project ':app' of type org.gradle.api.Project. HOT 2
- Could not find sdklib.jar (com.android.tools:sdklib:25.3.2).
- ERROR: Cannot choose between the following variants of project :ble-interface: HOT 2
- Maybe here is a good choice of fat-aar, supoort android gradle plugin 3.0.0-3.4.2 and gradle 4.6-5.1.1.
- [fix] fat-aar getMergedInputResourceSets
- 谁有gradle 3.6.1解决方案 HOT 1
- example 不能正常编译
- Failed resolution of: Landroidx/lifecycle/DefaultLifecycleObserver
- How to modify the exported file name?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from android-fat-aar.