In order to get Firebase messaging running I had to do some editing in the build.gradle file in platforms/android. If I do a tns platform remove/add
then my modifications are gone. Is it somehow possible to put something in app/App_Resources/android to prevent from my changes to disappear. A consideration here is that app/** is in Git whereas platform/** is not.
Android Studio uses Gradle, an advanced build toolkit, to automate and manage the build process, while allowing you to define flexible custom build configurations. Each build configuration can define its own set of code and resources, while reusing the parts common to all versions of your app.
Gradle is another build system that takes the best features from other build systems and combines them into one. It is improved based off of their shortcomings. It is a JVM-based build system. That means you can write your own script in Java, which Android Studio makes use of.
NativeScript uses gradle to build android applications. The gradle build files are part of the application template that comes from the android runtime package. Sometimes, if you want to use any external plugins or libraries you need to add some code to the gradle files.
Android Studio installs the latest Android SDK by default, which in most cases should be all that's needed to build a NativeScript app. Configure the ANDROID_HOME environment variable for NativeScript to be able to find the Android SDK, and add the required tools to path.
Then, in your gradle script file, you can access the property by accessing it on the project object as project.myCustomVariable. In this file you can set the default Android configurations like minSdkVersion and targetSdkVersion.
This AGDE feature is built on the experimental Android Gradle plugin feature to support Ninja as a build system. Caution: These changes rely on experimental features in the Android Gradle plugin that are subject to change or removal. Change the project-level build.gradle to refer to Android Gradle plugin version 7.3.0-alpha02 or later. For example:
Yes. Use the app.gradle
file located in App_Resources/Android.
Since this file is specific to your app it won't be removed when it's necessary to remove/add the platform to fix android build issues. I don't recall the exact NS version this was added but I think it was 1.7. Hope that helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With