I've tried to add a library to android studio
https://github.com/nostra13/Android-Universal-Image-Loader/wiki/Quick-Setup
and after compiling I get the
Error:A problem occurred configuring project ':app'.
Could not resolve all dependencies for configuration ':app:_debugCompile'.
Could not find com.android.support:appcombat-v7:22.2.0.
Searched in the following locations:
https://jcenter.bintray.com/com/android/support/appcombat-v7/22.2.0/appcombat-v7-22.2.0.pom
https://jcenter.bintray.com/com/android/support/appcombat-v7/22.2.0/appcombat-v7-22.2.0.jar
file:/Users/sergiumereuta/Library/Android/sdk/extras/android/m2repository/com/android/support/appcombat-v7/22.2.0/appcombat-v7-22.2.0.pom
file:/Users/sergiumereuta/Library/Android/sdk/extras/android/m2repository/com/android/support/appcombat-v7/22.2.0/appcombat-v7-22.2.0.jar
file:/Users/sergiumereuta/Library/Android/sdk/extras/google/m2repository/com/android/support/appcombat-v7/22.2.0/appcombat-v7-22.2.0.pom
file:/Users/sergiumereuta/Library/Android/sdk/extras/google/m2repository/com/android/support/appcombat-v7/22.2.0/appcombat-v7-22.2.0.jar
Required by:
XMLParsingTest:app:unspecified
can anybody help me to solve the problem? thanks!
here is my build.gradle file:
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.0.1"
defaultConfig {
applicationId "com.example.sergiumereuta.xmlparsingtest"
minSdkVersion 8
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'),'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcombat-v7:22.2.0'
compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.4'
}
You have a Typo. Replace your app compact dependency for:
compile 'com.android.support:appcompat-v7:22.2.0'
Should be appcompat and not appcombat
Try Cleaning the project and Rebuilding it again.
In Build => Clean Project then
Rebuilt Project.
Then sync again.
It should work, reply if problem continue
Ya Sandro Machado is correct .
You should replace appcombat to appcompat
Related
when I was trying to run a simple program , I got an error related to Gradle :
Error:A problem occurred configuring project ':app'.
> Could not resolve all dependencies for configuration':app:_debugUnitTestCompile'.
> Could not resolve junit:junit:4.12.
Required by:
MyApplication:app:unspecified
> Could not resolve junit:junit:4.12.
> Could not get resource 'https://jcenter.bintray.com/junit/junit/4.12/junit-4.12.pom'.
> Could not GET 'htps://jcenter.bintray.com/junit/junit/4.12/junit-4.12.pom'.
> Connection to htps://jcenter.bintray.com refused .
I don't know how can I fix it , please help .( I am currently using the android studio version 2.1.2 )
my module build-gradle includes these codes:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
defaultConfig {
applicationId "com.example.n5110.myapplication"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.3.0'
compile 'com.android.support:design:23.3.0'
}
The problematic part with your gralde.build is this line:
testCompile 'junit:junit:4.12'
This is a unit testing library. If you are just starting and are probably not gonna write testcases for your project then, you can resolve the issue by simply deleting the line. If however you essentially need that library then refer here.
I am using android studio, when am trying to add dependency
compile 'com.loopj.android:android-async-http:1.4.9'
and sync the project am getting an error
Error:Failed to find: com.loopj.android:android-async-http:1.4.9
Open FileOpen in Project Structure dialog
when i open the project structure -> Dependency its showing under the library
But the problem is that the library is not syncing.
when i try to clean the project am getting error like
Error:A problem occurred configuring root project 'Frendy'.
Could not resolve all dependencies for configuration ':_debugCompile'.
Could not find com.loopj.android:android-async-http:1.4.9.
Searched in the following locations:
file:/C:/Users/Binil/AppData/Local/Android/sdk/extras/android/m2repository/com/loopj/android/android-async-http/1.4.9/android-async-http-1.4.9.pom
file:/C:/Users/Binil/AppData/Local/Android/sdk/extras/android/m2repository/com/loopj/android/android-async-http/1.4.9/android-async-http-1.4.9.jar
file:/C:/Users/Binil/AppData/Local/Android/sdk/extras/google/m2repository/com/loopj/android/android-async-http/1.4.9/android-async-http-1.4.9.pom
file:/C:/Users/Binil/AppData/Local/Android/sdk/extras/google/m2repository/com/loopj/android/android-async-http/1.4.9/android-async-http-1.4.9.jar
Required by:
:Frendy:unspecified
Can any one please help me.
Add Maven Repositories it should work, its described at https://github.com/loopj/android-async-http in gradle section
this is example of my gradle :
apply plugin: 'com.android.application'
repositories {
maven {
url 'https://repo1.maven.org/maven2/'
}
}
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "com.mine.android"
minSdkVersion 10
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
} }
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.loopj.android:android-async-http:1.4.9'
}
}
Just add below code in build.gradle
repositories {mavenCentral()maven {url"https://oss.onatype.org/content/repositories/snapshots/" } }
I use:
android studio 1.5.1
java version "1.7.0_80"
I want to create a new android project as
Min Api-version = 15
But android studio cannot create new application , a dialog is opened with this title :
"Building 'MyApplication' Gradle project info"
and its content is :
a text: "Gradle: Resolve dependencies ':app:_debugCompile'"
and a progressBar;
unfortunately this dialog is opened for long time,just now ...
I had some projects , but when I want to build gradle for them below error is shown to me :
Error:(3, 0) Gradle DSL method not found: 'android()'
Possible causes:The project 'e-project' may be using a version of the Android Gradle plug-in that does not contain the method (e.g. 'testCompile' was added in 1.1.0).
Fix plugin version and sync project
The project 'e-project' may be using a version of Gradle that does not contain the method.
openGradleSettings Gradle settings The build file may be missing a Gradle plugin.
"apply.gradle.plugin Apply Gradle plugin
Edit 1: I added build.gradle
apply plugin: 'application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.e_example.android.app"
minSdkVersion 14
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:design:23.1.1'
compile 'com.android.support:support-v4:23.1.1'
compile 'com.google.android.gms:play-services:8.4.0'
}
I am trying to add to my build.gradle file in Android Studio the following dependency:
https://android-arsenal.com/details/1/1883
I followed the intstructions found in package tab of this page, but when I tried to build the project I got the following message:
Error:(32, 13) Failed to resolve:
com.github.DASAR:Minim-Android:a73b596916
Anyone can help me?
I also tried to download the project code and import it in Android Studio as a module, but it wasn't recognized as a library from the wizard.
Thank you all in advance.
You can download relative API in your AS SDK Manager, then add it in build.gradle. After that, check out the compileSdkVersion, targetSdkVersion are same with appcompat. My build.gradle is:
apply plugin: 'com.android.application'
android {
compileSdkVersion 19
buildToolsVersion "21.0.1"
defaultConfig {
applicationId "com.example.android"
minSdkVersion 9
targetSdkVersion 19
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:19.0.0'
}
my sdk is 19
Best option is to fork the project and add a Gradle build file. Then use JitPack to build the fork.
Note that the project has dependencies in a libs/ folder so these would need to be converted to dependencies in Gradle.
This error hapens after update mac osx or system (I don't know).
It was after I open project that I closed one weak ago.
My settings.gradles is:
include ':app' , ':api', ':daogenerator'
project(':mobilneapi').projectDir = new File("/Users/AndroidstudioProjects/Modules/api")
project(':daogenerator').projectDir = new File("/Users/AndroidstudioProjects/Modules/daogenerator")
And my app gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "pl.wm.myapplication"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile project(':api')
compile project(':daogenerator')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.0.1'
}
When I add import into MainActivity in Main Project.
I have got error after compile:
Error:(6, 24) error: cannot find symbol class Cache
What was wrong?
The same error on gradle build tools 1.3.0 and 1.2.4
try the usual stuff:
rebuild/clean project.
sync project with gradle files.
force close studio64.exe and restart it
restart the computer!
I hate these kind of errors, when nothing works, I usually end up creating a new project and start copying everything to it.