androidstudio

AndroidStudio 3.0: Error:Unable to resolve dependency for ':app@dev/compileClasspath': Could not resolve project :common

匿名 (未验证) 提交于 2019-12-03 10:24:21
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Android Studio 3.0 I have 3 build types: " release " and " dev " project/build.gradle // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { repositories { google() jcenter() } dependencies { classpath 'com.android.tools.build:gradle:3.0.0' } } allprojects { repositories { google() jcenter() } } task clean(type: Delete) { delete rootProject.buildDir } settings.gradle include ':app', ':common' app/build.gradle dependencies { implementation fileTree(dir: 'libs', include: ['*.jar'])

AndroidStudio - Gradle Refresh Failed

匿名 (未验证) 提交于 2019-12-03 08:44:33
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I was using the up to date version of android studio to build my app for android. The gradle wrapper set up the gradle installation and the project was build without errors. Eventually I started getting one error each time I restarted. Gradle: A problem occurred configuring project ':App'. Could not resolve all dependencies for configuration ':App:classpath'. Could not resolve com.android.tools.build:gradle:0.5.+. Required by: App:App:unspecified org.slf4j.spi.LocationAwareLogger.log(Lorg/slf4j/Marker;Ljava/lang/String;ILjava/lang/String;

关于androidstudio的gradle的try again问题

爱⌒轻易说出口 提交于 2019-12-03 04:12:58
  1.打开Grade Scrips的 然后双击“gradle-wrapper.properties”文件。如果处于Project目录结构,依次展开gradle -> wrapper,然后双击“gradle-wrapper.properties”文件。 2. 在gradle-wrapper.properties文件里会看到“distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip”,其一:“gradle-4.6-all.zip”是我们待会要手动下载的gradle版本,其二:“https\://services.gradle.org/distributions/”是我们要下载的链接地址。把链接地址中的“https\:”的“\”去掉,得到一个正常一个正常地址“https://services.gradle.org/distributions/”。 3.接下来下载gradle:打开浏览器,把刚刚得到的正常地址“https://services.gradle.org/distributions/”,复制粘贴到浏览器地址栏里,回车即可进入gradle官网,然后选择对应的步骤二看到的gradle版本——gradle-4.6-all.zip,下载即可。 4. https://jingyan

AndroidStudio Failed to Sync Gradle project, Failed to find target Google Inc

匿名 (未验证) 提交于 2019-12-03 02:42:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: How can I resolve the Gradle Sync problem? I installed the missing SDK versions but the error shown again. Take a look to the screenshots please... Screenshot 1 Screenshot 2 Thank you in advance. 回答1: Your compileSdkVersion must be a number, not a String Example: android { compileSdkVersion 24 buildToolsVersion "24.0.2" defaultConfig { applicationId "com.yourpackage.yourapp" minSdkVersion 11 targetSdkVersion 24 versionCode 4 versionName "1.3" } ... } 回答2: You also need to open up "build.gradle" script and change the classpath to latest

AndroidStudio: Failed to sync Install build tools

匿名 (未验证) 提交于 2019-12-03 01:55:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Going crazy with this error from about a couple of hours. The error is: failed to find Build Tools revision 23.0.0 rc1 But I think to have all update (also the release candidate!) This is the image: thank you. 回答1: Go to File > Project Structure > Select Module > Properties you will landing to this screen Select Build Tools Version same as version selected in Compile Sdk Version. Hope this will resolve your issue. 回答2: I could fix it by changing it to android { compileSdkVersion 23 buildToolsVersion "23.0.3" } in build.gradle file 回答3: I had

AndroidStudio gradle proxy

匿名 (未验证) 提交于 2019-12-03 01:06:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I've tried to run AndroidStudio But It's failing on boot with gradle error: Failed to import Gradle project: Connection timed out: connect I found solution here But I can't find how to set this properties in Android Studio . Setting them in graddle-wrapper.properties doesn't help. 回答1: In Android Studio -> Preferences -> Gradle, pass the proxy details as VM options. Gradle VM Options -Dhttp.proxyHost=www.somehost.org -Dhttp.proxyPort=8080 etc. *In 0.8.6 Beta Gradle is under File->Settings (Ctrl+Alt+S, on windows) 回答2: Go to gradle.properties

AndroidStudio配置LitePal

匿名 (未验证) 提交于 2019-12-03 00:22:01
配置 , 许多书上还有教程都忽略了将LitePal下载下来和拷贝的过程,这里写一个详细的课程 首先,前往GitHub,下载 LitePal 的包. 然后解压,会看到这个 进入download 自己选个版本,然后拷贝. 前往AndroidStudio,将目录换成project类型的 将刚才的文件拷贝到libs目录里,并右键点击这个包,选择add as library选项 之后你会看到build.gradle里面新增了一句话,这个不用管,因为是AS自动给你配置的 之后在build.gradle添加依赖 core后面是你的LitePal的版本号 之后需要在app/src/main下面新建一个assets文件夹,这个文件一般用来存放资源文件 然后在assets下新建一个XML文件, 但是,不要用 这个来新建,主要因为后面给出的两个选项,一个Layout,一个Value,而我们的配置文件却跟这两个无关,不知道这个理由对不对,反正我两个都试了都行不通... 正确的姿势是 然后输入名称,最好加上后缀,反正AS会识别的 之后就是在litepal.xml里填写代码了 <?xml version="1.0" encoding="utf-8"?> <litepal> <dbname value="BookStore" ></dbname><!--dbname代表数据库的名字--> <version

AndroidStudio问题Minimum supported Gradle version is 4.1. Current version is 3.5的解决

匿名 (未验证) 提交于 2019-12-03 00:22:01
用从Unity导出的Gradle导入到AS3.0.1版本里,先是一直报错Error:(6, 0) Gradle DSL method not found: ‘google()’ Possible causes,百度、Bing、谷歌都试了,找到的答案无法解决问题,想了半天然后把google()注释掉了,如下所示。 buildscript { repositories { jcenter() //google() 注释掉了 } dependencies { classpath 'com.android.tools.build:gradle:3.0.1' } } 然后就报错标题的内容,意思就是最低支持Gradle4.1,但是当前的Gradle版本为3.5,找了一下答案,原来是在这里配置: 刚开始是默认选中的Use default wrapper (recommend),这个就是交给Gradle来选择版本,我猜测默认的版本和你AS版本相关,因为现在最新版本是3.1.X的,我还是使用3.0.1,Unity那边确是最新版本,因此导出来的项目应该是与AS3.1.X匹配,因此出现了此次的错误,看下图(关于AS的Gradle配置)。 最后,通过更改为IDEA控制Gradle版本,并在当前AS的目录下找到对应版本的Gradle文件路径,然后点击OK,同步,问题解决。 Remark

AndroidStudio 解决Installation failed with message INSTALL_FAILED_NO_MATCHING_ABIS

匿名 (未验证) 提交于 2019-12-03 00:22:01
问题:运行虚拟机弹出: Installation failed with message INSTALL_FAILED_NO_MATCHING_ABIS. It is possible that this issue is resolved by uninstalling an existing version of the apk if it is present, and then re-installing. WARNING: Uninstalling will remove the application data! Do you want to uninstall the existing application? 网络解决: 更好解决:而是在build中加入 splits { abi { enable true reset() include 'armeabi' , 'x86' , 'armeabi-v7a' , 'x86_64' , 'arm64-v8a' universalApk true } } apply plugin : 'com.android.application' android { compileSdkVersion 17 buildToolsVersion '23.0.3' android{compileOptions.encoding= "UTF

AndroidStudio的 cannot resolve symbol R (找不到R文件)问题

匿名 (未验证) 提交于 2019-12-03 00:18:01
新建一个工程的时候,工程正常无误,但是通过File-Project Structure...里面的对话框添加依赖项时,遇到annot resolve symbol R(找不到R文件)的问题,搜索网上,发现主要有以下解决方法: 1、rebuild project; 2、重启AndroidStudio软件。 均未解决问题,后发现是app目录下的build.gradle中的 compile 'com.android.support:appcompat-v7:25.3.1' compile 'com.android.support:recyclerview-v7:26.0.1' 版本不匹配的原因,通过手动添加依赖项的recyclerview与原版的appcompat版本不一致,后改为 compile 'com.android.support:appcompat-v7:25.3.1' compile 'com.android.support:recyclerview-v7:25.3.1' 问题解决。 转载请标明出处: AndroidStudio的 cannot resolve symbol R (找不到R文件)问题 文章来源: AndroidStudio的 cannot resolve symbol R (找不到R文件)问题