Skip to content
Advertisement

Tag: gradlew

How to configure VSCode on Linux to make it apply different JAVA_HOME for Gradle in different projects?

Right now I have a Spring project (needs Java 17) and a minecraft-forge-1.12 project (needs Java 8) on the same system. I want vscode to automatically change JAVA_HOME between /usr/lib/jvm/java-17-openjdk-amd64 and /usr/lib/jvm/java-8-openjdk-amd64 for gradlew command when I switch between these two project. I tried using .vscode/settings.json to do that, but java.import.gradle.java.home cannot change in settings.json, so I can’t change this

Any ideas on how to solve Duplicate class with android jetified?

I’m getting the following error when trying to build an android application with two third-party dependencies. Does anyone know how solve this issue? I have a minimal android project if anyone can help me solve this: https://github.com/mohammedhammoud/geidea-stario10-duplicate-class-deps-error Answer This is now solved. I contacted the maintainers of the libraries, they added flattenpackagehierarchy to proguard which solved it.

./gradlew The operation couldn’t be completed. Unable to locate a Java Runtime

When I run ./gradlew from project folder I get: The same with java: I installed JDK in Android studio, seems it’s installed in ~/Library/Android/sdk/sources/android-28 Setting export JAVA_HOME=/Users/mrgloom/Library/Android/sdk/sources/android-28/ or export JAVA_HOME=/Users/mrgloom/Library/Android/sdk produce error like: How to specify java path for gradlew ? Answer Using JDK shipped with Android Studio and setting export JAVA_HOME=/Applications/Android Studio.app/Contents/jre/Contents/Home helped me.

@Generated annotation using gradlew + dagger

I’m confronting a weird issue using gradlew(4.10.2) + dagger(2.18). The problem is when I call: The build fails with: Task :Common:compileDebugJavaWithJavac FAILED /CommonModule_ProvidesGsonFactory.java:6: error: package javax.annotation.processing does not exist import javax.annotation.processing.Generated; /CommonModule_ProvidesGsonFactory.java:8: error: cannot find symbol @Generated( But if I run the task from Android Studio, the task succeed and the @Generated is not present in the dagger generated class.

Advertisement