![]() ![]() ( Note: The " \.gradle"-folder is not the same as the " \gradle"-folder)Ĭopying the "\gradle"-folder from another project solved my problems. Looking into that I found out the real problem - the "\gradle"-folder was completely missing. Now the error points me towards a problem within the "\gradle\wrapper\gradle-wrapper.properties"-file. If using the gradle wrapper, try editing the distributionUrl in D:\Files\Code-Project\gradle\wrapper\gradle-wrapper.properties to gradle-7.0.2-all.zip » Minimum supported Gradle version is 7.0.2. So my next step was to check the Project Structure:Īn exception occurred applying plugin request Please fix the project's Gradle settings.Ĭlicking on the "Gradle Settings"-link opened the Gradle settings Window, but the Gradle JDK was already correctly set to version 11: I hade the same problem after moving my project to another computer: Your "\gradle\wrapper\gradle-wrapper.properties" has an incorrect value in the "distributionUrl=":Ĭhange the value in "\gradle\wrapper\gradle-wrapper.properties" toĭistributionUrl=https\:///distributions/gradle-7.0.2-bin.zip Get a copy of the "\gradle"-folder from another working project (or create a new project). gradle"-folder which is a different folder) ![]() Your "\gradle"-folder is missing from your project folder: ![]() The next thing I had to do was edit /platforms/android/adle and /platforms/android/CordovaLib/adle and make sure they both pointed to a valid gradle plugin version.Minimum supported Gradle version is 7.0.2. What I did find is that setting the session variable CORDOVA_ANDROID_GRADLE_DISTRIBUTION_URL before building got me a bit further: export cordova build android I'd love to just leave this as a comment, but I'm apparently not reputable enough.Īfter reading your documentation, I wasn't able to resolve my issue with your suggestion of keeping the Android Studio to "Use default gradle wrapper". Step, which is when you would want to do it so you are never directly modifiying code inside of the-project/platforms At the time of writing this, I cannot tell is there is a way to set the Gradle version at the $ cordova platform add android If you do want to use a newer version of Gradle, you can always change the distributionUrl var in the file mentioned above (however Cordova strongly discourages modifying code within the platforms folder since it is easily overwritten). The solution with Cordova apps is to always keep the Android Studio project set to "Use default gradle wrapper" and ignore the tempting messages to upgrade. This will cause problems because Android Studio and Cordova will now be attempting to build the application with different versions of Gradle and you will get build errors within Android Studio and also with $ cordova build android If you do this, Android Studio will download a new version of Gradle and store it locally and configure the project to use the newly download local Gradle distribution, which is the radio option below the selected “Use default grade wrapper”, which I ended up deselecting because this will cause errors. When you import the project into Android Studio, you will most likely get a message strongly recommending that you upgrade Gradle to a newer version, as shown below: The version of Gradle specified in the distributionUrl var is the version used for the build. N.B: If your path is OK, then use double backslashes '' like above in your path. You can remove it or give the original JAVAHOME location. ![]() Where x and y depened on which version of Cordova / cordova-android are being used to build the native application code. If you go to your gradle.properties configuration file, you will get the following. Inside that folder, the file: /the-project/platforms/android/cordova/lib/builders/GradleBuilder.js exports a variable as shown below: var distributionUrl = process.env || 'http\\:///distributions/' (or $ ionic platform add android, if you are building an Ionic app) creates the native application code at the-project/platforms/android. As you know, running $ cordova platform add android If you are not careful, there can be a mismatch between the version of Gradle that Android Studio uses and the version of Gradle that Cordova / cordova-android specifies in its auto-generated application code. I found other similar posts, but none described how this error can be associated with Cordova or Ionic. This is a solution to the above error that I want to document. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |