我通过删除本地目录等清洗整个项目~/.gradle,~/.m2 ~./android并~/workspace/project/.gradle和艇员选拔File -> Invalidate Caches / Restart...Android Studio中.现在执行命令./gradlew会导致以下输出:
usr$ ./gradlew tasks
Error: Could not find or load main class org.gradle.wrapper.GradleWrapperMain
Run Code Online (Sandbox Code Playgroud)
不用说,我删了太多,问题是如何再次修复?你有任何想法如何解决这个问题?
我刚刚注意到Gradle 发布了2.12版,根据发行说明,脚本的编译速度提高了20%.我想在Android Studio中升级到该版本.
我使用V1.5.1和设置,我选择了"使用默认gradle这个包装"选项,这意味着不是使用本地gradle这个是安装每一个项目,一个特定版本的Gradle将用于每个项目.使用的版本是build.gradle文件中定义的版本.例:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.5.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
Run Code Online (Sandbox Code Playgroud)
现在如果我改变它:
classpath 'com.android.tools.build:gradle:2.12'
Run Code Online (Sandbox Code Playgroud)
然后Android Studio找不到该版本并抛出错误.显然,AS首先尝试在本地缓存中找到二进制文件(Android Studio/gradle/m2repository),然后尝试从bintray下载它:
https://jcenter.bintray.com/com/android/tools/build/gradle/2.12/gradle-2.12.jar
Run Code Online (Sandbox Code Playgroud)
浏览已发布的版本看起来像这里的最新版本是v2.1.0-alpha1.
我有一个List<MyClass> MyList地方
public class MyClass
{
public string name { get; set; }
public string value { get; set; }
}
Run Code Online (Sandbox Code Playgroud)
给定一个名字,我想获得相应的价值.我目前实现的目的是:
MyList[MyList.FindIndex(item => String.Compare(item.name, "foo", 0) == 0)].value
Run Code Online (Sandbox Code Playgroud)
有更清洁的方法吗?
我整个今天都遇到了这个奇怪的错误 - 任何人都知道这里出了什么问题?
据我所知,我一直在正确使用multidex库(以下是来自app.gradle文件):
defaultConfig {
applicationId "com.example.simon"
minSdkVersion 14
targetSdkVersion 23
versionCode 1
versionName "1.0"
/*Enabling multidex*/
multiDexEnabled true
}
dependencies {
/* Enabling multidex*/
compile 'com.android.support:multidex:1.0.1'
}
Run Code Online (Sandbox Code Playgroud)
我的顶级gradle文件非常基本:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.3.0'
classpath 'com.google.gms:google-services:1.3.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
Run Code Online (Sandbox Code Playgroud)
错误:
Executing tasks: [:app:generateDebugSources,
:app:generateDebugAndroidTestSources]
Parallel execution with configuration on demand …Run Code Online (Sandbox Code Playgroud) 我正在使用Android studio 1.3.1并且无法同步Gradle项目错误:
Error:Unable to start the daemon process: could not reserve enough space for
object heap.
Please assign more memory to Gradle in the project's gradle.properties file.
For example, the following line, in the gradle.properties file,
sets the maximum Java heap size to 1,024 MB:
org.gradle.jvmargs=-Xmx1024m
Run Code Online (Sandbox Code Playgroud)
我的默认org.gradle.jvmargs=-Xmx2048和MaxPermSize=512m它毕竟是我看这个错误,有谁能够告诉我为什么我收到此错误?
我通过virtualbox在windows上运行boot2docker 1.4.1.我支持MITM https证书的代理.我通过添加以下行来配置代理/var/lib/boot2docker/profile:
export HTTP_PROXY=<proxyhost>:80
export HTTPS_PROXY=<proxyhost>:80
DOCKER_TLS=no
EXTRA_ARGS="--insecure-registry index.docker.io"
Run Code Online (Sandbox Code Playgroud)
但是当我跑步时,docker@boot2docker:~$ docker run hello-world我得到了
Unable to find image 'hello-world:latest' locally
Pulling repository hello-world
FATA[0006] Get https://index.docker.io/v1/repositories/library/hello-world/images
: x509: certificate signed by unknown authority
Run Code Online (Sandbox Code Playgroud)
请帮我弄清楚忽略证书错误的正确方法.谢谢!
我只是想知道Gradle的依赖树下的(*)是什么意思.我一直在网上搜索,找不到任何答案.
+--- org.apache.httpcomponents:httpclient:4.2.6 -> 4.5 (*)
| +--- org.apache.jena:apache-jena-libs:2.12.1
| | +--- org.apache.jena:jena-tdb:1.1.1
| | | +--- org.apache.jena:jena-arq:2.12.1
| | | | +--- org.apache.jena:jena-core:2.12.1
| | | | | +--- org.slf4j:slf4j-api:1.7.6 -> 1.7.10
| | | | | +--- org.apache.jena:jena-iri:1.1.1
| | | | | | +--- org.slf4j:slf4j-api:1.7.6 -> 1.7.10
| | | | | | \--- log4j:log4j:1.2.17
| | | | | +--- xerces:xercesImpl:2.11.0
| | | | | | \--- xml-apis:xml-apis:1.4.01
| | | | | \--- log4j:log4j:1.2.17 …Run Code Online (Sandbox Code Playgroud) 我有一个多模块gradle项目,看起来像这样:
Parent
|--server
|--application (android module)
+--common
Run Code Online (Sandbox Code Playgroud)
服务器测试依赖于通用模块测试.为此,我补充道
testCompile files(project(':common').sourceSets.test.output.classesDi
compileTestJava.dependsOn tasks.getByPath(':common:testClasses')
Run Code Online (Sandbox Code Playgroud)
它运作得很好.不幸的是,当我试图对同样依赖于公共模块测试的应用程序模块做同样的事情时,它也行不通.它失败了:
Build file 'application\build.gradle' line: 103
A problem occurred evaluating project ':application'.
Could not find property 'sourceSets' on project ':common'
Run Code Online (Sandbox Code Playgroud)
谷歌搜索后我也试过了
project.evaluationDependsOn(':common')
testCompile files(project(':common').sourceSets.test.output.classesDir)
Run Code Online (Sandbox Code Playgroud)
但失败了另一个例外:
Project application: Only Jar-type local dependencies are supported. Cannot handle: common\build\classes\test
Run Code Online (Sandbox Code Playgroud)
有想法该怎么解决这个吗?
当我在我的PC上工作时,我有一个成功的构建项目,并且我已经提交并将其推送到我的Git仓库,然后再迁移到OSX.
现在,我在OSX上安装了Android studio最新版本并试图构建同一个项目,它在构建资源时出错.在Manifest中构建资源时,会出现多个错误
找不到与给定名称匹配的资源
对于drawables和字符串.
通过网络浏览,我想可能更新版本的gradle有一些问题.因此,我将AS的安装降级为AS 1.0并使用旧的gradle 2.2.不幸的是,这个版本的gradle也会出现同样的错误.
我build.gradle看起来如下:
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "xxx"
minSdkVersion 16
targetSdkVersion 21
versionCode 4
versionName "1.3"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
sourceSets {
main {
res.srcDirs = [
"/src/main/res"
]
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile files('libs/thermodosdk-1.0.18.jar')
compile 'com.android.support:appcompat-v7:21.0.3'
compile 'com.google.android.gms:play-services:6.5.87'
compile 'com.android.support:support-v4:21.0.3'
Run Code Online (Sandbox Code Playgroud)
将build.gradle在顶层有以下类路径:
dependencies {
classpath 'com.android.tools.build:gradle:1.0.0'
}
Run Code Online (Sandbox Code Playgroud)
堆栈跟踪:
Information:Gradle …Run Code Online (Sandbox Code Playgroud) android gradle android-build android-resources android-studio
我有一条消息流经多个系统,每个系统记录消息进入和退出时带有时间戳和uuid messageId.我通过以下方式摄取所有日志:
filebeat --> logstash --> elastic search --> kibana
Run Code Online (Sandbox Code Playgroud)
结果我现在有这些事件:
@timestamp messageId event
May 19th 2016, 02:55:29.003 00e02f2f-32d5-9509-870a-f80e54dc8775 system1Enter
May 19th 2016, 02:55:29.200 00e02f2f-32d5-9509-870a-f80e54dc8775 system1Exit
May 19th 2016, 02:55:29.205 00e02f2f-32d5-9509-870a-f80e54dc8775 system2Enter
May 19th 2016, 02:55:29.453 00e02f2f-32d5-9509-870a-f80e54dc8775 system2Exit
Run Code Online (Sandbox Code Playgroud)
我想在每个系统中生成一个报告(理想情况是堆积条或列):
messageId in1:1->2:in2
00e02f2f-32d5-9509-870a-f80e54dc8775 197:5:248
Run Code Online (Sandbox Code Playgroud)
做这个的最好方式是什么?Logstash过滤器?kibana计算字段?