Could not find com.android.support:appcompat-v7:27.1.0 - android

I checked and updated my android SDK (also react-native-image-crop-picker), but I couldn't find the version of support 27.+ all the time.
below are more information
FAILURE: Build failed with an exception.
-------------------------------------------------------
What went wrong:
A problem occurred configuring project ':app'.
Could not resolve all dependencies for configuration ':app:_debugApk'.
A problem occurred configuring project ':react-native-image-crop-picker'.
Could not resolve all dependencies for configuration ':react-native-image-crop-picker:_debugPublishCopy'.
Could not find com.android.support:appcompat-v7:27.1.0.
Searched in the following locations:
file:/D:/AndroidSDK/extras/android/m2repository/com/android/support/appcompat-v7/27.1.0/appcompat-v7-27.1.0.pom
file:/D:/AndroidSDK/extras/android/m2repository/com/android/support/appcompat-v7/27.1.0/appcompat-v7-27.1.0.jar
file:/C:/Users/***/Desktop/LastDesign/InsurAgentApp/android/sdk-manager/com/android/support/appcompat-v7/27.1.0/appcompat-v7-27.1.0.jar
Required by:
InsurAgentApp:react-native-image-crop-picker:unspecified > com.facebook.react:react-native:0.54.2
Could not find com.android.support:appcompat-v7:27.1.0.
Searched in the following locations:
file:/D:/AndroidSDK/extras/android/m2repository/com/android/support/appcompat-v7/27.1.0/appcompat-v7-27.1.0.pom
file:/D:/AndroidSDK/extras/android/m2repository/com/android/support/appcompat-v7/27.1.0/appcompat-v7-27.1.0.jar
file:/C:/Users/***/Desktop/LastDesign/InsurAgentApp/android/sdk-manager/com/android/support/appcompat-v7/27.1.0/appcompat-v7-27.1.0.jar
Required by:
InsurAgentApp:react-native-image-crop-picker:unspecified > com.github.yalantis:ucrop:2.2.2-native
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
build.gradle:
apply plugin: 'com.android.library'
android {
compileSdkVersion 27
buildToolsVersion "27.0.3"
defaultConfig {
minSdkVersion 16
targetSdkVersion 27
versionCode 1
}
lintOptions {
abortOnError false
}
}
dependencies {
compile 'com.facebook.react:react-native:+'
compile 'com.github.yalantis:ucrop:2.2.2-native'
compile 'id.zelory:compressor:2.1.0'
}

It seems that Gradle is looking for the specified libraries in your local storage.
Try adding the Google's Maven repository to your top-level build.gradle file.

Check if you have offline work on.
Go to:
File > Settings > write "offline" on the search bar > under Gradle, see if Offline Work is checked. If so, uncheck it.

Related

Unable to load class 'ijinit_dkec9zswd4p83aajh1klyj0h5'. (React_native gradle sync issue)

