AndroidStudio项目导入问题

不定期更新

please use JDK 8 or newer


use embedded JDK(recommended) 
Download JDK 8
Select a JDK from the File System

Please use JDK 8 or new

解决方法:

  1. 升级到JDK8
  2. 点击 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找不到
这里写图片描述

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值