gradle

Set resValue independently of buildType or productFlavor?

懵懂的女人 提交于 2021-01-28 19:05:33
问题 Is there a way to use resValue independently of, i. e. outside of, any buildType or productFlavor ? I have some String resources in my Android project that I would like to create from within my build.gradle which don't vary with either build type or product flavor. For example, the following line stores the hash of the current git commit so that it can displayed in the settings resValue "string", "source_git_hash", gitHash I found that I can use the all block in either the buildTypes or the

IntelliJ IDEA (2020.2): Gradle: The cache entry for initialization script (appears to be corrupted)

淺唱寂寞╮ 提交于 2021-01-28 18:54:39
问题 I am working with Intellij Idea (CE) 2020.2.3 And using Gradle 6.7 I have the following behavior in Mac and Windows In the IDE after to had imported the spring-framework project based on Gradle and the latter being configured as follows: From above: gradle user home and gradle home are customs locations Note: the .gradle directory located in the user home is empty . Always when I startup the IDE happens the following process: The project is loaded: Immediately and automatically the project is

pytorch android部署 demo 用自己训练的自定义模型踩坑记录

谁说胖子不能爱 提交于 2021-01-28 14:44:43
记录一个用自己定义的模型(一个稍微改了分类数目的vgg网络,分40类)加到 github项目 里面时遇到的小坑: 2021 - 01 - 26 19:02:42 . 191 19212 - 19370 / org . pytorch . demo E / AndroidRuntime: FATAL EXCEPTION: ModuleActivity Process : org . pytorch . demo , PID: 19212 com . facebook . jni . CppException: aten::_convolution ( Tensor input , Tensor weight , Tensor? bias , int [ ] stride , int [ ] padding , int [ ] dilation , bool transposed , int [ ] output_padding , int groups , bool benchmark , bool deterministic , bool cudnn_enabled ) - > ( Tensor ) : Expected at most 12 arguments but found 13 positional arguments . : / home / xutengfei / .

How to make my Android library source code visible when a user adds the gradle dependency (so code doesn't have to be decompiled in Android Studio)

淺唱寂寞╮ 提交于 2021-01-28 14:30:12
问题 I have an Android library on jitpack.io and let devs add my library but just adding the dependency. But what I've noticed is that if this dependency is added, my library classes have to be decompiled to view the code. So for example, I have a class in my library called ViewStack. When I try to go to the class file to view the source code, it's a decompiled version of the .class file. And thus, all my documentation is not there. How can I make it so the code is entirely viewable (no

How to exclude transitive dependency

*爱你&永不变心* 提交于 2021-01-28 12:16:26
问题 I use JavaMail in the same project with cxf. cxf brings an older version of JavaMail which does not suit me. How to excluded? I did so: compile (group: 'org.apache.cxf', name: 'cxf-rt-bindings-soap', version: apacheCfxVersion) { exclude module: 'geronimo-javamail_1.4_spec' } But it did not help. I find in the war WEB-INF \ lib \ geronimo-javamail_1.4_spec-1.6.jar 回答1: Try this: configurations { all*.exclude module: 'geronimo-javamail_1.4_spec' } 来源: https://stackoverflow.com/questions

Grouping/inheriting properties for tasks in Gradle

北城余情 提交于 2021-01-28 12:11:04
问题 Is there a way to reuse property groups in Gradle? Something that would look like: def propGroup = [ options.fork = true options.forkOptions.executable = ... ] task compileThis(type:JavaCompile) { options.fork = propGroup.options.fork options.forkOptions.setExecutable(propGroup.options.forkOptions.executable) destinationDir = file(xxx) } task compileThat(type:JavaCompile) { options.fork = propGroup.options.fork options.forkOptions.setExecutable(propGroup.options.forkOptions.executable)

gradle.user.home - set in gradle.properties, build.gradle, or settings.gradle to a project-relative location?

自古美人都是妖i 提交于 2021-01-28 11:12:08
问题 By default, gradle.user.home is set to ~/.gradle - I'd like to change it to a directory relative to the project, rather than the developer's home directory. I know you can do so when you invoke gradle, like so: $ gradle --gradle-user-home=./project-relative-directory Or $ gradle -Dgradle.user.home=./project-relative-directory I know you can change the location of the build cache by adding the following to settings.gradle: buildCache { local { // Set local build cache directory. directory = "$

how to make spring data lib compatiable in spring boot 2.x?

佐手、 提交于 2021-01-28 11:00:46
问题 when I run my app using: java -jar soa-happy-rain-service-1.0.0-SNAPSHOT.jar throw this error: :: Spring Boot :: (v2.2.2.RELEASE) 2020-01-02 21:20:52.817 INFO [soa-happy-rain-service,,,] 994 --- [ main] com.sportswin.soa.happy.rain.AppStarter : No active profile set, falling back to default profiles: default 2020-01-02 21:20:55.478 ERROR [soa-happy-rain-service,,,] 994 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter : *************************** APPLICATION FAILED TO START ****************

How to: Gradle Build spring boot app with external config file

荒凉一梦 提交于 2021-01-28 10:38:18
问题 Maven way is very simple: mvn clean install -Dspring.config.location=/path/config.properties How can I do this with Gradle? 回答1: You should specify a task and add jvmArgs for running spring boot application in build.gradle file: bootRun { jvmArgs = ["-Dspring.config.location=/prop.properties"] } or run in command line: gradle clean build bootRun -Drun.jvmArgs="-Dloader.config.location=/path/to/prop/file" 来源: https://stackoverflow.com/questions/52097929/how-to-gradle-build-spring-boot-app-with

No cached version of gradle available for offline mode

和自甴很熟 提交于 2021-01-28 10:16:27
问题 I have no Internet connection at all in my development environment, even temporary Internet is not an option. I have received Android project, but I cannot compile it at all. I get the following message: "No cached version of com.android.tools.build:gradle:2.1.2 available for offline mode" Can I provide the dependencies/caches/etc manually? 回答1: MY SOLUTION Simply Go in : File > Settings > Build, Execution, Deployment > Gradle > Unchecked Offline Mode Now Run your app in device if it's 1st