Im trying to import an sdk called ringcaptcha and unfortunately I have followed their docs without much success. I have the following statement in my build.gradle file
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:21.0.3'
compile 'com.thrivecom.ringcaptcha:ringcaptcha:1.0.3#aar
}
I have also imported the module ringcaptcha. It still gives me the error that it cannot resolve com.thrivecom.ringcaptcha:ringcaptcha:1.0.3
Im not sure what I am missing here but this is a very basic error. Any help is greatly appreciated.
For Ringcaptcha you can head here http://ringcaptcha.com/
I'm part of the team at RingCaptcha. To solve your problem you need to add the repository like this:
repositories {
// ...
maven { url 'http://ringcaptcha.github.io/ringcaptcha-android/Ringcaptcha'}
// ...
}
and please compile with version 1.0.4
'com.thrivecom.ringcaptcha:ringcaptcha:1.0.4#aar'
we are adding gradle as we speak so if you continue to have issues please paste them here and we'll resolve them.
Cheers!
Related
I have an Android project in which I have been using ACRA 4.6.0 with a static jar file, all working fine. I have tried to change this to use the latest ACRA by the maven dependency in build.gradle:
dependencies {
compile fileTree(dir: 'libs', include: '*.jar')
testCompile 'junit:junit:4.12'
compile 'ch.acra:acra:4.8.5'
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:design:23.4.0'
}
in my build.gradle. However this causes the build to fail with errors like:
CJApp.java:13: error: cannot find symbol
import org.acra.ACRAConfiguration;
^
symbol: class ACRAConfiguration
location: package org.acra
So far as I can tell gradle is not downloading anything for acra. I have tried adding mavenCentral() to the repositories list with no effect.
What else do I need to do, and is there any way of determining just what gradle has downloaded?
Are you sure that the class org.acra.ACRAConfiguration is included in the new version: acra:4.8.5 which you're suddenly linking to? If not, this is a simple matter of incompatibility. In that case, it should be resolved if you step the version back to 4.6.0.
Have you checked that the build downloads the file from Maven Central? This should be clearly visible when giving gradle the -i flag - it will print every URL as it downloads them.
ACRAConfiguration has moved to org.acra.config. Just adjust your import.
I am following the Getting Started, Facebook Android SDK.
But when I am adding the repositories and the dependencies, I get the following error:
Error: Module version com.facebook.android:facebook-android-sdk:4.1.0 depends on libraries but is not a library itself.
I tried with several versions of the SDK but I can't make it work.
This is how my gradle looks:
dependencies{
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:21.0.3'
compile 'com.facebook.android:facebook-android-sdk:4.1.0'
}
repositories{
mavenCentral()
}
I am using the BuildTools 22.0.1
I hope someone can orient my with this issue.
Regards
compile 'com.facebool.android:facebook-android-sdk:4.1.0' Is the facebool correct or is that an error? If that's an error then that could be your issue. Also if you can't get it to compile from a maven source try downloading a jar and putting it in your local library. Then go into the project structure and go to the module you want to add this library to and click on the dependencies tab and there is a plus icon to add a library from file.
In you build.gradle(Project:Your-Project-Name) replace jCentral() with mavenCentral() in both (allproject/repos and buildscript/repos) then sync your gradle.
Hope this helps.
So, I followed this tutorial to create a ListView with images using Volley but I am having this issue with the com.android.volley.xxxx import statements in LruBitmapCache.java, AppController.java, CustomListAdapter.java, and MainActivity.java. It shows as Unused import statements and its extension are in red saying Cannot resolve symbol xxxx. Volley.jar is already aded to app -> libs section.
Would appreciate any help.
I'd double check to make sure your build.gradle includes:
dependencies {
compile fileTree(dir: 'libs', include: '*.jar')
...
}
And also make sure you've ran a sync.
Add
compile 'com.mcxiaoke.volley:library:1.0.6#aar'
to your Gradle dependencies...
Add this in your build.gradle of your app
https://developer.android.com/training/volley/
implementation 'com.android.volley:volley:1.1.1'
So, I managed to create an Android library component and publish it on Maven Central. But when I'm trying to use it as a dependency in a new project, Android Studio can't seem to find the classes.
build.gradle for the app module:
repositories {
mavenCentral()
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:21.0.3'
compile 'no.hyper:libdateintervalpicker:1.0.0' //this is the one I want to use
}
This part seems to work, at least I get no sync errors. However, when trying to access to package and classes from my MainActivity, Android Studio can't find them and gives me "cannot resolve symbol" message.
I have tried downloading the classes.jar from the archive directly from Maven Central, and they are indeed in the package.
Other dependencies seem to appear in the /build/intermediates/exploded-aar folder after syncing, but that does not happen to my library.
I use Android Studio 1.0.2 on OSX 10.9.5 (Mavericks)
Any suggestions?
Looking in your pom, it states <packaging>aar.asc</packaging>. It should be aar instead.
Oh, and the answer to actually being able to use the library, was to add #aar to the dependency so that it now reads
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:21.0.3'
compile 'no.hyper:libdateintervalpicker:1.0.0#aar' //note the magic #aar
}
Edit:
Removing the block
configurations {
archives {
extendsFrom configurations.default
}
}
makes Gradle generate the pom with the correct packaging entry, and thus makes it possible to reference the dependency without the #aar suffix
I have imported successfully from Maven Repository the com.actionbarsherlock:actionbarsherlock:4.4.0 and com.android.support:support-v4:20.0.0. But when i try to import
import com.actionbarsherlock.app.SherlockActivity;
it doesnt import and also if i try to run the application i get a similar error to:
Multiple dex files define Android studio error when trying to import Google Maps into Google Maps project
I dont get the point here why the action bar sherlock library is not imported correctly even that the maven repository is added to dependency correctly .
The problem is solved. I found out the solution by changing build.gradle of my app and adding the #aar part in the compile section of actionbarsherlock
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:support-v4:20.0.0'
compile 'com.actionbarsherlock:actionbarsherlock:4.4.0#aar'
}
This solved the problem and i found out the solution reading this:
https://code.google.com/p/maven-android-plugin/wiki/ApkLib