When create a Cordova Android project by running Cordova prepare everything seems to be created correctly.
It creates a file called cdv-gradle-config.json with all versions that I want to use (the versions that are verfied from Cordova)
See picture
When I then open the project in Android Studio the build script and gradle seems to run fine. But Android Studio downloads Gradle wrapper 6.8 every time! Regardless of the version in the above file.
And when verifying all other versions for modules and dependencies in Android Studio they all seems to be unresolved:
Modules versions
more issues
And when looking into Gradle, it actually seems to be 6.8, but why is the version not fetched from the gradle config file created by Cordova?
Gradle versions
So my question is, why does it look like this? I have installed nodejs, Gradle and Cordova and they all work fine, except this behaviour.
I know I can just set the versions manually in Android Studio, but that's not the question, the question is why those dynamically versions from the config file doesn't work, and why Android Studio then "defaults" to 6.8 gradle. (I have 7.1.1 installed on my computer, which is verfied by gradle --version
Software used:
Windows 10
Cordova CLI 11
Android Studio 2020.3.1
Gradle 7.1.1 (installed on my machine.)
Gradle wrapper 6.8 (used by Android Studio, why is this??)
Related
Code With Me plugin from JetBrains now works with Android Studio. However each version of the plugin is compatible with a specific build of Android Studio according to this page.
However, Android Studio download page lists only releases. How can I easily find out build number of each Android Studio version, so I could download a version that's compatible with Code With Me plugin?
I have Android-studio 2.3.2 (which is android-studio-ide-162.3934792-linux.zip) installed, which is the latest stable version. I am using fedora 24. I am using meteor 1.4.4.2
When I build an APK using "meteor build" I get this error:
While building Cordova app for
platform Android: Could not find gradle wrapper within Android SDK.
Might need to update your Android SDK. Looked here: ~/Android/Sdk/tools/templates/gradle/wrapper
It seems to me the path to gradle wrapper has changed on the latest version of Android-studio. I don't have a previous version of Android-studio to prove this though. I've searched for previous versions of Android-studio and could not find them. I have searched for a solution but there is no one out there who seems to be solving this issue.
You will find a solution in this other thread and some explanation in this answer
The explanation is that the linux version of cordova does not search for gradle in the Android studio install folders like for Windows (and even for windows it does not find it if android studion is not installed in c:\program files\android\android studio) or Mac .
On Linux (and maybe for Mac&Windows in future versions of Cordova), you have to install a version of gradle and add it to your path (way to install gradle depends on the version of Linux you're using)
The behaviour was different in the past because android sdk was not inside Android studio like it is now. You could find gradle in the ANDROID_HOME/tools folder.
With recent upgrades, Android SDK structure has changed and it is now part of android studio.
Installing android-sdk_r24.4.1-linux.tgz which installs version 25 or higher version by default solved the problem for me. Because I could not find a way to uninstall Android Studio I had to uninstall and re-install my linux.
See https://gist.github.com/rolandboon/0a5abe1d9c6c515c59ec for downloading and installing the sdk
I am trying to open a Android Project in Android Studio 1.0.2 which uses
classpath 'com.android.tools.build:gradle:0.12.+'
as its dependency. On opening the project with above dependency I get the following error message.
The project is using an unsupported version of the Android Gradle plug-in (0.12.2). The recommended version is 1.0.0.
Is there a way to run such projects in Android Studio 1.0.+ without upgrading the Gradle plug-in version
Note:
I can upgrade the gradle version and plugin to get it to work OR simply use older version of Android Studio to open the project.
First approach is not desirable since this being a community project I will prefer to leave majority of files unchanged and changing gradle version will also hinder me from testing the build with 0.12.
To successfully build Android project using Android Studion and Gradle you need to use the AS, Gradle and Android Gradle Plugin with versions which are compatible with each other. Check out this page, it's said here, that you can use Android Gradle Plugin 0.12 with Android Studio 0.8.0 - 0.8.11 and there is no way to use it under Android Studio 1.0.
I suggest you convince other people to switch to the newest version of Android Gradle Plugin because 1.0.0 is the stable one and doesn't contain some bugs which were out there in the 0.12.+.
I am having issue similar to here.
I upgraded from cordova 3.1 to 3.3 because I wanted to use the remote debugging offered in 3.3 and androind 4.4 but now all the JAVA packages are broken for an unknown reason.
having just very basic skill in java I have no idea what is going on.
In cordova 3.3 the cordova api is no more in a jar but in a separate project.
If not already done, do cordova platform android
Then in eclipse re-do "import existing android project into workspace" and you should a second project named CordovaLib.
If cordova-3.1.jar is still in the libs folder, remove it.
Is it possible to use IntelliJ 12 (12.1.6 Ultimate) and Gradle to build Android projects? I can't find any information on doing so outside of Android Studio.
I can get my APK to build just fine, but IntelliJ doesn't seem to pick up the dependencies downloaded by Gradle. I know they're downloaded as I can see them in my cache folder.
Switching from the android plugin to the java plugin works just fine.
I don't think it's possible, as Android Studio is based on IntelliJ 13 (EAP).