Updating android gradle plugin and gradle in React native projects - android

Whenever I start a new React Native project and open the android part in the android studio. I get a message to update gradle plugin and gradle .
And updating them leads to erroneous imports which were previously working fine.
So, is there any limitation on gradle plugin or gradle for react-native android projects ?

Related

React Native: what's the difference between Android Gradle Plugin in build.gradle file and Android Studio?

In my React Native project I'm using react-native#0.63.4, and following the migration guide from a previous version, I have the following line in my android/build.gradle file:
classpath('com.android.tools.build:gradle:4.1.3')
When I recently opened the project in Android Studio it recommended I upgrade my Android Gradle Plugin from 4.1.2 to 4.1.3.
What I Want To Know: What's the difference between the Android Gradle Plugin version referenced in my build.gradle file and the one in Android Studio? What effect does each have on the other, and how is each used in my app itself?
First of all, let's start with what build.gradle does:
Gradle is an open-source build automation tool that is designed to be flexible enough to build almost any type of software.
The Android Studio build system is based on Gradle, and the Android Gradle plugin adds several features that are specific to building Android apps.
Gradle build scripts are written using a Groovy or Kotlin DSL.
There are several differences on versions like:
Incremental Builds
Build Caching
Incremental Subtasks
Incremental Annotation Processing etc.
When you update Android Studio, you may receive a prompt which is telling you upgrade your project gradle. This is because you upgrade your Android Studio plugin, not the project. With this upgrade you can have some developed functionalities in gradle like above.

What is gradle plugin (for example gradle plugin 4.1.1)?And Where is it stored on computer?

I am using Android Studio. And I have come across the term called gradle plugin. I know what the gradle is and I have already downloaded it on my pc. Actually I want to know where does the gradle plugin 4.1.1 go after the project build successfully. I am successfully to use gradle locally into my project but when it comes to use gradle plugin I have to connect my computer to the internet everytime I create a new project. Is there any way I can use gradle plugin locally?
At least one time you should need to sync with your gradle plugins when you creating a new project then after you can use offline gradle option

What about the installation process in gradle to run the project?

I didn't know how to use the gradle.I am downloaded the gradle in this link. https://www.gradle.org/downloads
Right now I am using the Android eclipse.Let me know gradle would be used in Android eclipse or Android Studio?
What about the installation process in gradle to run the project?
Android studio is flexible Gradle-based build system. It contains gradle by default. See this: https://developer.android.com/sdk/installing/studio.html
For eclipse you can use plugin. Here's a link: http://gradle.org/docs/current/userguide/eclipse_plugin.html

Is it possible to use crosswalk-cordova inside of Android Studio?

Is it possible to build a crosswalk-cordova app inside of android studio?
It looks like you need to use ANT at this point.
Does anyone know if this is on the roadmap now that android studio is out of beta?
Our team just built an android wear app so we need to use android studio to create a build and we'd like to start using crosswalk.
I put together some instructions here: https://diego.org/2015/01/07/embedding-crosswalk-in-android-studio/
You can do this with gradle by adding the maven repo:
repositories {
maven {
url 'https://download.01.org/crosswalk/releases/crosswalk/android/maven2'
}
}
And then the version of crosswalk that you want:
compile 'org.xwalk:xwalk_core_library:10.39.235.15'
Sample Code: https://github.com/dougdiego/CrosswalkDemo
I was able to get this working. You need to re-arrange the project structure a bit and use "modules" I created a CordovaLib module and a xwalk_core_library module both "Android Libraries" and i referenced CordovaLib from my main project and set xwalk_core_library as a dependability for cordovalib.
Make sure to create the xwalk_core_library under the package name org.xwalk.core.
See screen shot for project stucture and the xwalk_core_library gradle file.
Put the .so files into a jniLibs directory and the android build correctly packages them into your app.
I followed this article to help with building. I plan on setting up seperate builds for x86 and arm.
http://ph0b.com/android-studio-gradle-and-ndk-integration/#mygradlefile
I have this working in this github project. Let me know if you run into any issues.
https://github.com/twilly86/CrossWalkAndroidStudio
In my case, the project with cordova android platform version 4.1.1 (For example Cordova CLI version 5.2.0) works, the Android Studio can build the project.
However, the project with cordova android platform version 5.1.1 (For example Cordova CLI version 6.2.0) has the issue, the Android Studio can not build the project because the Gradle sync brings the error such as
exception during working with external system: ndk
The critical difference between 4.1.1 and 5.1.1 is the build.gradle file.
In 4.1.1 the build.gradle file choose appropriate gradle version and android plugin version. (like gradle version 2.2 and plugin version 1.0.0+).
In 5.1.1 the build.gradle file does not do such a thing.
I fix this issue by manually setting the gradle version to 2.2 and plugin version 1.0.0. This can be done in the Android studio by opening the dialog
File > Project Structure > Project.

issues in phonegap android version(1.7)

Previously i have used phonegap 1.1.0 jar, 1.1.0 js and plugins like childbrowser and system notification.It was working fine.I have a problem for blackscreen application(Android: BlackScreen in Application)
so I have used cordova-1.7.0.jar and cordova-1.7.0.js in android phonegap app.But I am getting error in the plugin.
Error
at Compile time
context cannot loaded,many classes cant imported.
The old plugins are incompatable with the current version, best to reinstall the plugins from scratch.
see:
http://simonmacdonald.blogspot.co.uk/2012/04/migrating-your-phonegap-plugins-to.html

Categories

Resources