Discussion:
Android gradle will not copy so in jinLibs of grandson NDK module, how can I handle this elegant?
(too old to reply)
Xu Deheng
2018-07-28 10:33:57 UTC
Permalink
My dev environment:

gradle plugin: com.android.tools.build:gradle:3.1.3

ndk-sdk: android-ndk-r13b

OS : macOS 10.13.6

AS: 3.1.3


My project archetecture:



Project:

app

|------ndka

|-------- ndkb
|----src
|-----main
|-------jniLibs
|---armeabi
|-------libopenssl.so



Module relationship :

app -> ndka (jni) -> ndkb (pure c/c++)


After building , there are no libopenssl.so in APK. But so lib files in ndka/src/main/jniLibs all be there.


Now, I add ndkb/src/main/jniLibs to ndkb build.gradle files in `sourceSets.main.jniLibs` .


But I think it's not elegant.


Anybody get a better idea for this?? Show it to me, plz.
--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk+***@googlegroups.com.
To post to this group, send email to android-***@googlegroups.com.
Visit this group at https://groups.google.com/group/android-ndk.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/a3a5583e-b70f-49f5-bcca-e51993b9e996%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Chris Browet
2018-07-29 10:24:50 UTC
Permalink
Is openssl built by gradle?
If not, I don't think there is another way but using sourceSets
Post by Xu Deheng
gradle plugin: com.android.tools.build:gradle:3.1.3
ndk-sdk: android-ndk-r13b
OS : macOS 10.13.6
AS: 3.1.3
app
|------ndka
|-------- ndkb
|----src
|-----main
|-------jniLibs
|---armeabi
|-------libopenssl.so
app -> ndka (jni) -> ndkb (pure c/c++)
After building , there are no libopenssl.so in APK. But so lib files in ndka/src/main/jniLibs all be there.
Now, I add ndkb/src/main/jniLibs to ndkb build.gradle files in `sourceSets.main.jniLibs` .
But I think it's not elegant.
Anybody get a better idea for this?? Show it to me, plz.
--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk+***@googlegroups.com.
To post to this group, send email to android-***@googlegroups.com.
Visit this group at https://groups.google.com/group/android-ndk.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/77a5ff62-9195-4bc3-a2e7-4512d4ef9b9e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Andrew Esh
2018-07-30 12:41:04 UTC
Permalink
I think the problem is the ndka and ndkb directories. Gradle is not
expecting those. In my project, the path is Project/app/src/main/jniLibs.
Gradle finds that path by default. Here is a discussion that has some good
suggestions:

https://stackoverflow.com/questions/21255125/how-can-i-add-so-files-to-an-android-library-project-using-gradle-0-7
Post by Xu Deheng
gradle plugin: com.android.tools.build:gradle:3.1.3
ndk-sdk: android-ndk-r13b
OS : macOS 10.13.6
AS: 3.1.3
app
|------ndka
|-------- ndkb
|----src
|-----main
|-------jniLibs
|---armeabi
|-------libopenssl.so
app -> ndka (jni) -> ndkb (pure c/c++)
After building , there are no libopenssl.so in APK. But so lib files in ndka/src/main/jniLibs all be there.
Now, I add ndkb/src/main/jniLibs to ndkb build.gradle files in `sourceSets.main.jniLibs` .
But I think it's not elegant.
Anybody get a better idea for this?? Show it to me, plz.
--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk+***@googlegroups.com.
To post to this group, send email to android-***@googlegroups.com.
Visit this group at https://groups.google.com/group/android-ndk.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/13ccaa49-ac11-49b0-965c-1d6a9132d17f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...