Android Studio: import com.android.volley.xxxx Cannot Resolve Symbol 'xxxx' - android

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'

Related

Gradle doesn't find acra

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.

RingCaptcha SDK import into android project in android studio

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!

The import android.support.v7.app cannot be resolved

im getting error in my android project The import android.support.v7.app cannot be resolved and even i import library from properties .
which i downloaded from https://github.com/koush/android-support-v7-appcompat.
and added in project from properties but still getting error
You need to add the appropriate dependency to your module gradle.build file as follows:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:21.0.2'
}
Make sure to synchronize your build.gradle file (Right click on file --> Synchronize 'build.gradle') and Clean your project (Build --> Clean Project) after the change.

Can't add External Library in Android Studio?

I Added a External Library to my project by following
this method. and tried this method too this method too.
Gradle build got Finished and i got this line added to my build.gradle
compile 'com.github.castorflex.smoothprogressbar:library-circular:1.0.1'
Now i am trying to import this library in my class. But i can't do this. I took a look at the files and they are located in the build directory under the exploded-aar. so i added #aar to the compile line. Still there are no changes.
How can i import this library to my class or where i am going wrong?
Thanks in Advance
Well, you don't need to download anything or point your dependency to a file.
This dependency, as most of the dependencies you use, can automatically fetched from JCenter, biggest repository for Java and Android components.
All you need to do is:
Add JCenter as your dependencies repository.
Declare that you need the library-circular dependency. This can be found and copy/pasted from the file icon in particular package/version in JCenter.
Resync your Android Studio project with your Gradle build file. This is the 'sync' button in Gradle pane in Android Studio.
Here's what your build.gradle should include:
repositories {
jcenter()
}
dependencies {
compile(group: 'com.github.castorflex.smoothprogressbar', name: 'library-circular', version: '1.0.1', ext: 'aar')
}
in build. gradle put following code
dependencies {
compile fileTree (dir: 'libs', include: ['*.jar'])
}
Did you add the dependencies?
You can do so in the following way -
dependencies {
compile files('insert ParentFolder/external_library_name with the extension here')
}
Add it to build.gradle based in the app folder
1.Put the jar file into the libs folder.
2.Right click it and hit 'Add as library'.
3.Ensure that compile files('libs/abcdef.jar') is in your build.gradle file and Finally add the dependencies.
Eg.
dependencies {
compile fileTree(dir: '../jar', include: '*.jar')
compile project(':pull-to-refresh')
compile files('libraries/abcdef.jar')
}
Hope this helps :)

ActionBarSherlock Gradle dependency from maven conflict with androidsupportv4

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

Categories

Resources