Building NORM for Android using gradle #42
Replies: 6 comments 11 replies
-
Have you been able to resolve this yet? |
Beta Was this translation helpful? Give feedback.
-
What version of Android Studio, etc are you using? Since I haven’t been focused on Android for a couple of years, my Android setup may be a little out of date. I could try to update and see if there are issues, but I am able to build the Android native NORM libraries from the gradle project (after I added the missing files to the Github repo). Since I mnainly use C++ frameworks for my development, I haven’t personally worked through the Android Java / jar package build with Android Studio. We have older code that uses the older Android build tools to do that but I don’t think we have updated those build systems to use the Android Studio stuff (I think that may still be in the norm/makefiles/android-ndk directory but doesn’t work with current Android build tools as far as I know). I can check with the developer here that was working that to see if he done something in that area. That is for a separate “serverless” XMPP chat framework we created that uses NORM. That work was done in Java.
|
Beta Was this translation helpful? Give feedback.
-
No – I mean the .so files that a Java .jar file would reference. I _think_ the .aar is a sort of packaging of all of that (i.e. the .jar and any needed native .so libraries and maybe other artifacts to allow for easy incorporation of a package (like NORM) as dependency within another project). I haven’t had need or experience with building the .aar since I don’t do Java Android development myself. I did find some stuff on Stack Exchange or somewhere and thought I had provided a link to that to you in an earlier reply on this (i.e. how to add support to a gradle configuration to build the .aar … or at least hints towards that). Probably some Android developer help forum might be useful for getting assistance on this. I will be happy to incorporate something into the NORM repo here to support that if someone figures out what is needed. I have not had time to pursue it myself. I suspect it would be very straightforward for someone with the right knowledge or experience. I will ask some of my team if they have any clues on this.
Cheers,
Brian
|
Beta Was this translation helpful? Give feedback.
-
Additionally, I think the JNI library would also need to be built in addition to the NORM native library. I suspect a JAR file would be built by Android studio with addition of the JNI library build to the project. I suspect that involves adding a stanza to the norm/android/lib/CMakelists.txt file that includes the source files located in norm/src/java/jni for building the NORM JNI library (for binding the NORM C/C++ API to the NORM Java classes that are located in norm/src/java/src. Once you have the NORM native library, the norm-jni library (and I assume one could statically link libnorm.a into the JNI shared library) and the JAR file that contains the NORM Java classes, you probably have all the ingredients needed the .aar package? I'm speculating a little bit here but that may give you some clues about what needs to be done. |
Beta Was this translation helpful? Give feedback.
-
I also wanted to say in this discussion that I have a solution for the Android build if you wanted to take a look. |
Beta Was this translation helpful? Give feedback.
-
I accepted your pull request and merged it in. Thanks for the contribution! |
Beta Was this translation helpful? Give feedback.
-
I was able to build my .aar file using the gradle method supported, but when I attempt to import that .aar file I am getting the following error:
Null extracted folder for artifact: ResolvedArtifact(componentIdentifier=lib-release_-release.aar, variantName=null, artifactFile=/Users/Owner/AndroidStudioProjects/normApp/app/libs/lib-release_-release.aar, extractedFolder=null, dependencyType=ANDROID, isWrappedModule=false, buildMapping={current_build=/Users/Owner/AndroidStudioProjects/normApp}, mavenCoordinatesCache=com.android.build.gradle.internal.ide.dependencies.MavenCoordinatesCacheBuildService$Inject@6fae679f)
I could be importing the .aar file incorrectly or is there another library file I should be importing into my project?
Beta Was this translation helpful? Give feedback.
All reactions