A big challenge we’ve up against NDK advancement on the Android online video SDK is incorporating together with all the recommended android studio Gradle-based work-flow. Our main difficulty is configuring native elements within the Android library. The most recent upgrades to android studio and also the Android Gradle plug in imply that Google is purchasing strengthening the developer experience for indigenous creation on Android and also assuring it has class functionality inside their flagship IDE. We’ve now been carefully following the advancement with the plugin that is new. The fresh inclusion of inactive library service compels us into profound dive to migrating out of the conventional Application.mk, Android.mk, also ndk-build labour stream. We chose the plunge and opted to talk about a number of those findings adapting to the brand new build work flow subscribers.
Assembling Indigenous Android Libraries with All the Hottest Experimental Android Plug
The brand new experimental plug should appear comfortable for Gradle end users and individuals comfortable with all the NDK assemble course of action. The majority of the normal flags can be found over the android.ndk version. Google’s total documentation into the experimental plug is currently readily available right here . We come up with an example migration procedure which reflects a number of those challenges we all faced which aren’t cited from the present documentation. The segments below supply micro transformation cases to make sure you find it possible to reestablish your own. Mk data files on your build.gradle area cod 773.
Even the NDK Samples supply a fantastic introduction in to the experimental plug and the way that it is able to be combined together with indigenous improvement. The brand new plugin frees Gradle’s brand new version strategy. This snippet indicates the bottom version settings which is going to be inserted into the consequent conversions. Here will be the identical parameters added in to the android version. Be aware the plug in isn’t going to complain in the event that you define 64-bit architectures plus also a stage variation less-than 2-1 Watch Number 201561.
As Previously Mentioned we made that this sample migration Procedure to emphasize the next Problems we confronted Referencing inactive libraries necessitates including libs entrances to our own repositories version. The snippet below emphasizes solutions for both struggles two and one. Be aware that the lack of my-whole-static-library. In accordance with the aspect the migration procedure could almost certainly be executed only by obeying exactly the NDK samples and sifting via the exact experimental plug guidebook. Let us reevaluate the rest of the troubles.
Very first Assumption
Let us believe we don’t want the whole-static-library and also we can only proceed together with all our additional static libraries, however as said my-other-static-library is dependent upon my-static-library. Which usually means when people have been to attempt to Optimize, Gradle would whine of being unable to eliminate symbols at connection time. We can insert whole-static-library into your ldLibs range, however there isn’t any mechanism to define that structure.
Let us hypothetically say struggle three failed to exist we insert whole-static-library at an identical manner we’ve included others. We’d find a way to pretend, however might struck procedure never seen exceptions when we managed able to predict native techniques from your Java coating since the compiler will strip off purposes it wasn’t used. We can add whole-static-library from the ldFlags wrapped in — even whole-archive, however we have zero solution to define that structure.