J V*_*nto 5 android-studio android-gradle-plugin
我是一个完全的菜鸟,需要一些帮助。我该如何纠正这个问题?多谢!!哪里错了?
我的档案
gradle-wrapper.properties
#Fri Jul 19 12:04:39 BST 2019
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=
https\://services.gradle.org/distributions/gradle-5.1.1-all.zip=
Run Code Online (Sandbox Code Playgroud)
build.gradle(模块:应用程序)
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
buildToolsVersion '27.0.3'
defaultConfig {
applicationId "com.example.a7700teste"
minSdkVersion 16
targetSdkVersion 28
versionCode 5
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
implementation 'com.android.support:appcompat-v7:28.1.1'
implementation 'com.android.support:design:28.1.1'
implementation 'com.android.support:exifinterface:28.1.1'
implementation 'com.android.support.constraint:constraint-layout:3.0.0'
testImplementation 'junit:junit:4.12'
implementation 'com.google.firebase:firebase-core:17.0.1'
implementation 'com.google.firebase:firebase-auth:18.1.0'
implementation 'com.google.firebase:firebase-database:18.0.0'
implementation 'com.google.firebase:firebase-storage:18.1.0'
implementation 'com.squareup.picasso:picasso:2.71828'
}
apply plugin: 'com.google.gms.google-services'
Run Code Online (Sandbox Code Playgroud)
构建.gradle(项目)
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.3.0'
classpath 'com.google.gms:google-services:4.3.0'
implementation 'com.google.firebase:firebase-core:17.0.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
/*maven {
url: "https://maven.google.com"
}*/
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Run Code Online (Sandbox Code Playgroud)
当我尝试进行 Gradle 项目同步时,它失败了,并显示:
错误消息:无法从“file:/C:/Users/Admin/AndroidStudioProjects/7700teste/gradle/wrapper/”安装 Gradle 发行版。
Hus*_*ied 12
从 Android studio 单击“在 Windows 中”(Ctrl + Alt + s) 或从菜单(文件 > 设置)将打开 Settings。
构建、执行、部署 > 构建工具 > Gradle
将Gradle 用户主目录设置为.gradle路径文件夹,例如:C:/Users/YOUR_UN/.gradle
当前版本是 7.0.2,所以这些是当前自动配置的文件
gradle-wrapper.properties
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip
Run Code Online (Sandbox Code Playgroud)
构建.gradle
classpath "com.android.tools.build:gradle:7.0.2"
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
19308 次 |
| 最近记录: |