I'm trying to add a G+H solution for my app. I've done conversion from HMS toolkit. But after the conversion, it gives me error on xms imports also it's give me error regarding
Could not resolve all artifacts for configuration ':classpath'.
Could not find com.huawei.agconnect:agconnect-apms-plugin:1.5.1.300.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/com/huawei/agconnect/agconnect-apms-plugin/1.5.1.300/agconnect-apms-plugin-1.5.1.300.pom
- https://jcenter.bintray.com/com/huawei/agconnect/agconnect-apms-plugin/1.5.1.300/agconnect-apms-plugin-1.5.1.300.pom
- https://developer.huawei.com/repo/com/huawei/agconnect/agconnect-apms-plugin/1.5.1.300/agconnect-apms-plugin-1.5.1.300.pom
Required by:
project :
Possible solution:
Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html
The problem may be due to your APM plugin. Try changing it to classpath 'com.huawei.agconnect:agconnect-apms-plugin:1.4.1.306' may solve your issue.
For Details,check Docs.
Please try the following solutions.
Make sure
Class path specified
classpath 'com.huawei.agconnect:agcp:1.2.1.301'
classpath 'com.huawei.agconnect:agconnect-apms-plugin:1.2.1.301'
Apply these plugins
apply plugin: 'com.huawei.agconnect'
apply plugin: 'com.huawei.agconnect.apms'
Related
I'm trying to learn Gradle in Eclipse.
Is there any good integration where you can search for a Jar to include in the project?
Right now it's a hit-and-miss operation from my side.
Example:
I want to add the CLI library from Apache Commons. Also the Codec library.
I have added both jcenter() and mavenCentral like this:
repositories {
jcenter()
mavenCentral()
}
and I have tried this (and variations) in the dependencies section:
compile 'org.apache.commons:cli:1.2'
compile 'org.apache.commons:codec:1.10'
but all I get is
Could not resolve: org.apache.commons:cli:1.2
Could not resolve: org.apache.commons:codec:1.10
When searching in search.maven.org, if I search on org.apache.commons I get 111 pages of hits... I haven't found the time to step thru them all.
When searching for commons-cli, it finds a version from 2005... plus a library called
org.mod4j.org.apache.commons cli
No idea what the "mod4" means.
Is the conclusion that Apache commons doesnt exist in these repositories?
How do you do in these cases? How do you come up with the correct "compile"-specification?
Can I for example say "get latest version of this jar" ?
Would love to have a way to do:
gradle search apache-commons --only-latest-version
or something similar. Something like the wonderful GEM/BUNDLE commands in Ruby.
Thanks for all help
You can search the Maven Central repository to find specific versions of artifacts, but in some cases you have to know the exact name (artifactId) of the artifact. Unfortunately the apache artifacts are not consistent in their groupId or artifactId naming schemes. For example, Apache Commons CLI is commons-cli:commons-cli.
Here is the latest version of that artifact. There is even a convenient panel that shows the exact line to use based on your dependency tool (maven, Gradle, Ivy, etc.)
The below build.gradle works. Have a look at the syntax for dependency declaration. Please read this documentation for syntax.
apply plugin: 'java'
repositories {
jcenter()
mavenCentral()
}
dependencies {
compile group: 'commons-cli', name: 'commons-cli', version: '1.2'
compile group: 'commons-codec', name: 'commons-codec', version: '1.10'
testCompile 'junit:junit:4.12'
}
And as for getting the 'latest' version of a library in gradle, I am afraid thats not possible currently like in maven.
Is there any good integration where you can search for a Jar to include in the project?
As far as I know Gradle itself has no specific support for this.
How do you do in these cases? How do you come up with the correct "compile"-specification?
Before searching in Maven repositories for the desired dependency, best is to consult the project's homepage first. commons-cli for example has a separate Dependency Information section and lists the required information for all kinds of build tools. For Gradle/Grails and the latest SNAPSHOT version this is
compile 'commons-cli:commons-cli:1.4-SNAPSHOT'
The list of valid versions is compiled in the Changes Reports section.
Can I for example say "get latest version of this jar"?
There is a plugin called gradle-versions-plugin that can list updates of defined dependencies. Of course, this requires that you have already defined your dependencies correctly.
When I do a fresh git clone of the greenDAO repo, import the project with Android Studio, and try to compile, references to all the Android objects throw Unresolved Symbol/Method errors. Similarly, the Android specific import statements are also unresolved.
I've gotten as far as realizing that the build.gradle files don't call apply plugin: 'android', but instead lists dependencies like:
dependencies {
provided 'com.google.android:android:4.1.1.4'
provided 'com.google.android:android-test:4.1.1.4'
provided 'com.google.android:annotations:4.1.1.4'
provided 'com.google.android:support-v4:r7'
provided 'com.google.android:support-v4:r7'
...
}
I've used the SDK manager to make sure I have all the files for API v4.1 installed. I also know how to use greenDAO by using the Maven repos and/or importing JARs. My problem is specific to building from source.
Update 1: As stated, when using provided, none of the Android files are found.
I don't have enough reputation to post images, but you can find a screenshot here.
I am new to Gradle build tool. I am trying to write my first build.gradle script.
I am trying to install Gradle-MercurialMqPlugin as described at https://bitbucket.org/coherentsoftware/gradle-mercurialmqplugin/overview
Also I am trying to do HgClone.
But when I run gradle --info I am getting this error:
* What went wrong:
A problem occurred configuring root project 'gradle'.
> Could not resolve all dependencies for configuration ':classpath'.
> Could not find au.com.coherentsoftware.gradle:Gradle-MercurialMqPlugin:VERSION.
Required by:
:gradle:unspecified
Info also says:
Resource missing. [HTTP GET: http://jcenter.bintray.com/au/com/coherentsoftware/gradle/Gradle-MercurialMqPlugin/VERSION/Gradle-MercurialMqPlug
in-VERSION.pom]
Resource missing. [HTTP HEAD: http://jcenter.bintray.com/au/com/coherentsoftware/gradle/Gradle-MercurialMqPlugin/VERSION/Gradle-MercurialMqPlu
gin-VERSION.jar]
Could you please advise, what am I missing? Should I install some additional maven stuff or ...?
Is it possible that file is just actually missing, because when I enter that address in my browser it says:
Path 'bintray/jcenter/v1/content/bintray/jcenter/au/com/coherentsoftware/gradle/Gradle-MercurialMqPlugin/VERSION/Gradle-MercurialMqPlu gin-VERSION.jar' was not found.
And also for pom:
Path 'bintray/jcenter/v1/content/bintray/jcenter/au/com/coherentsoftware/gradle/Gradle-MercurialMqPlugin/VERSION/Gradle-MercurialMqPlug in-VERSION.pom' was not found.
Should I replace VERSION in this string or something like that?
EDIT
[I tried to replace VERSION with the latest tag V1.1.0, but I still got the same not found error when putting it in the browser]
Any help is very much appreciated.
Thanks.
mismas
It worked when I replaced VERSION with 1.1.0 (NOT V1.1.0) :)
Just needed to sleep it over.
Silly error.
I got the code from github for resteasy. When trying to do an mvn clean install, I am getting the following exception. I would appreciate if someone can point me in the correct path on how to resolve this.
The error is:
/D:/rnd_work/jboss/resteasy/Resteasy/jaxrs/resteasy-client/src/main/java/org/jboss/resteasy/client/jaxrs/internal/ClientInvocation.java:[154,34] D:\rnd_work\jboss\resteasy\Resteasy\jaxrs\resteasyclient\src\main\java\org\jboss\resteasy\client\jaxrs\internal\ClientInvocation.java:154: type parameters of T cannot be determined; no unique maximal instance exists for type variable T with upper bounds T,java.lang.Object
Consulted the RestEasy developer mailing list and it seems This is a bug fixed in JDK 7[1]. Updating my JDK to the latest JDK 1.7 build, did the trick. Also i put the ant-contrib jar to my classpath variable. Because otherwise the build fail.s
I am trying to get a Scala library using H2 database loading in Karaf 3.0.0-RC1 and I got this error
Unresolved constraint in bundle org.h2 [86]: Unable to resolve 86.0: missing requirement
[86.0] osgi.wiring.package; (&(osgi.wiring.package=org.osgi.service.jdbc)(version>=1.0.0)
Does anyone know what I need to add to POM and / or feature.xml to get this working?
Thanks,
Bob
You need that jar that contains the package. To get it:
go to http://search.maven.org
Push Advanced search
To the Classname, type "org.osgi.service.jdbc"
You will get a list of dependencies that contain the package. For example, the first one will be good for you: http://search.maven.org/#artifactdetails|org.ow2.spec.osgi|ow2-jdbc-service-1.0-spec|1.0.13|bundle
Btw.: The package originally comes from the OSGi enterprise spec (or compendium, do not remember). As much as I saw all of the OSGi spec packages are available in ow2 dependencies that separated logically.
In Karaf, there might be other ways to get the dependency you need but I did not use Karaf in the past.