Unable to load class 'ijinit_dkec9zswd4p83aajh1klyj0h5'. (React_native gradle sync issue)
I am facing this issue on Gradle sync while building .apk, dubug apk is working fine.
I have also cleaned Gradle and rebuilt my app but still no improvement.
Error image
Build Script:
buildscript {
ext {
buildToolsVersion = "30.0.2"
minSdkVersion = 21
compileSdkVersion = 31
targetSdkVersion = 31
ndkVersion = "21.4.7075529"
}
repositories {
google()
mavenCentral()
}
dependencies {
classpath("com.android.tools.build:gradle:4.2.2")
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
Error:
Unable to load class 'ijinit_dkec9zswd4p83aajh1klyj0h5'.
This is an unexpected error. Please file a bug containing the idea.log file.
FAILURE: Build failed with an exception.
What went wrong:
Could not load compiled classes for initialization script 'C:\Users\User\AppData\Local\Temp\ijinit.gradle' from cache.
ijinit_dkec9zswd4p83aajh1klyj0h5
Try:
Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Exception is:
org.gradle.api.GradleException: Could not load compiled classes for initialization script 'C:\Users\User\AppData\Local\Temp\ijinit.gradle' from cache.
Caused by: java.lang.ClassNotFoundException: ijinit_dkec9zswd4p83aajh1klyj0h5
Had a similar error, fixed it by upgrading Android Studio. It needed a proper sync after upgrade.
Refer to https://issuetracker.google.com/issues/36990380
Update will solve your problem
Help -> Check for Updates

Content is not allowed in prolog during Gradle build

I tried Different methods but the problem did not solved, I even reinstalled android studio but still getting same issue:
[Fatal Error] annotations-26.1.1.pom:2:1: Content is not allowed in prolog.
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'myapp'.
> Could not resolve all files for configuration ':classpath'.
> Could not resolve com.android.tools:annotations:26.1.1.
Required by:
project : > com.android.tools.build:gradle:3.1.1 > com.android.tools.build:gradle-core:3.1.1 > com.android.databinding:compilerCommon:3.1.1
> Could not resolve com.android.tools:annotations:26.1.1.
> Could not parse POM https://dl.google.com/dl/android/maven2/com/android/tools/annotations/26.1.1/annotations-26.1.1.pom
> Content is not allowed in prolog.
> Could not resolve com.android.tools:annotations:26.1.1.
Required by:
project : > com.android.tools.build:gradle:3.1.1 > com.android.tools.build:gradle-core:3.1.1 > com.android.tools.build:builder:3.1.1 > com.android.tools.build:builder-model:3.1.1
project : > com.android.tools.build:gradle:3.1.1 > com.android.tools.build:gradle-core:3.1.1 > com.android.tools.build:builder:3.1.1 > com.android.tools:common:26.1.1
project : > com.android.tools.build:gradle:3.1.1 > com.android.tools.build:gradle-core:3.1.1 > com.android.tools.build:builder:3.1.1 > com.android.tools.analytics-library:shared:26.1.1
project : > com.android.tools.build:gradle:3.1.1 > com.android.tools.build:gradle-core:3.1.1 > com.android.tools.build:builder:3.1.1 > com.android.tools.analytics-library:tracker:26.1.1
project : > com.android.tools.build:gradle:3.1.1 > com.android.tools.build:gradle-core:3.1.1 > com.android.tools.build:builder:3.1.1 > com.android.tools:sdklib:26.1.1 > com.android.tools.layoutlib:layoutlib-api:26.1.1
> Could not resolve com.android.tools:annotations:26.1.1.
> Could not parse POM https://dl.google.com/dl/android/maven2/com/android/tools/annotations/26.1.1/annotations-26.1.1.pom
> Content is not allowed in prolog.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
CONFIGURE FAILED in 34s
Content is not allowed in prolog.
app\build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.example.kakarot.myapp"
minSdkVersion 24
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.0.2'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
}
Project (build.gradle)
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
I added the app module build.gradle and project build.gradle.
Worked on Android Studio 3.0.1.
Close android studio if it is open already and then delete all the contents of these directories.
C:\Users\USER_NAME\.gradle\caches
C:\Users\USER_NAME\.android\build-cache
C:\Users\USER_NAME\.android\cache
Start Android Studio and and it will probably work. It may take a little bit time to load for the first time.
After a lot of struggle and searching online, i finally solve the problem.
I deleted all the cached folders in gradle and when i build my new project. It work like magic.
Thanks #ישו אוהב אותך for reply and trying to help me.
I solved this by just deleting the cache folders in .gradle folder. This was only thing that worked (it also works for the android studio canary)

Android studio with experimental gradle 0.2.0

I am trying to setup a basic ndk build with the latest version of android studio at this moment. Trying to follow this tutorial
This is my gradle-wrapper.properties
#Thu Sep 17 14:22:34 CST 2015
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.5-all.zip
This is the project build.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle-experimental:0.2.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Here is my module's build.gradle
apply plugin: 'com.android.model.application'
model {
android {
compileSdkVersion = 23
buildToolsVersion = "23.0.1"
defaultConfig.with {
applicationId = "me.blubee.testnative_exp"
minSdkVersion = 10
targetSdkVersion = 23
versionCode = 1
versionName = "1.0"
}
buildConfigFields.with {
create() {
type = "int"
name = "VALUE"
value = "1"
}
}
android.buildTypes {
release {
minifyEnabled = false
proguardFiles += file('proguard-rules.pro')
}
}
android.productFlavors {
create("flavor1") {
applicationId = 'com.app'
}
}
android.sources {
main {
java {
source {
srcDir 'src'
}
}
}
}
}
}
my project structure looks like this:
APP
Java/
Java/android.support
Java/com.test.test_experimental
Java/com.test.test_experimental/R
Java/com.test.test_experimental
Java/com.test.test_experimentalBuildConfig
Java/com.test.test_experimental
Java/com.test.test_experimental/MainActivity
tests/
tests/com.test.test_experimental
tests/com.test.test_experimental/ApplicationTest.java
tests/com.test.test_experimental
tests/com.test.test_experimental/BuildConfig.java
resources/
test-resources
gradle/scripts/
I am getting these errors:
2:51:31 PM Gradle sync started
2:51:34 PM Gradle sync failed: Unable to load class 'com.android.build.gradle.managed.ProductFlavor_Impl'.
Consult IDE log for more details (Help | Show Log)
Error:Unable to load class 'com.android.build.gradle.managed.ProductFlavor_Impl'.
Possible causes for this unexpected error include:<ul><li>Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)
Re-download dependencies and sync project (requires network)</li><li>The state of a Gradle build process (daemon) may be corrupt. Stopping all Gradle daemons may solve this problem.
Stop Gradle build processes (requires restart)</li><li>Your project may be using a third-party plugin which is not compatible with the other plugins in the project or the version of Gradle requested by the project.</li></ul>In the case of corrupt Gradle processes, you can also try closing the IDE and then killing all Java processes.
Brother:TestNative_exp blubee$ ./gradlew clean --stacktrack
FAILURE: Build failed with an exception.
* Where:
Build file '/Users/bb/TestNative_exp/app/build.gradle' line: 10
* What went wrong:
A problem occurred configuring project ':app'.
> Exception thrown while executing model rule: model.android
> Cannot set readonly property: minSdkVersion for class: com.android.build.gradle.managed.ProductFlavor_Impl
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 2.619 secs
line #10 is: minSdkVersion = 10
You can see the whole file in the build.gradle that i put above.
edit
As #unbekant pointed out in his comment and the link to this post
The min and target sdk values should be set like this:
minSdkVersion.apiLevel = 15
targetSdkVersion.apiLevel = 22
I tried that as well, I get this error:
* What went wrong:
A problem occurred configuring project ':app'.
> Exception thrown while executing model rule: model.android
> No such property: buildConfigFields for class: com.android.build.gradle.managed.AndroidConfig
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
What am I doing wrong?
You have to put these blocks outside the android block.
android.buildTypes
android.sources
android.productFlavors
Also the buildConfigFields.with should be inside the defaultConfig or inside the buildTypes or productFlavors:
Something like:
model {
android {
compileSdkVersion = 22
buildToolsVersion = "22.0.1"
defaultConfig.with {
//----
minSdkVersion.apiLevel = 10
targetSdkVersion.apiLevel = 23
buildConfigFields.with {
create() {
//....
}
}
}
}
android.buildTypes {
release {
//
}
}
android.productFlavors {
//
}
// Configures source set directory.
android.sources {
//
}
}
Also, the last version is 0.2.1.
classpath 'com.android.tools.build:gradle-experimental:0.2.1'
There's a tutorial? Oh, that. Where are the links?
The current version is 0.2.0.
or dates?
I googled every one of the missing files individually (maybe 3 dozen!) after adding:
classpath 'com.android.tools.build:gradle-experimental:0.2.1'
I tried the alpha version too but I failed finding some of its dependencies altogether.
First I get a couple of dependencies I can be bothered chasing down:
> Error:Could not find com.android.tools.build:gradle-experimental:0.2.1.
Searched in the following locations:
file:/C:/Program Files/Android/Android Studio/gradle/m2repository/com/android/tools/build/gradle-experimental/0.2.1/gradle-experimental-0.2.1.pom
file:/C:/Program Files/Android/Android Studio/gradle/m2repository/com/android/tools/build/gradle-experimental/0.2.1/gradle-experimental-0.2.1.jar
Once each of these was added to the given path seven more would sprout up in its place. If someone could post how to automatically update these (they still aren't in the latest 1.4RC1 Android Studio) it would be very useful. I got most of the stuff from maven, eg http://mvnrepository.com/artifact/com.android.tools.lint/lint-checks/24.3.1
I got all the files to shut up Gradle's whining and you know what it said?
Error:(34, 1) A problem occurred evaluating project ':app'.
> Error: NDK integration is deprecated in the current plugin. Consider trying the new experimental plugin. For details, see http://tools.android.com/tech-docs/new-build-system/gradle-experimental. Set "android.useDeprecatedNdk=true" in gradle.properties to continue using the current NDK integration.
Which was exactly the error that led me to migrate to experimental and no better than the stock 1.3.0 that ships with AS (though it was defaulting to 1.2.3).
Why did I bother? I want to debug NDK and couldn't see what else I wasn't doing apart from not using an experimental build.
This goose chase was just a big waste of time. I'm back to using
android.useDeprecatedNdk=true
No doubt I can fix it somewhere else but just a warning to others chasing experimental dependencies; they are unicorns.
#jonagon
Some examples are in this repo:
https://github.com/googlesamples/android-ndk
probably could try:
Use the latest plugin version. Find it at:https://jcenter.bintray.com/com/android/tools/build/gradle-experimental
check https://github.com/googlesamples/android-ndk/blob/master/hello-jni/app/build.gradle for product flavors
jni folder issue:
it is default for gradle experimental plugin, also for older c++ support NOT using gradle-experimental plugin ( android plugin )
if you have that folder and not using experimental plugin, Gradle thinks that app is using the older android studio c++ support. It gives your that warning "NDK integration is deprecated in the current plugin" and recommend you to experimental plugin. it could be silenced with:
sourceSets.main.jni.srcDirs = []
or just rename that jni folder to something else: it will cause more trouble if you want to android-studio cmake/ndk-build in the future, rename is better.

Trouble with integrating Play Game Services (can't find a specific version of android support library)

I am trying to integrate the Google Play Game Services with my project. I have added the play services as a dependency to my build.gradle, but when I try to rebuild the project I get this error:
* What went wrong:
A problem occurred configuring project ':android'.
> Could not resolve all dependencies for configuration ':android:_debugCompile'.
> Could not find com.android.support:support-v4:19.0.1.
Required by:
Taxi Trouble:android:1.0 > com.google.android.gms:play-services:4.3.23
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
According to the SDK manager I have version 19.1, instead of the required 19.0.1. Can I install this older version of the support library?
Please share your build.gradle file. The following example, taken from an update to the Play-Google Play Games Services GitHub pages, shows a working build.gradle file with the latest support library.
First, note that there are multiple build.gradle files and settings.gradle files in a particular project/workspace. Let's focus on the two most likely candidates for breaking your build.
root (build.gradle) (e.g. root/build.gradle)
Android module for your app (e.g. root/module/build.gradle)
Root project build.gradle
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.9+'
}
}
allprojects {
repositories {
mavenCentral()
}
}
build.gradle from within a project module:
apply plugin: 'android'
android {
compileSdkVersion 19
buildToolsVersion '19.0.3'
defaultConfig {
minSdkVersion 9
targetSdkVersion 19
versionCode 1
versionName "1.0"
}
dependencies {
compile 'com.android.support:appcompat-v7:+'
compile 'com.google.android.gms:play-services:4.3.23'
//compile project(':libraries:BaseGameUtils')
}
buildscript {
repositories {
mavenCentral()
}
}
repositories {
}
}
It's a little confusing at first but your gradle build library version must match your ADT version which must match your GMS version. As Android Studio stabilizes, required updates to match configurations across tools and Android libraries will hopefully become less common.

