Comments (10)
Thanks for the report. what Gradle version are you using? I haven't seen this task in my projects.
Cheers.
from android-fat-aar.
Gradle v2.10.
Android Gradle build tools v1.5.0.
Let me know if you need anything else.
from android-fat-aar.
from android-fat-aar.
I've used the tool lately and I had problems with the JNI inclusion in the merged aar file
-First of all, gradle 2.0+ does not worked for me but 1.5 did
-Secondly, if I tried to build the library project alone (no other 'app' modules), the JNI files are not included. I need to have a module 'app' that compiles my library project.
If I'm wrong in any way, please let me know.
PS: This script was a life-saver, I hope we can make it work in the latest gradle versions.thx
from android-fat-aar.
Same issue of @jkgneu12 to me.
Gradle v.2.10 and gradle build tools v.2.1.2
Seems that when "transformNative_libsWithSyncJniLibsForRelease" runs, it will reset the imported jni libs.
Same workaround working: ensuring that "embedJniLibs" and "mergeReleaseJniLibFolders" runs after "transformNative_libsWithSyncJniLibsForRelease".
The project I work on is structured as:
- app project
- depends on: library project (with my jni libs compiled outside of android studio / gradle)
- depends on: provided 3d-party aar (with jni libs inside)
- depends on: library project (with my jni libs compiled outside of android studio / gradle)
from android-fat-aar.
I have the same problem.
My .so files are generated correctly and copied with embedJniLibs into build/intermediates/bundles/release/jni/
, but the transformNative_libsWithSyncJniLibsForRelease
task deletes the file.
If I run gradle build a second time it works. It only fails on first build.
Can you explain to me a little bit more detailed how I can make sure that the tasks run after transformNative_libsWithSyncJniLibsForRelease
?
from android-fat-aar.
I think I figured it out. Does this look reasonable?
} else {
NEEDTOFIX
}
+
+ if (tasks.findByPath('transformNative_libsWithSyncJniLibsForRelease') != null) {
+ // embedJniLibs must run after transformNative_libsWithSyncJniLibsForRelease to
+ // avoid the issue in https://github.com/adwiv/android-fat-aar/issues/15
+ mergeReleaseJniLibFolders.mustRunAfter transformNative_libsWithSyncJniLibsForRelease
+ embedJniLibs.mustRunAfter transformNative_libsWithSyncJniLibsForRelease
+ }
+
bundleRelease.dependsOn embedJniLibs
// Merge Embedded Manifests
from android-fat-aar.
Sorry for the late reply... @michael-customlbs workaround is similar to mine:
// Merge Native libraries
+ if (tasks.findByPath('transformNative_libsWithSyncJniLibsForRelease') != null) {
+ embedJniLibs.mustRunAfter transformNative_libsWithSyncJniLibsForRelease
+ } else if (tasks.findByPath('packageReleaseJniLibs') != null) {
- if (tasks.findByPath('packageReleaseJniLibs') != null) {
embedJniLibs.mustRunAfter packageReleaseJniLibs
} else if (tasks.findByPath('mergeReleaseJniLibFolders') != null) {
embedJniLibs.mustRunAfter mergeReleaseJniLibFolders
} else {
NEEDTOFIX
}
@adwiv I unfortunately cannot share my project, but here is the relevant section of my build.gradle file:
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
minSdkVersion 8
targetSdkVersion 22
versionCode 1
versionName version
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
apply from: 'fat-aar.gradle'
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
testCompile "org.mockito:mockito-core:1.9.5"
embedded 'com.mycompany.mylib:1.8.0@aar'
}
from android-fat-aar.
But now I have the problem that the .so file contains debugging symbols. At least gdb tells me it found them. Any idea how I can fix this?
from android-fat-aar.
Thanks guys.. I took advise from this thread and added it in the latest build. Seems to work for me in test cases. Let me know if there are any issues with 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.