Android Studio 要求我将 gradle 升级到 3.5.1 版,但是一旦我这样做,它就不再同步了,尽管我没有报告任何明显的错误......
出现的唯一错误消息是“Gradle 项目同步失败。基本功能(例如编辑、调试)将无法正常工作。”
22:32 Gradle 同步失败:org / jetbrains / plugins / gradle / util / GradleConstants 有关更多详细信息,请咨询 IDE 日志(帮助 | 显示日志)(18 秒 224 毫秒)
已经尝试清理项目、重建和无效/重新启动,但没有任何效果
有人能帮我吗?
我的构建脚本:
buildscript {
ext.kotlin_version = '1.3.50'
ext.anko_version='0.10.8'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: …Run Code Online (Sandbox Code Playgroud) 在 Android Studio 中,我收到错误消息:
Generating signed Bundle requires you
to update the Android Gradle plugin
to version 3.2.0 or higher
Run Code Online (Sandbox Code Playgroud)
如果我单击“关闭此对话框并更新插件”,它会转到另一个提示,询问是否更新。除了关闭提示之外,单击“更新”似乎什么也不做。
所有其他类似的问题和建议都来自几年前,最新版本的 AndroidStudio 具有不同的界面,在这种情况下没有帮助。
我在跑步:
更新:以下是用于设置项目结构的 AndroidStudio UI 屏幕截图:
我使用 git-bash 在 github 中克隆了我的旧 androidsutio 项目之一。我在加载项目时遇到了 Gradle Sync 问题。所以我什至无法在android studio项目中看到我的java和src文件。(该项目被完美克隆。我能够看到所有文件都在那里)。我认为问题出在非 ASCII 的项目路径上,但我不太确定。因为路径是“C:\Users\absin\AndroidStudioProjects\projectname”。我的电脑设置为使用韩语,但是路径上没有韩语!你能告诉我我做错了什么吗?先感谢您。
*我以前在构建项目时使用 android 3.0,现在我使用的是 android 3.5
这是我的应用程序 gradle 代码
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "com.example.absin.firebasebus"
minSdkVersion 16
targetSdkVersion 26
versionCode 1
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'])
//noinspection GradleCompatible
implementation 'com.android.support:appcompat-v7:26.1.0'
compile 'com.android.support:recyclerview-v7:26.+'
implementation 'com.github.zagum:Android-SwitchIcon:1.3.8'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
//noinspection GradleCompatible …Run Code Online (Sandbox Code Playgroud) 我刚刚从github导入了一个项目,在尝试运行项目后,我意识到run按钮是灰色的.换句话说,我无法运行该项目.有人知道如何解决这个问题吗?
android studio 4.1 没有像以前版本那样的 gradle 设置。目前我在 5.6.2 上受到限制。如何升级?
我想更新到 android gradle 插件 7.0。有什么方法可以测试我需要在项目或代码中进行哪些更改?android studio 有没有预览工具?
android gradle android-studio android-gradle-plugin android-gradle-7.0