How do I install jtransc? - java

The jtransc Github README shows there is a gradle plugin I can add with:
plugins {
id "com.jtransc" version "0.6.8"
}
But whenever I sync the project it shows the following error:
> Could not resolve all artifacts for configuration ':classpath'.
> Could not find com.jtransc:jtransc-main:unspecified.
Searched in the following locations:
- https://plugins.gradle.org/m2/com/jtransc/jtransc-main/unspecified/jtransc-main-unspecified.pom
- https://plugins.gradle.org/m2/com/jtransc/jtransc-main/unspecified/jtransc-main-unspecified.jar
Required by:
project : > com.jtransc:com.jtransc.gradle.plugin:0.6.8 > gradle.plugin.com.jtransc:jtransc-gradle-plugin:0.6.8
and if I go to those URLs in my browser, it returns a 404.
How can I get the jtransc gradle plugin to work in my project?

No idea why plugins block doesn't work, but the following does the job:
buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "com.jtransc:jtransc-gradle-plugin:0.6.8"
}
}
apply plugin: "com.jtransc"
Maybe it's published incorrectly because this gradle.plugin. prefix here seems totally out of place.

Related

Java Dependency Bad Gateway 502 - fi.jasoft.plugin.vaadin 1.0.1 is missing

Inherited a project and am trying to run the build.gradle but the dependency is no long on maven... and I have googled and can't find any other active repos. There's a vaadin-spring 1.0.1 but I don't know if that's the same thing. Any body else run into this issue?
buildscript {
repositories {
//jcenter()
mavenCentral()
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:1.4.2.RELEASE")
classpath('fi.jasoft.plugin.vaadin:fi.jasoft.plugin.vaadin.gradle.plugin:1.0.1')
}
}
apply plugin: "fi.jasoft.plugin.vaadin"
The error:
Could not get resource 'http://dl.bintray.com/johndevs/maven/fi/jasoft/plugin/gradle-vaadin-plugin/1.0.1/gradle-vaadin-plugin-1.0.1.jar'.
> Could not HEAD 'http://dl.bintray.com/johndevs/maven/fi/jasoft/plugin/gradle-vaadin-plugin/1.0.1/gradle-vaadin-plugin-1.0.1.jar'. Received status code 502 from server: Bad Gateway
I tried to do a > build gradle and got the error. I have also tried importing a cache on a teammate that has it working but it does not recognize the cache I have imported by replacing my ~/.gradle with my teammates files
It looks like you've added a dependency on the wrong Maven coordinates.
Looking in the Gradle Plugin Portal I can see that the dependency should be classpath("fi.jasoft.plugin:gradle-vaadin-plugin:1.0.1")
buildscript {
repositories {
mavenCentral()
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
// wrong coordinates:
// classpath('fi.jasoft.plugin.vaadin:fi.jasoft.plugin.vaadin.gradle.plugin:1.0.1')
// correct coordinates:
classpath("fi.jasoft.plugin:gradle-vaadin-plugin:1.0.1")
}
}
The coordinates you had used, fi.jasoft.plugin.vaadin:fi.jasoft.plugin.vaadin.gradle.plugin:1.0.1, do actually exist in the Gradle Plugin Portal Maven repo, but there's no JAR. Why is this?
The reason for this is that Gradle plugins require a marker artifact, so that Gradle can identify plugins using an ID in the plugins block DSL.
For this reason, I recommend you replace using the buildscript {} block to define plugins, and instead use the new plugins {} block.
plugins {
id "fi.jasoft.plugin.vaadin" version "1.0.1"
}

How to publish and use gradle plugin with dependencies on local project?

I am creating gradle plugin which has dependency on my other local module. Some of its gradle build look like this:
dependencies {
compile gradleApi()
compile project(":myDependencyProject")
}
publishing {
publications {
maven(MavenPublication) {
groupId = 'org.my.gradle.plugin'
artifactId = 'some-name'
version = '1.0-SNAPSHOT'
from components.java
}
}
}
gradlePlugin {
plugins {
jsonPlugin {
id = 'org.my.gradle.plugin'
implementationClass = 'my.implementation.class'
}
}
}
When I publish my plugin using gradle publishToMavenLocal and after that I try to use that plugin in another project it fails with this error:
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':my-project'.
> Could not resolve all artifacts for configuration ':my-project:classpath'.
> Could not find org.my.gradle.plugin:myDependencyProject:1.0-SNAPSHOT.
Searched in the following locations: ...
In simple words it could not find dependency for myDependencyProject project. That is why as a next step I tried to create a fat jar and publish it but I have got the same error (the code for gradle plugin was same except I have changed from components java to artifact shadowJar).
Can someone help me how can I publish gradle plugin with its local dependencies and use it in another project ?
Thank you very much for any help.
We ended up using the Gradle shadow plugin to include our module in the published artifact.
One thing that was important to us though, was to only include the local library in it to prevent our end consumer from having 2 copies of some library (such as Kotlin). So we filtered the dependencies
shadowJar {
dependencies {
include(dependency(':your-module-name:'))
}
}

Could not find build gradle 3.0.1

