Could not find com.android.tools.build:gradle:4.0.1 ( or any version )
This solution may only work in Iran. If you know that's working out of Iran, please let others know.
Why would a proxy be necessary? There have been a number of technology-related sanctions against Iran.
Windows
go to -> File | Settings | Appearance & Behavior | System Settings | HTTP Proxy,
and choose -> manual proxy configuration. set host name: fodev.org
and set port number: 8118. now you must find gradle.properties file. that must be in:
Windows: C:\Users\YOURUSERNAME.gradle\gradle.properties OR for
Linux: ~/.gradle/gradle.properties .
if it does't exist, create that yourself and copy this:
systemProp.http.proxyHost=fodev.org
systemProp.http.proxyPort=8118
systemProp.http.nonProxyHosts=*.jitpack.io, *.maven.org
systemProp.https.proxyHost=fodev.org
systemProp.https.proxyPort=8118
systemProp.https.nonProxyHosts=*.jitpack.io, *.maven.org
Mac
Open Network settings by > System Preferences > Network. Then, choose your wifi and click on advanced, which is located on bottom-right of the panel (if there’s a lock at the bottom left of the Network pane, click it to unlock the preference pane). A window would open in which you should go under "Proxies" tab and then check the box for "Web Proxy (HTTP)". There is a textfield named "Web Proxy Server" in which you should set it to fodev.org
and in the next textfield you can enter the port number which is 8118
in this case. The steps may vary depending on the version of macOS and more information about procy server settings can be found on Apple Support Guide. You can also take a look at the screenshot.
The last step is to make sure that have gradle.properties
. On finder, choose Go > Go to Folder and then paste ~/.gradle/
and go (alternatively, you can trigger this menu by holding shift + command + G). If you don't see anyfile under the name ofgradle.properties
, create it with textedit or terminal and paste this code there:
systemProp.http.proxyHost=fodev.org
systemProp.http.proxyPort=8118
systemProp.http.nonProxyHosts=*.jitpack.io, *.maven.org
systemProp.https.proxyHost=fodev.org
systemProp.https.proxyPort=8118
systemProp.https.nonProxyHosts=*.jitpack.io, *.maven.org
Now, you can run your project.
IMPORTANT : After installation of build.gradle 4.0.1 (or any version), restore this settings to previous state and remove the codes.
Android Studio Could not find com.android.tools.build:gradle:4.0.1. Error
I had the same problem for days and i solved that yesterday.
check my answer here :
Could not find com.android.tools.build:gradle:4.0.1 OR 4.0.0 OR any versions
Could not find com.android.tools.build:gradle:6.4.1
You are confusing gradle with the gradle plugin.
The gradle plugin 6.4.1
doesn't exist.
Use the latest stable version:
classpath 'com.android.tools.build:gradle:4.2.2'
Check also the compatibility with the gradle version:
Plugin version Required Gradle version
4.0.0+ 6.1.1+
4.1.0+ 6.5+
4.2.0+ 6.7.1+
Gradle sync failed: Could not find com.android.tools.build:gradle:4.0.1
Can you try use IP address (of fodev.org
? are you sure this is correct?) in this case see whether it works?
You can tick the auto-detect proxy settings
see whether it helps or not.
Related Topics
Write_Secure_Settings Permission Error Even When Added in Manifest
Android Get Activity Returns Null
Very Large Soap Response - Android- Out of Memory Error
How to Disable Home Button in Android
Noclassdeffounderror at Google Play Services V2 Library
Android Opengl Es Transparent Background
Android Mapactivity:Couldn't Get Connection Factory Client
How to Make My Own Custom Dialer in an Android Phone
Is Proguard.Cfg Needed for Library Projects
Could Not Find Com.Android.Tools.Build:Gradle:4.0.1 ( or Any Version )
How to Handle Asynctask's in Actionbaractivity Fragments When Viewpager Is Used
Debug Native Code in Android Library
Android Beginner Difference Between Padding and Margin
How to Get Each Device's Ip Address in Wi-Fi Direct Scenario