gradle

How to execute a gradle task after android dexDebug or dexRelease task

馋奶兔 提交于 2020-03-22 09:05:08
问题 The bounty expires in 9 hours . Answers to this question are eligible for a +50 reputation bounty. Arjun T Raj is looking for an up-to-date answer to this question. I want to run a Gradle task to execute some shell scripts after dexRelease or dexDebug task during the android build. I have tried the below approach task taskAfterDex(type:Exec) { workingDir '.' executable 'sh' args "-c", "source scriptskAfterDex.sh" ignoreExitValue true doLast { println "taskAfterDex completed" } } tasks

How to execute a gradle task after android dexDebug or dexRelease task

浪子不回头ぞ 提交于 2020-03-22 09:04:26
问题 The bounty expires in 9 hours . Answers to this question are eligible for a +50 reputation bounty. Arjun T Raj is looking for an up-to-date answer to this question. I want to run a Gradle task to execute some shell scripts after dexRelease or dexDebug task during the android build. I have tried the below approach task taskAfterDex(type:Exec) { workingDir '.' executable 'sh' args "-c", "source scriptskAfterDex.sh" ignoreExitValue true doLast { println "taskAfterDex completed" } } tasks

JDK 11 + JUnit 5 + Jigsaw: Junit fails to run tests for `module-info`

☆樱花仙子☆ 提交于 2020-03-22 06:41:06
问题 I try to use JUnit 5 in a Gradle project. compileJava and compileTestJava both succeed, but test fails with the strange message Could not execute test class 'module-info'. (message from stacktrace): > Task :test FAILED FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':test'. > There were failing tests. See the report at: file:///Users/axel/git/utility/build/reports/tests/test/index.html The test result file hints me that " failed to execute tests ", but

android studio 使用+错误总结

江枫思渺然 提交于 2020-03-22 00:55:30
3 月,跳不动了?>>> 导入项目 导入eclipse 项目----Import project 似乎会报版本SDK错误问题,然后重构了gradle,不知道什么鬼 导入android studio 项目 open an existing android project-> http://www.gezila.com/tutorials/58197.html 1.报错compile 'com.android.support:appcompat-v7:23.0.1'-->解决http://jingyan.baidu.com/album/c74d600080c02a0f6a595d3d.html?picindex=1 找到实际项目里面的build gradle compile 'com.android.support:appcompat-v7:23.2.1' compile 'com.android.support:design:23.2.1' 将这两行里面的版本内容给改成sdk-》extras->android support library对应的版本号 2.报错 Warning:Gradle version 2.10 is required. Current version is 2.8. If using the gradle wrapper, try editing the

Error:Cause: org/gradle/api/publication/maven/in..

会有一股神秘感。 提交于 2020-03-22 00:36:10
3 月,跳不动了?>>> 当你使用的Gradle版本是2.4以上,Android插件版本是1.3.0以上的时候就会出现这个问题,这时候你只需将android-maven-gradle-plugin插件版本改为 classpath ‘com.github.dcendents:android-maven-gradle-plugin:1.3’ 即可 来源: oschina 链接: https://my.oschina.net/u/2600948/blog/608114

Gradle: Read properties from external file

时光怂恿深爱的人放手 提交于 2020-03-21 20:24:52
问题 I have created a file version.properties in my Android project that contains this data: version.code=1 version.name="1.0.0" And now I want to use this properties in build.gradle file this way: android { ... defaultConfig { ... versionCode project.property('version.code') versionName project.property('version.name') } ... } But, obviously, it doesn't find the properties. How can I add this file to classpath so that I can use its properties? 回答1: To read values from a generic properties file

Progruard and R8 being deprecated - Android Studio 3.6

霸气de小男生 提交于 2020-03-21 12:00:55
问题 I'm getting deprecated warnings in regards to Proguard as well as R8 after upgrading my Android Studio to 3.6. Does that mean we shouldn't use obfuscation in our projects or is there another equivalent option we should consider while building in release mode? The option 'android.enableR8' is deprecated and should not be used anymore. It will be removed in a future version of the Android Gradle plugin, and will no longer allow you to disable R8. Affected Modules: etc 回答1: Does that mean we

Progruard and R8 being deprecated - Android Studio 3.6

瘦欲@ 提交于 2020-03-21 12:00:34
问题 I'm getting deprecated warnings in regards to Proguard as well as R8 after upgrading my Android Studio to 3.6. Does that mean we shouldn't use obfuscation in our projects or is there another equivalent option we should consider while building in release mode? The option 'android.enableR8' is deprecated and should not be used anymore. It will be removed in a future version of the Android Gradle plugin, and will no longer allow you to disable R8. Affected Modules: etc 回答1: Does that mean we

Android App runtime crash after update gradle plugin 3.6

旧时模样 提交于 2020-03-21 07:01:06
问题 Android App was working with no crash, After updating the Gradle plugin to version 3.6 faced the runtime crash below: E/AndroidRuntime: FATAL EXCEPTION: main Process: my.package.app, PID: 9420 java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/appcompat/R$drawable; at androidx.appcompat.widget.AppCompatDrawableManager.<clinit>(AppCompatDrawableManager.java:113) at androidx.appcompat.widget.AppCompatDrawableManager.get(Unknown Source:0) at androidx.appcompat.widget.TintTypedArray

How to import a helper class in buildSrc/build.gradle.kts, settings.gradle.kts, and build.gradle.kts?

故事扮演 提交于 2020-03-21 06:43:49
问题 I'd like to create a class to help me loading different types of properties ( local.properties , gradle.properties , $GRADLE_HOME/gradle.properties , environment variables, system properties, and custom properties files (maybe in other formats like yml , xml , etc.). Also, I'd like to use this in my buildSrc/build.gradle.kts , settings.gradle.kts , and build.gradle.kts . Please consider that we are using Gradle 6.+ . A simple implementation of this class would be (the full implementation