zulqurnan
zulqurnan

Reputation: 1

Unable to load Android Support Libraries in Android Studio

I am new to Android Studio. I am building project using Cordova. As soon as I add camera plugin, and when I build project I get the error

Error:(25, 42) java: package android.support.support.v4.content does not exist.

I checked all the support libraries and they are installed in my sdk manager but as aar. There is not JAR file. My project is also not on Gradle. Can you please help me in this.

enter image description here

here is the window path of my support library.

Here is my Gradle file :

enter image description here

Upvotes: 0

Views: 404

Answers (1)

Gabriele Mariotti
Gabriele Mariotti

Reputation: 363825

You are adding the support-v4 dependency in the wrong block inside the build.gradle file.

Remove it from the buildscript block and add in the dependencies block.

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

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

dependencies {
    ...
    compile "com.android.support:support-v4:26.0.1"
}

Upvotes: 1

Related Questions