gradlew

Getting error “Gradle version 1.10 is required. Current version is 1.12.” when executing “gradle wrapper”?

女生的网名这么多〃 提交于 2019-12-04 02:52:55
问题 I'm trying to execute gradle wrapper for an Android project, and this error is raised: A problem occurred evaluating root project 'myapp'. > Gradle version 1.10 is required. Current version is 1.12. If using the gradle wrapper, try editing the distributionUrl in /Users/dude/myapp/gradle/wrapper/gradle-wrapper.properties to gradle-1.10-all.zip My wrapper task in build.gradle looks like this: task wrapper(type: Wrapper) { gradleVersion = "1.12" } I recently updated to Gradle v1.12 via Homebrew.

Unable to run gradlew

六月ゝ 毕业季﹏ 提交于 2019-12-03 23:24:52
I've setup a build.gradle file with apply plugin: 'java' . I tried setting up a gradle wrapper using the instructions here , but when I type sudo ./gradlew build , I get an error sudo: ./gradlew: command not found . When I type gradle build , the project builds fine. It's just gradlew that isn't working. I even tried sudo chmod +x gradlew but it didn't work. I'm using Fedora 20, 64 bit and gradle version 1.10. Ok so the solution was to run gradlew on the Linux partition itself. Somehow, when I ran it from a Windows partition mounted in Linux, the file couldn't get execute permissions even

Run application via gradlew with -Xmx and -Xms

只谈情不闲聊 提交于 2019-12-03 23:22:05
I have an application. I run it via gradlew run-app Or debug gradlew debug-app It works. How do I pass '-Xmx' argument into the application which I run (debug)? Is it possible to do so without edditing build.gradle file? I found this Gradle unknown command-line option '-X' I get a similar error when I try gradlew debug-app -Xmx2000m Error FAILURE: Build failed with an exception. * What went wrong: Problem configuring task :debug-app from command line. > Unknown command-line option '-X'. I tried to create a file gradle.properties in GRADLE_USER_HOME directory (by default, it is USER_HOME/

How I can display Log files,System.out.println(), In Android test?

﹥>﹥吖頭↗ 提交于 2019-12-03 14:38:18
I did search a lot but unfortunately couldn't get it to work. Based on my search I found that I need to add following code into build.gradle file. However, Gradle seems doesn't recognize it and always says Geadle DSL method not found: test() test { testLogging.showStandardStreams = true testLogging.events("passed", "skipped", "failed", "standardOut", "standardError") afterTest { desc, result -> println "Executing test ${desc.name} [${desc.className}] with result: ${result.resultType}" } } Update I can confirm above code or better than that following code is working fine if you create a test

How to read a json file into build.gradle and use the values the strings in build.gradle file

六眼飞鱼酱① 提交于 2019-12-03 12:45:02
for example, read the json file in build.gradle and use the json values as strings in the file { "type":"xyz", "properties": { "foo": { "type": "pqr" }, "bar": { "type": "abc" }, "baz": { "type": "lmo" } } } I need to call properties.bar.type and abc should be replaced there. I need to convert these values to string and use in build.gradle file Crazyjavahacking From Gradle you can execute any Groovy code and Groovy already has build-in JSON parsers. E.g. you can use a task that will print your value into stdout: task parseJson { doLast { def jsonFile = file('path/to/json') def parsedJson = new

What does “Sync Project with Gradle File ” really mean?

ぐ巨炮叔叔 提交于 2019-12-03 06:11:53
In Android Studio there is a button Sync Project with Gradle File , I always use it, and it's useful. It will download dependence packages and maybe something more. But what does it really mean? Is there a corresponding command in gradlew ? If I develop an app just using gradle, NO IDE, what commnd should I use ? yole The button does what it says: it updates the Android Studio project model to match the contents of the Gradle build file. There is no corresponding gradlew command because there is nothing to synchronize when you work with the command line directly. The dependencies will be

How to retrieve path to ADB in build.gradle

三世轮回 提交于 2019-12-03 02:00:30
I trying to start application via gradle task . task runDebug(dependsOn: ['installDebug', 'run']) { } task run(type: Exec) { commandLine 'adb', 'shell', 'am', 'start', '-n', 'com.example.myexample/.ui.SplashScreenActivity' } But this code don't work and i get error: a problem occurred starting process 'command 'adb'' However, when i specify the path to adb explicitly, application is started. task run(type: Exec) { commandLine 'D:\\android\\android-studio\\sdk\\platform-tools\\adb', 'shell', 'am', 'start', '-n', 'com.example.myexample/.ui.SplashScreenActivity' } So how can i get a variable

How to check which installed JDK used during Gradle build process

痞子三分冷 提交于 2019-12-02 12:29:55
This was my output of gradle -v (in a project using the wrapper): $ ./gradlew -v ------------------------------------------------------------ Gradle 5.0 ------------------------------------------------------------ Build time: 2018-11-26 11:48:43 UTC Revision: 7fc6e5abf2fc5fe0824aec8a0f5462664dbcd987 Kotlin DSL: 1.0.4 Kotlin: 1.3.10 Groovy: 2.5.4 Ant: Apache Ant(TM) version 1.9.13 compiled on July 10 2018 JVM: 11.0.1 (Oracle Corporation 11.0.1+13-LTS) OS: Linux 3.10.0-862.11.6.el7.x86_64 amd64 See especially this line: JVM: 11.0.1 (Oracle Corporation 11.0.1+13-LTS) I was wishing to switch to

Getting error “Gradle version 1.10 is required. Current version is 1.12.” when executing “gradle wrapper”?

 ̄綄美尐妖づ 提交于 2019-12-01 16:03:14
I'm trying to execute gradle wrapper for an Android project, and this error is raised: A problem occurred evaluating root project 'myapp'. > Gradle version 1.10 is required. Current version is 1.12. If using the gradle wrapper, try editing the distributionUrl in /Users/dude/myapp/gradle/wrapper/gradle-wrapper.properties to gradle-1.10-all.zip My wrapper task in build.gradle looks like this: task wrapper(type: Wrapper) { gradleVersion = "1.12" } I recently updated to Gradle v1.12 via Homebrew. Is it not supported or something? If so, where can I check this sort of thing? A particular version of

React Native : Could not find com.android.tools.build:gradle:2.2.3

回眸只為那壹抹淺笑 提交于 2019-12-01 15:53:37
I'm making an android app using react native and this is the error I'm getting : FAILURE: Build failed with an exception. * What went wrong: A problem occurred configuring project ':react-native-fetch-blob'. > Could not resolve all artifacts for configuration ':react-native-fetch-blob:classpath'. > Could not find com.android.tools.build:gradle:2.2.3. Searched in the following locations: https://jcenter.bintray.com/com/android/tools/build/gradle/2.2.3/gradle-2.2.3.pom https://jcenter.bintray.com/com/android/tools/build/gradle/2.2.3/gradle-2.2.3.jar Required by: project :react-native-fetch-blob