'https://services.gradle.org/distributions/gradle-4.1-allからGradleディストリビューションをインストールできませんでした



Could Not Install Gradle Distribution Fromhttps



ASは、3者によるSDKデモを紹介し、エラーを報告します。

エラー:「https://services.gradle.org/distributions/gradle-4.1-all.zip」からGradleディストリビューションをインストールできませんでした



解決:

1. Android Studioでプロジェクトのbuild.gradleを見つけ、バージョン番号を現在のAndroidStudioバージョンに変更します



---注:プロジェクトを問題なく開きます。このファイルのコードをプロジェクトに直接コピーするだけです。

dependencies { //classpath'com.android.tools.build:gradle:3.0.1' //third-party sdk classpath'com.android.tools.build:gradle:3.5.0' //modified }

2.gradle-wrapper.propertiesファイルを見つけます

問題なくプロジェクトを開きます。このファイルのこのコードは、コピーするだけです。



#Third party sdk #distributionUrl=https://services.gradle.org/distributions/gradle-4.1-all.zip #after edited distributionUrl=https://services.gradle.org/distributions/gradle-5.4.1-all.zip

つまり、これら2つのファイルのバージョンを一致させるだけです

3、minSdkVersionを削除し、プロジェクトを同期します

ERROR: The minSdk version should not be declared in the android manifest file. You can move the version from the manifest to the defaultConfig in the build.gradle file. Remove minSdkVersion and sync project Affected Modules: app

4、リファクタリングを行う