Build using gradle in cmd fail - android-gradle-plugin

Error message
Error listing versions of com.android.tools.build:gradle:0.4+ using class org.gradle.api.internal.artifacts.repositories.resolver.MavenVersionLister$1. Will attempt an alternate way to list versions. This behaviour has been deprecated and is scheduled to be removed in Gradle 2.0
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'TestMain'.
> Could not resolve all dependencies for configuration ':classpath'.
> Could not resolve com.android.tools.build:gradle:0.4+.
Required by:
:TestMain:unspecified
> Failed to list versions for com.android.tools.build:gradle:0.4+.
> Could not list versions using M2 pattern 'http://repo1.maven.org/maven2/[organisation]/[module]/[revision]/[artifact]-[revision](-[classifier]).[ext]
'.
> Could not GET 'http://repo1.maven.org/maven2/com/android/tools/bui
ld/gradle/'.
> Connection to http://repo1.maven.org refused
Am i using incorrect sdk?

You can follow the this tutorial.
http://www.vogella.com/articles/AndroidBuild/article.html
Then turn off your firewall and antivirus software.

Related

Forge 1.7.10 : Error while "gradlew setupDecompWorkspace"

I was trying to setup my modding environement and when i did 'gradlew setupDecompWorkSpace', this happen :
WARNING: You are using an unsupported version of ForgeGradle.
Please consider upgrading to ForgeGradle 4 and helping in the efforts to get old versions working on the modern toolchain.
See https://gist.github.com/TheCurle/fe7ad3ede188cbdd15c235cc75d52d4a for more info on contributing.
#################################################
ForgeGradle 1.2.2-g2ea0336
https://github.com/MinecraftForge/ForgeGradle
#################################################
Powered by MCP unknown
http://modcoderpack.com
by: Searge, ProfMobius, Fesh0r,
R4wk, ZeuX, IngisKahn, bspkrs
#################################################
:extractMcpData UP-TO-DATE
:getVersionJson
Unexpected reponse 403 from http://s3.amazonaws.com/Minecraft.Download/versions/1.7.10/1.7.10.json
:extractUserDev UP-TO-DATE
:genSrgs SKIPPED
:extractNatives UP-TO-DATE
:getAssetsIndex
Unexpected reponse 403 from https://s3.amazonaws.com/Minecraft.Download/indexes/1.7.10.json
:getAssets FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':getAssets'.
> java.lang.NullPointerException (no error message)
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 4.862 secs
C:\Users\Dimitri\eclipse-workspace\forge-1.7.10-10.13.4.1614-1.7.10-src>
I've tried to change the gradle version into the gradle-wrapper.properties from 2.0 to 2.6, It just lasted longer.
I'm not a professional in this but my workaround when I had this problem was replacing forge gradle with anatawa12's fork. I think what happened was some urls changed in one of the forge updates and forge 1.7.10 wasn't considered in the change.
New gradle: https://github.com/anatawa12/ForgeGradle-1.2
How to fix the Problem Method 1:
Follow: https://github.com/anatawa12/ForgeGradle-example#how-to-replace-forgegradle-12-with-anatawa12s-fork
Edit Gradle wrapper to use gradle 4.4.1 or higher.
How to fix the Problem Method 2:
Download and use anatawa12's example gradle template (same commands for cmd):
https://github.com/anatawa12/ForgeGradle-example/archive/master.zip

React-native yarn android #homee/react-native-mapbox-navigation Execution failed for task ':homee_react-native-mapbox-navigation:compileDebugKotlin'

I have installed node package #homee/react-native-mapbox-navigation for quick turn-by-turn navigation in my react-native android app, but when I run yarn android, got below error:
> Configure project :homee_react-native-mapbox-navigation
WARNING:Software Components will not be created automatically for Maven publishing from Android Gradle Plugin 8.0. To opt-in to the future behavior, set the Gradle property android.disableAutomaticComponentCreation=true in the `gradle.properties` file or use the new publishing DSL.
> Task :homee_react-native-mapbox-navigation:compileDebugKotlin
> Task :homee_react-native-mapbox-navigation:compileDebugKotlin FAILED
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
See https://docs.gradle.org/7.3.3/userguide/command_line_interface.html#sec:command_line_warnings
72 actionable tasks: 2 executed, 70 up-to-date
e: /home/cipto/Code/mapbox/mapboxnav/node_modules/#homee/react-native-mapbox-navigation/android/src/main/java/com/homee/mapboxnavigation/MapboxNavigationManager.kt: (11, 19): Unresolved reference: maps
.
.
.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':homee_react-native-mapbox-navigation:compileDebugKotlin'.
> Compilation error. See log for more details
* Try:
> Run with --stacktrace option to get the stack trace.
have been following the gude in readme at https://github.com/homeeondemand/react-native-mapbox-navigation, by the way I installed the package which come from the github (latest version 2.00 master branch) by running this:
yarn add homeeondemand/react-native-mapbox-navigation#master
I have also try that package and got the same error, after I upgrade the kotlin version into 1.6.0, the error went away.

React native screens configuration failed

trying to build an android project,and gradle fails with this exception:
org.gradle.api.ProjectConfigurationException: A problem occurred configuring project ':react-native-screens'.
Caused by: groovy.lang.MissingPropertyException: Could not get unknown property 'archiveClassifier' for task ':react-native-screens:androidJavadocJar' of type org.gradle.api.tasks.bundling.Jar.
According to the PR that created this change you need Gradle 4.10+. So if you update it should work again. You need to update the version of the gradle plugin to 3.3.2 as well. I'm not sure but I do think you could even update to Gradle 5.x and build plugin 3.4+.
Link referenced to Create My Answer

Cargo cannot download dependencies

I'm trying to build local Rust projects with dependencies from various crates using Rust 1.35.0 on Windows 10 x64. Every time I try to run cargo build or cargo run the following error message appears.
error: failed to download from `https://crates.io/api/v1/crates/nom/5.0.0/download`Caused by: [35] SSL connect error (schannel: next InitializeSecurityContext failed: Unknown error (0x80092013) - The revocation function was unable to check revocation because the revocation server was offline.)
I've tried this with several other crates apart from nom and got exactly the same error message with exception of crate name and version. Reading around pointed me to disabling my firewall, this does not work.
How can it be solved.

Could not find support-v4.aar (com.android.support:support-v4:25.2.0)

i am running sample application...... I am using this module..... But i am getting error like this...
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':app'.
> A problem occurred configuring project ':react-native-google-analytics-bridge'.
> Could not find support-v4.aar (com.android.support:support-v4:25.2.0).
Searched in the following locations:
https://jcenter.bintray.com/com/android/support/support-v4/25.2.0/support-v4-25.2.0.aar
My module version is :"react-native-google-analytics-bridge": "^5.2.2"
Here is the screenshot:
In such cases of failure, sometimes the module linking doesn't go well.Please try to link the module manually as described in the link :https://github.com/idehub/react-native-google-analytics-bridge/wiki/Manual-installation
and/or try replace "support-v4:25.2.0" with compile 'com.android.support:support-v13:23.1.1'.
Location: Android/App/build.gradle