Any clarification on this subject would be greatly appreciated.
I know this has been answered many times but my current issue is that I don't know where or in what file (s) to add this to:
buildscript {
repositories {
...
google() // <-- add this
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
}
}
And this:
allprojects {
repositories {
jcenter()
google()
}
}
Or if that even solves my issue, since I haven't tested it yet.
My initial problem:
The issue seemed to appear after updating both gradle and Android studio.
I'm currently working on a project using libGDX to make an Android app called CastleCrush. When I try to launch a desktop application to test it, it won't launch, and I get this error:
Error:Gradle: A problem occurred configuring root project
'CastleCrush'.
> Could not resolve all files for configuration ':classpath'.
> Could not find com.android.tools.build:gradle:3.0.1.
Searched in the following locations:
file:/Users/TrulsElg/.m2/repository/com/android/tools/build/gradle/3.0.1/gradle-3.0.1.pom
file:/Users/TrulsElg/.m2/repository/com/android/tools/build/gradle/3.0.1/gradle-3.0.1.jar
https://repo1.maven.org/maven2/com/android/tools/build/gradle/3.0.1/gradle-3.0.1.pom
https://repo1.maven.org/maven2/com/android/tools/build/gradle/3.0.1/gradle-3.0.1.jar
https://oss.sonatype.org/content/repositories/snapshots/com/android/tools/build/gradle/3.0.1/gradle-3.0.1.pom
https://oss.sonatype.org/content/repositories/snapshots/com/android/tools/build/gradle/3.0.1/gradle-3.0.1.jar
https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.1/gradle-3.0.1.pom
https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.1/gradle-3.0.1.jar
Required by:
project :
When launching with a virtual Android device it launches just fine.
I'm not working on this project alone and collaboration is done via Git, if that makes any difference. None of the other project members seem to have this issue.
You add this to your Project build.gradle file. its the gradle file that is called build.gradle(Project: your project name). It is usually the first one if you are in the Android project view
Could not find com.android.tools.build:gradle:3.0.1.
Gradle trying to find Android Gradle plugin version 3.0.1 artifact from your local maven repo (inside your computer) and from your listed three remote repository (maven2, oss.sonatype and jcenter).
But not succeeded because given artifact is not available on those repository.
Artifact com.android.tools.build:gradle:3.0.1 is available on google repository.
Find build.gradle file inside your libgdx project and add google maven repo inside allprojects tag
repositories {
mavenLocal()
mavenCentral()
maven { // <-- Add this
url 'https://maven.google.com/'
name 'Google'
}
}
If you're using Android Studio 3.0 or latter version
repositories {
mavenLocal()
mavenCentral()
google() //---> Add this
}
Make sure you're proper internet connection.
Cross-check that, you've not ticked offline work in Global gradle settings.
Before proceeding further take a look on LibGdx doesn't working after updating Gradle (Android Studio 3.0)

Could not find com.github.scottyab:showhidepasswordedittext:0.6

I am trying to add this dependency
com.github.scottyab:showhidepasswordedittext:0.6. in an android app. On building the project I am having this error critically
Error:A problem occurred configuring project ':app'.
> Could not resolve all dependencies for configuration ':app:_debugApkCopy'.
> Could not find com.github.scottyab:showhidepasswordedittext:0.6.
Required by:
push:app:unspecified
Please what am I doing wrong. Kindly assist
latest version of dependency is :
dependencies {
compile 'com.github.scottyab:showhidepasswordedittext:0.8'
}
and don't forgot to add maven repo in the project-level build.gradle file
allprojects {
repositories {
maven {
url "https://jitpack.io"
}
}
}
for more information check here

An error occurred configuring root project 'BoomMenu-master'

When I am importing the project, I am getting the following error:
Error:A problem occurred configuring root project 'BoomMenu-master'.
> Could not resolve all dependencies for configuration ':classpath'.
> Could not resolve com.jfrog.bintray.gradle:gradle-bintray-plugin:1.4.
Required by: :BoomMenu-master:unspecified
> No cached version of com.jfrog.bintray.gradle:gradle-bintray-plugin:1.4 available for offline mode.
> Could not resolve com.github.dcendents:android-maven-gradle-plugin:1.3. Required by:
:BoomMenu-master:unspecified
> No cached version of com.github.dcendents:android-maven-gradle-plugin:1.3 available for
offline mode.
There are some solution which i had applied previously that ,
1 . Try to rebuild your project for 2 to 3 times.
2 . Open your build.gradle file and then add line at top that these lines ,here you must choose build gradle version according to your sdk .
dependencies {
classpath 'com.android.tools.build:gradle:1.3.0'
classpath 'com.jakewharton.sdkmanager:gradle-plugin:0.10.+'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
3. Open your library build.gradle file say in yours you must open boommenu file .
add these lines at top ,
apply plugin: 'com.android.application'
4.Try to changed proxyPort to 8080 and used jcenter instead of Maven. But i had to apply expeption to use HTTP instead of HTTPS. This is what i have in my gradle.build for build script and allprojects
buildscript {
repositories {
jcenter {
url "http://jcenter.bintray.com/"
}
}
}
allprojects {
repositories {
jcenter {
url "http://jcenter.bintray.com/"
}
}
}

Categories

Resources