Error adding library in Android Studio

I am trying to add a library to android studio and have encountered several problems. I searched everywhere and did not find a solution.Error screen

I would like to add this library ( https://github.com/lucasr/twoway-view/ ) to my project, but when I went through this line to build .gradle, an error occurs

repositories {

maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }

}

dependencies {

compile 'org.lucasr.twowayview:core:1.0.0-SNAPSHOT@aar'
compile 'org.lucasr.twowayview:layouts:1.0.0-SNAPSHOT@aar'

}

Help me because I have no idea what to do.

+4
source share
1 answer

You put statements in the wrong places. Here's how to fix it:

maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }

This line should be in this build.gradle, but inside allprojects { repositories { ... } }, and so:

allprojects {
    repositories {
        jCenter()
        maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
    }
}

, dependencies { ... } . app build.gradle. , dependencies { ... } (, AppCompat).

dependency { ... }:

compile 'org.lucasr.twowayview:core:1.0.0-SNAPSHOT@aar'
compile 'org.lucasr.twowayview:layouts:1.0.0-SNAPSHOT@aar'
+1

Source: https://habr.com/ru/post/1613935/


All Articles