Wyck
Wyck

Reputation: 11730

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

I checked out and built the project at https://github.com/kosiara/artoolkit-android-studio-example

I have Android Studio 4.0.2 on Windows 10.

The build error I get is:

Executing tasks: [:app:assembleDebug] in project D:\Downloads\artoolkit-android-studio-example-master\artoolkit-android-studio-example-master


FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':app'.
> A problem occurred configuring project ':base'.
   > Could not resolve all dependencies for configuration ':base:_debugCompile'.
      > Could not find com.android.support:appcompat-v7:23.1.1.
        Searched in the following locations:
            https://jcenter.bintray.com/com/android/support/appcompat-v7/23.1.1/appcompat-v7-23.1.1.pom
            https://jcenter.bintray.com/com/android/support/appcompat-v7/23.1.1/appcompat-v7-23.1.1.jar
        Required by:
            artoolkit-android-studio-example-master:base:unspecified

* 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: 1.346 secs

I'm afraid I don't understand what is wrong.

I'm not sure what needs to be set to version 23.1.1. I looked in my Android SDK manager under SDK Tools, Android SDK Build-Tools and there is no option for 23.1.1. (Is that even where I should be looking?) I see 23.0.1, 23.0.2 (Installed), 23.0.3. Also the Android SDK Platform 23 is installed.

Do I need to add a custom Site to get the missing 23.1.1 option? I have no idea how to do that or what site it would be, if that's what's required.

I suspect there's likely something not set up correctly about my SDK or Android Studio, but I don't know what to check next.

I see this related question but that question has no answer.

I'd like some help getting this example to build.

Upvotes: 1

Views: 2365

Answers (1)

Veener
Veener

Reputation: 5191

That version of that module (appcompat-v7) is not in the JCenter repository. You have to add google maven using the old way when you're using an old version of Gradle, you are not allowed to use google() on Gradle v1.5.

build.gradle (project level)

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        jcenter()
        maven {
            url 'https://maven.google.com/'
            name 'Google'
        }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.5.0'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
        maven {
            url 'https://maven.google.com/'
            name 'Google'
        }
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

Upvotes: 1

Related Questions