不定期更新
文章目录
please use JDK 8 or newer
use embedded JDK(recommended)
Download JDK 8
Select a JDK from the File System
解决方法:
- 升级到JDK8
- 点击
Select a JDK from the File System
或者点击File
选择other setting
,再点击Default Project Structure
,设置本地JDK8所在目录,应用即可。(一升级成千古恨。。。)
android:overridePathCheck=true
Error:(1, 0) Your project path contains non-ASCII characters. This will most likely cause the build to fail on Windows. Please move your project to a different directory. See http://b.android.com/95744 for details.
This warning can be disabled by using the command line flag -Dcom.android.build.gradle.overridePathCheck=true, or adding the line 'com.android.build.gradle.overridePathCheck=true' to gradle.properties file in the project directory.
解决方法:
点了open file之后结果打开的是build.gradle
,但是我不瞎,提示明明是gradle.properties
你有两个选择,是金是银随便你
- 网上各位大神比较鄙视路径使用中文,不过,你可以改成拼音啊
- 打开
gradle.properties
,在最后一行加上android.overridePathCheck=true
就好了
然后try again~~~
Gradle版本低需要升级 Failed to complete Gradle execution
Error:Failed to complete Gradle execution.
Cause:
The version of Gradle you are using (2.14.1) does not support the forTasks() method on BuildActionExecuter. Support for this is available in Gradle 3.5 and all later versions.
解决方法:
#####1. Update Gradle version
Android plugin 3.0.0 requires Gradle version 4.1 or higher. If you’re opening an existing project using Android Studio 3.0 or later, follow the prompts to automatically update an existing project to the compatible version of Gradle.
To update Gradle manually, edit the URL in gradle-wrapper.properties
to the following:
实际上呢,就是修改为下图中的链接里的数
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
#####2. Apply the plugin
If you’re opening an existing project using Android Studio 3.0 or later, follow the prompts to automatically update your project to the latest version of the Android plugin. To manually update your project, include the maven repo and change the plugin version in your project-level build.gradle
file as follows:
简单点说,就是在project的build.gradle里增加修改点东西,就是下边图里显示的这样子(增加google(),修改为图中gradle后边的数字)
buildscript {
repositories {
...
// You need to add the following repository to download the new plugin.
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
}
}
内容抄自(需要爬墙):https://developer.android.com/studio/build/gradle-plugin-3-0-0-migration.html#apply_plugin
AAPT2 error
20180613 使用新版Android Studio已经不会报错
Error:java.util.concurrent.ExecutionException: com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
Error:Execution failed for task ':sample:mergeDebugResources'.
> Error: java.util.concurrent.ExecutionException: com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
解决方法:
在文件gradle.properties
中添加如下内容,点Sync Now
即可
android.enableAapt2=false
流程如下:
Could not find bundletool.jar
AndroidStudio版本为3.1.3
日期:20180612
Could not find bundletool.jar (com.android.tools.build:bundletool:0.1.0-alpha01).
Searched in the following locations:
https://jcenter.bintray.com/com/android/tools/build/bundletool/0.1.0-alpha01/bundletool-0.1.0-alpha01.jar
解决方法
暂时不要点升级,可重新导入,暂时不知道为什么。所提示的文件链接扔到浏览器也是404找不到