- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
构建.gradle
buildscript {
ext.kotlin_version = '1.1.51'
repositories {
jcenter()
mavenCentral()
maven { url "https://jitpack.io" }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0'
classpath 'me.tatarka:gradle-retrolambda:3.6.1'
classpath 'com.google.gms:google-services:3.1.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
应用程序/build.gradle
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.jakewharton:butterknife-gradle-plugin:8.7.0'
}
}
android{
compileSdkVersion = 26
buildToolsVersion = "26.0.2"
defaultConfig {
minSdkVersion = 16
targetSdkVersion = 26
}
...
applicationVariants.all { variant ->
variant.outputs.all { output ->
outputFileName = "newApkName.apk"
}
}
}
如何解决问题:
Unable to find method 'com.android.build.gradle.api.BaseVariant.getOutputs()Ljava/util/List;'.
Possible causes for this unexpected error include: Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.) Re-download dependencies and sync project (requires network) The state of a Gradle build process (daemon) may be corrupt. Stopping all Gradle daemons may solve this problem. Stop Gradle build processes (requires restart) Your project may be using a third-party plugin which is not compatible with the other plugins in the project or the version of Gradle requested by the project. In the case of corrupt Gradle processes, you can also try closing the IDE and then killing all Java processes.
最佳答案
我在 gradle 同步时遇到了同样的错误,特别是与 butterknife 有关,我的解决方案是通过
https://github.com/JakeWharton/butterknife/issues/963#issuecomment-339545297
tldr 在你的项目构建文件中......
buildscript{
repositories {
//other repos will likely exist here like jcenter and mavenCentral
//add this closure
maven {
url "https://oss.sonatype.org/content/repositories/snapshots"
}
}
dependencies {
classpath 'com.jakewharton:butterknife-gradle-plugin:8.7.0'
classpath 'com.android.tools.build:gradle:3.0.0'
//change your version to 9.0.0-SNAPSHOT
classpath 'com.jakewharton:butterknife-gradle-plugin:9.0.0-SNAPSHOT'
//.. other project level dependencies
}
}
}
还要确保你的所有项目包括
allproject{
repositories{
maven {
//this
url "https://oss.sonatype.org/content/repositories/snapshots"
}
}
}
然后与 butterknife 无关的问题是在您的应用程序构建文件中将我的 buildToolsVersions
升级到 “26.0.2”
2018 年 4 月 19 日更新自此与 butterknife 分道扬镳,因为它造成的问题比我使用过的任何其他第 3 方都多。此外,有了完整的 Kotlin 支持,就不需要 butterknife
关于android - 无法找到方法 'com.android.build.gradle.api.BaseVariant.getOutputs()Ljava/util/List;',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46948509/
这个问题在这里已经有了答案: Store output of subprocess.Popen call in a string [duplicate] (15 个回答) 关闭4年前。 我想从 pyt
我正在努力用子进程替换 commands.getoutput。请看下面的代码: import subprocess import commands dir = subprocess.check_out
我有一个 java 程序,我必须从 python 运行,获取输出并将结果存储在 3 个变量中(如果它按预期工作,应该打印 3 个值,每个值在不同的行上)。 这是我正在使用的代码: stdout1 =
我在 Windows 中使用 python 3.6,我的目标是运行 cmd 命令并将输出作为字符串保存在变量中。我正在使用子进程及其对象,例如 check_output、Popen and Commu
问题看起来很简单,但是经过一天的谷歌搜索和查看 stackoverflow 后我找不到任何解决方案。最初我正在开发一个简单的等 ionic 体,它将每 30 分钟向本地网络服务器发送一个特定请求,解析
python : print("Active Device:"+subprocess.getoutput("ip link|grep \"state UP\"|cut -d : -f 2|cut -d
我正在使用 Ubuntu 12.4,并且安装了 matlab。通常,为了从终端调用 matlab,我必须输入“~/MATLAB/bin/matlab”。显然这有点烦人,所以我通过添加 为这个命令起别名
commands.getoutput() 在当前的 Python 2.x 中被弃用,并在 Py3k 中被移除。 如何在干净的 Python 3 中获取类似信息? 最佳答案 逐字等效为 subproce
本文整理了Java中org.gradle.api.tasks.bundling.Zip.getOutputs()方法的一些代码示例,展示了Zip.getOutputs()的具体用法。这些代码示例主要来
有没有办法让 subprocess.getoutput 处理不是有效 UTF-8 的输出?如果命令的输出返回非 UTF-8 字符,则会引发异常。但是,该函数似乎没有编码参数。 File "foo.py
自从在 Android Gradle 插件 0.13.0 中升级到 gradle 2.1 后,这个问题就出现了,但我一直无法理解为什么有时会记录此警告。 考虑此 block 以根据变体类型重命名 AP
本文整理了Java中org.embl.ebi.escience.scufl.enactor.WorkflowInstance.getOutput()方法的一些代码示例,展示了WorkflowInsta
本文整理了Java中com.evolveum.midpoint.xml.ns._public.common.common_3.WorkItemType.getOutput()方法的一些代码示例,展示了
无法找到方法'com.android.build.gradle.internal.variant.BaseVariantData.getOutputs()Ljava/util/List 无法找到方法'
错误:无法找到方法“com.android.build.gradle.api.BaseVariant.getOutputs()Ljava/util/List;”。此意外错误的可能原因包括: Gradl
构建.gradle buildscript { ext.kotlin_version = '1.1.51' repositories { jcenter()
这是我和 friend 在使用Android Studio 2.3.1时开发的一个项目。升级到 Android Studio 3.0 后。发生此错误: Error:Unable to find met
Error:Unable to find method 'com.android.build.gradle.api.BaseVariant.getOutputs()Ljava/util/List;'.
尝试使用 Android Studio 3.0 Canary 1 启动新的 Kotlin 项目会显示此错误。完整跟踪: Error:Unable to find method 'com.android
我是一名优秀的程序员,十分优秀!