Android Studio 0.5.2 Gradle Refresh Project failed

UPDATED WITH MY EVENT LOG
LAST EDIT
After trying out every possible solution i could find i've come to a fresh install of Windows. Doing this i noticed that this was indeeed a firewall issue, my antivirus was blocking the studio64.exe process.
I have freshly installed Android Studio 0.4.2 then immediately updated to 0.5.2 without opening or creating any new projects.
I updated the Android SDK then created a new project. I keep getting the error with the Gradle Refresh Failed even though i tried to change the local gradle distribution, nothing seems to work, everything i try Gradle replies with: "Please fix your Gradle configuration"...
This had happened to me since i updated to Android studio 5.1, never before.
I tried with Gradle 1.10 and 1.11 and the Gradle wrapper included in the install kit downloadable from the website http://developer.android.com/sdk/installing/studio.html
Here are my gradle files:
apply plugin: 'android'
android {
compileSdkVersion 19
buildToolsVersion "19.0.3"
defaultConfig {
minSdkVersion 8
targetSdkVersion 19
versionCode 1
versionName "1.0"
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
compile 'com.android.support:appcompat-v7:+'
compile fileTree(dir: 'libs', include: ['*.jar'])
}
And the outside build.gradle file.
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.9.+'
}
}
allprojects {
repositories {
mavenCentral()
}
}
Now i've tried downloading the latest version from the Canary Build and then downloading the SDK sepparately, still the same issue, this is really annoying... is there any network setting i might be having setup incorrectly?
Currently i am using the default grale wrapper from Android Studio, and this is the error i get:
10:58:37 AM Gradle 'ClujTourist' project refresh failed:
A fatal exception has occurred. Program will exit.
: Gradle settings
After trying to compile the project with: gradlew.bat --stacktrace assemble
this is what i got:
C:\Users\Adrian-PC\AndroidStudioProjects\ClujTourist>gradlew.bat --stacktrace as
semble
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'ClujTourist'.
> Could not resolve all dependencies for configuration ':classpath'.
> Could not find any version that matches com.android.tools.build:gradle:0.11
.+.
Required by:
:ClujTourist:unspecified
* Try:
Run with --info or --debug option to get more log output.
* Exception is:
org.gradle.api.ProjectConfigurationException: A problem occurred configuring roo
t project 'ClujTourist'.
at org.gradle.configuration.project.LifecycleProjectEvaluator.addConfigu
rationFailure(LifecycleProjectEvaluator.java:79)
at org.gradle.configuration.project.LifecycleProjectEvaluator.evaluate(L
ifecycleProjectEvaluator.java:57)
at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProj
ect.java:507)
at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProj
ect.java:82)
at org.gradle.configuration.DefaultBuildConfigurer.configure(DefaultBuil
dConfigurer.java:31)
at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(Default
GradleLauncher.java:142)
at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradle
Launcher.java:113)
at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLaun
cher.java:81)
at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildCon
troller.run(InProcessBuildActionExecuter.java:64)
at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.jav
a:33)
at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.jav
a:24)
at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProce
ssBuildActionExecuter.java:35)
at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProce
ssBuildActionExecuter.java:26)
at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:50)
at org.gradle.internal.Actions$RunnableActionAdapter.execute(Actions.jav
a:171)
at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.
execute(CommandLineActionFactory.java:201)
at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.
execute(CommandLineActionFactory.java:174)
at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(
CommandLineActionFactory.java:170)
at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(
CommandLineActionFactory.java:139)
at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionRep
ortingAction.java:33)
at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionRep
ortingAction.java:22)
at org.gradle.launcher.Main.doAction(Main.java:46)
at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
at org.gradle.launcher.Main.main(Main.java:37)
at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBoots
trap.java:50)
at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.j
ava:32)
at org.gradle.launcher.GradleMain.main(GradleMain.java:23)
at org.gradle.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.ja
va:33)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:130)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:48)
Caused by: org.gradle.api.artifacts.ResolveException: Could not resolve all depe
ndencies for configuration ':classpath'.
at org.gradle.api.internal.artifacts.ivyservice.DefaultLenientConfigurat
ion.rethrowFailure(DefaultLenientConfiguration.java:52)
at org.gradle.api.internal.artifacts.ivyservice.DefaultResolvedConfigura
tion.rethrowFailure(DefaultResolvedConfiguration.java:36)
at org.gradle.api.internal.artifacts.ivyservice.SelfResolvingDependencyR
esolver$FilesAggregatingResolvedConfiguration.rethrowFailure(SelfResolvingDepend
encyResolver.java:106)
at org.gradle.api.internal.artifacts.ivyservice.ErrorHandlingArtifactDep
endencyResolver$ErrorHandlingResolvedConfiguration.rethrowFailure(ErrorHandlingA
rtifactDependencyResolver.java:176)
at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration
$ConfigurationFileCollection.getFiles(DefaultConfiguration.java:465)
at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration
.getFiles(DefaultConfiguration.java:202)
at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration
_Decorated.getFiles(Unknown Source)
at org.gradle.api.internal.initialization.DefaultScriptHandler.updateCla
ssPath(DefaultScriptHandler.java:75)
at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl.
apply(DefaultScriptPluginFactory.java:145)
at org.gradle.configuration.project.BuildScriptProcessor.execute(BuildSc
riptProcessor.java:38)
at org.gradle.configuration.project.BuildScriptProcessor.execute(BuildSc
riptProcessor.java:25)
at org.gradle.configuration.project.ConfigureActionsProjectEvaluator.eva
luate(ConfigureActionsProjectEvaluator.java:34)
at org.gradle.configuration.project.LifecycleProjectEvaluator.evaluate(L
ifecycleProjectEvaluator.java:55)
... 28 more
Caused by: org.gradle.api.internal.artifacts.ivyservice.ModuleVersionNotFoundExc
eption: Could not find any version that matches com.android.tools.build:gradle:0
.11.+.
Required by:
:ClujTourist:unspecified
at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.LazyDependenc
yToModuleResolver$DynamicVersionResolveResult.notFound(LazyDependencyToModuleRes
olver.java:170)
at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.LazyDependenc
yToModuleResolver$AbstractVersionResolveResult.resolve(LazyDependencyToModuleRes
olver.java:91)
at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.LazyDependenc
yToModuleResolver.resolve(LazyDependencyToModuleResolver.java:47)
at org.gradle.api.internal.artifacts.ivyservice.VersionForcingDependency
ToModuleResolver.resolve(VersionForcingDependencyToModuleResolver.java:48)
at org.gradle.api.internal.artifacts.ivyservice.resolveengine.Dependency
GraphBuilder$ModuleVersionSelectorResolveState.resolveModuleRevisionId(Dependenc
yGraphBuilder.java:935)
at org.gradle.api.internal.artifacts.ivyservice.resolveengine.Dependency
GraphBuilder$DependencyEdge.resolveModuleRevisionId(DependencyGraphBuilder.java:
296)
at org.gradle.api.internal.artifacts.ivyservice.resolveengine.Dependency
GraphBuilder.traverseGraph(DependencyGraphBuilder.java:93)
at org.gradle.api.internal.artifacts.ivyservice.resolveengine.Dependency
GraphBuilder.resolve(DependencyGraphBuilder.java:66)
at org.gradle.api.internal.artifacts.ivyservice.resolveengine.DefaultDep
endencyResolver$1.transform(DefaultDependencyResolver.java:108)
at org.gradle.api.internal.artifacts.ivyservice.resolveengine.DefaultDep
endencyResolver$1.transform(DefaultDependencyResolver.java:77)
at org.gradle.api.internal.artifacts.ivyservice.DefaultIvyContextManager
.withIvy(DefaultIvyContextManager.java:61)
at org.gradle.api.internal.artifacts.ivyservice.resolveengine.DefaultDep
endencyResolver.resolve(DefaultDependencyResolver.java:77)
at org.gradle.api.internal.artifacts.ivyservice.CacheLockingArtifactDepe
ndencyResolver$1.create(CacheLockingArtifactDependencyResolver.java:39)
at org.gradle.api.internal.artifacts.ivyservice.CacheLockingArtifactDepe
ndencyResolver$1.create(CacheLockingArtifactDependencyResolver.java:37)
at org.gradle.cache.internal.DefaultCacheAccess.useCache(DefaultCacheAcc
ess.java:148)
at org.gradle.cache.internal.DefaultPersistentDirectoryStore.useCache(De
faultPersistentDirectoryStore.java:123)
at org.gradle.api.internal.artifacts.ivyservice.DefaultCacheLockingManag
er.useCache(DefaultCacheLockingManager.java:77)
at org.gradle.api.internal.artifacts.ivyservice.CacheLockingArtifactDepe
ndencyResolver.resolve(CacheLockingArtifactDependencyResolver.java:37)
at org.gradle.api.internal.artifacts.ivyservice.SelfResolvingDependencyR
esolver.resolve(SelfResolvingDependencyResolver.java:41)
at org.gradle.api.internal.artifacts.ivyservice.ShortcircuitEmptyConfigs
ArtifactDependencyResolver.resolve(ShortcircuitEmptyConfigsArtifactDependencyRes
olver.java:46)
at org.gradle.api.internal.artifacts.ivyservice.ErrorHandlingArtifactDep
endencyResolver.resolve(ErrorHandlingArtifactDependencyResolver.java:44)
at org.gradle.api.internal.artifacts.ivyservice.DefaultConfigurationReso
lver.resolve(DefaultConfigurationResolver.java:42)
at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration
.resolveNow(DefaultConfiguration.java:240)
at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration
.getResolvedConfiguration(DefaultConfiguration.java:230)
at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration
_Decorated.getResolvedConfiguration(Unknown Source)
at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration
$ConfigurationFileCollection.getFiles(DefaultConfiguration.java:463)
... 36 more
BUILD FAILED
Total time: 7.864 secs
C:\Users\Adrian-PC\AndroidStudioProjects\ClujTourist>
Also tried to delete the .gradle and gradle files from my project. Nothing seems to work.
EDIT What seems to be working for me so far is replacing the service directory .gradle to your root directory as it seems there might have been a path problem to that directory. Let me know if this solved it for you!
Easy fix!
The defaultConfig part of your build.gradle file needs to go inside buildTypes, like this:
apply plugin: 'android'
android {
compileSdkVersion 19
buildToolsVersion "19.0.3"
buildTypes {
defaultConfig {
minSdkVersion 8
targetSdkVersion 19
versionCode 1
versionName "1.0"
}
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
compile 'com.android.support:appcompat-v7:+'
compile fileTree(dir: 'libs', include: ['*.jar'])
}
See the guide for Migrating from 0.8 to 0.9.
Furthermore, make sure you're using the up-to-date Gradle distribution url (if you're using the Gradle wrapper).
In your gradle-wrapper.properties file should be the following line:
distributionUrl=http\://services.gradle.org/distributions/gradle-1.11-all.zip
Finally make sure you clean your project before building again (Build -> Clean Project).
In my case, I have tried these two solutions above, but neither could solve the problem, finally I shut down my AVAST safety software...then It worked! gradle sync is ok..
Although I don't know why, but shutting down AVAST did solve the problem.
I had exactly the same problem.
To solve that just create another project in Android Studio 0.5.2 and after that when new project completely Created and Built close it and open your old project (project 'ClujTourist' ). Now you can build ClueTourist successfully.
Please let me know if anything goes wrong.

Categories

Resources