aws codebuild runtime verison not supporting latest gradle version 7 - aws-codebuild

I am trying to build my java springboot cod using gradle 7 but getting this error while requires Gradle 6.8.x, 6.9.x, or 7.x. The current version is Gradle 5.6. How can i get the latest version of gradle

Hard to tell without much details on the build failure. I had issues myself trying to build in CodeBuild with gradle 7 and I solved by:
Make sure the source code pulled by CodeBuild contains the gradle/wrapper folder and all its contents (including the jar file).
Check in the gradle-wrapper.properties have the distributionUrl to the gradle distribution for your project.
Use ./gradlew build as a command in CodeBuild.

Related

How to solve Could not find com.android.tools.build:gradle:4.1.1.?

Can't build react native app in android studio.
I tried:
Sync Project with Gradle Files, but I can't do it because of an
error
File -> Invalidate Caches/ Restart
Clear cache from $HOME/.gradle
Delete $HOME/.gradle
Change com.android.tools.build:gradle version on 2.3.0, because it's
the latest version in this list
(https://repo.jfrog.org/artifactory/libs-release-bintray/com/android/tools/build/gradle/), but when I use npx react-native init projectName, used Android Plugin Version 4.1.2, but this version there isn't in this list.
Also know the difference between Gradle, Android Gradle Plugin,
Gradle Wrapper, already read https://developer.android.google.cn/studio/releases/gradle-plugin?hl=en. I tryied to use the latest Gradle v. 6.8.2 and Android Gradle Plugin v. 4.1.2, it also didn't help to build the project.
Change distributionUrl in
projectName/android/gradle/wrapper/gradle-wrapper.properties
Change in File->Settings->Build, Execution, Deployment->Gradle use
Gradle from Specified location and set C:/Gradle/gradle-6.8.2, it didn't help and left it at default
I know there are exactly the same questions on stackoverflow and on github, but the solutions haven't helped.
Build output:
Could not find com.android.tools.build:gradle:4.1.1.
Searched in the following locations:
- https://jcenter.bintray.com/com/android/tools/build/gradle/4.1.1/gradle-4.1.1.pom
If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
Required by:
project :react-native-settings
Add google Maven repository and sync project
Open File
Now used:
Gradle v. 6.5
Android Gradle Plugin v. 4.1.2
gradle-wrapper 6.5-all
Android Studios 4.1.2
Android SDK Platform: Android 10, 9, 8.1, 8.0, 7.1.1, 7.0
Your google Maven library is missing. Rebuild project after adding it

How can I upgrade react-native gradle version

I need help.
I can't upgrade gradle version of my react-native project.
I try a lot of things, downloaded last version of Android Studio & SDK Tools etc.
I changed this file \android\gradle\wrapper\gradle-wrapper.properties, I tried to upgrade using npm install -g react-native-git-upgrade but still I can't upgrade it.
When I react-native eject It's exports
"distributionUrl=https://services.gradle.org/distributions/gradle-2.14.1-all.zip"
Waiting for answers.
In android/build.gradle you have to edit this line
classpath 'com.android.tools.build:gradle:x.y.z'
Change x.y.z with the version you want. Edit it with Android Studio then click Sync now
In {yourProject}\android\gradle\wrapper\gradle-wrapper.properties, update:
distributionUrl=https\://services.gradle.org/distributions/gradle-{your version}.zip
Find your version of gradle with
gradle --version
You may need to install gradle wrapper if you haven't already.
you can go to https://services.gradle.org/distributions/ and check that latest -all.zip version of gradle and update the same in your gradle-wrapper.properties file. When you run your react-native app the next time, your gradle will first get upgraded and then run.
There are two things
Android Gradle Plugin
You can see the version of it in android/build.gradle file and update it using Daniel's answer here
Gradle version
You can see this in android\gradle\wrapper\gradle-wrapper.properties file and update it using the answer mentioned here
To know the difference between them refer following links:
https://developer.android.com/studio/releases/gradle-plugin
difference between android gradle plugin and gradle
Open Android Studio and navigate to File → Project Structure
Then click on the Project option.
then choose the latest version of Gradle. After that click on Ok.
From Gradle's site:
https://gradle.org/install/#with-the-gradle-wrapper
Upgrade with the Gradle Wrapper If your existing Gradle-based build
uses the Gradle Wrapper, you can easily upgrade by running the wrapper
task, specifying the desired Gradle version:
$ ./gradlew wrapper --gradle-version=6.6.1 --distribution-type=bin
Note that it is not necessary for Gradle to be installed to use the
Gradle wrapper. The next invocation of gradlew or gradlew.bat will
download and cache the specified version of Gradle.
$ ./gradlew tasks
Downloading https://services.gradle.org/distributions/gradle-6.6.1-bin.zip ...
Run these commands in your project's android folder
I had opened my project in Terminal and ran open -a /Applications/Android\ Studio.app to open Android Studio but so that it can access node to download my gradle version which it did automatically.
Learned from this original post: React Native on Android: Cannot run program "node": error=2, No such file or directory
For react native
Go to File -> Project Structure -> Change gradle version to 6.1.1 plugin version to 4.0.0
Try different combinations
Use this link - https://developer.android.com/studio/releases/gradle-plugin.html#updating-gradle

Dexguard mapping files not being uploaded for Android Plugin for Gradle 3.0+

We are using Dexguard and the latest Fabric Gradle Plugin version 1.25.2. However, when we run the build with Android Plugin for Gradle 2.3.3, we see the gradle task run for '{namespace}:crashlyticsUploadDeobs{flavor + buildvariant}, but with Android PLugin for Gradle 3.0.1, we don't see this gradle task run and the logs in Crashlytics are not de-obfuscated.
My assumption is that this is the task that uploads the Dexguard mapping files up to Crashlytics.
I see the Fabric Gradle Plugin version 1.24.0 changelog indicates that it addressed this very issue for Proguard. Could there be another issue for Dexguard that needs to be addressed in the Fabric Gradle Plugin?
With help from GuardSquare I was able to identify the issue. Dexguard 8.1 provides a 'dexguard-partial' plugin that let's you exclude dexguard for certain buildTypes. By excluding dexguard on debug builds, you get faster build times. However, this 'dexguard-partial' plugin does not appear to be recognized by Fabric's plugin for Gradle. Therefore, those tasks for uploading the Dexguard mapping files to Crashlytics, never run.
I was able to resolve this issue by switching from the 'dexguard-partial', back over to the 'dexguard' plugin and adding the following conditional check to ensure the plugin is only included for Release builds:
getGradle().getStartParameter().getTaskRequests().toString().contains("Release")
This keeps our build times down for debug builds, by excluding dexguard for those builds. And resolves the Crashlytics issue by including dexguard for release builds.

use gradle to compile any android project in first time,gradle.zip always download again?

ext:
OS: window8 x64
android studio 2.1.3
gradle plugin 2.1.3
gradle 2.14.1
I have already download gradle-2.14.1.zip when compile project last time, use git clone project from github, modify graldw-plugin version and distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip in graldle-wrapper.properties
In embed Terminal run gradlew build it download gradle again,like this(sorry pic not allow enbed) (redundant file take up more C disk rest space) how to solve?

IntelliJ IDEA 14.1.4 + Gradle: Cannot Compile Groovy Files

Each time I attempt to create a new IntelliJ 14.1.4 project on Windows with Gradle integration I receive the following error during the 'Make' command when I have any Groovy source files included in the project...
Error:Cannot compile Groovy files: no Groovy library is defined for module 'GradleCommandLine'
I have tried:
Creating a Gradle project through the new project wizard in IntelliJ, choosing Groovy as a an 'Additional Library'
Creating a new Gradle project outside of IntelliJ using the gradle init --type groovy-library command, then opening IntelliJ which finds the gradle.build file and automatically links to the project
Converting an existing project that was working with the IvyIDEA plugin to a Gradle build
I have tried adding (made sure) my groovy-all library as a 'Global Library' within the project structure
Each of these gave me the same 'Cannot compile Groovy files' error.
What does work:
I can run the gradle war command which compiles correctly and I can deploy the build war to an application server (in my case Tomcat 7.0.47)
However in watching the Getting Started with Gradle in IntelliJ IDEA 13 (they do not have one for IntelliJ 14) demo video, they are able to just run the standard 'Make' and add the unexploded war as a build artifact.
Also had a colleague using the Mac version of IntelliJ 14.1.4 do the same 'I have tried' attempts above and he did not run into any issues. They even imported the same project I was having issues with and it was able to do the 'Make' without any changes to settings.
Pointing to local Gradle installation solved issue. There was an issue with a corporate proxy preventing the Gradle distribution from installing properly.