I tried to add the following library as a dependency in my android project:
compile 'com.thehayro:infiniteviewpager:0.4'
which gives me the following gradle error when I build:
A problem occurred configuring project ':app'.
> Could not resolve all dependencies for configuration ':app:_debugCompile'.
> Could not find com.google.android:support-v4:r13.
Searched in the following locations:
https://jcenter.bintray.com/com/google/android/support-v4/r13/support-v4-r13.pom
https://jcenter.bintray.com/com/google/android/support-v4/r13/support-v4-r13.jar
https://repo1.maven.org/maven2/com/google/android/support-v4/r13/support-v4-r13.pom
https://repo1.maven.org/maven2/com/google/android/support-v4/r13/support-v4-r13.jar
file:/C:/Users/Henrykvdb/AppData/Local/Android/android-sdk/extras/android/m2repository/com/google/android/support-v4/r13/support-v4-r13.pom
file:/C:/Users/Henrykvdb/AppData/Local/Android/android-sdk/extras/android/m2repository/com/google/android/support-v4/r13/support-v4-r13.jar
file:/C:/Users/Henrykvdb/AppData/Local/Android/android-sdk/extras/google/m2repository/com/google/android/support-v4/r13/support-v4-r13.pom
file:/C:/Users/Henrykvdb/AppData/Local/Android/android-sdk/extras/google/m2repository/com/google/android/support-v4/r13/support-v4-r13.jar
Required by:
xkcdexplain:app:unspecified
xkcdexplain:app:unspecified > com.thehayro:infiniteviewpager:0.4
I tried manually adding the android support library and installing it with the android sdk manager but neither of those things worked.
I also read somewhere that I could try to find a download for the library and manually add it but there must be a more elegant way then that.
build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "25.0.0"
defaultConfig {
applicationId "com.henrykvdb.xkcdexplain"
minSdkVersion 21
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.4.0'
compile 'com.android.support:design:23.4.0'
compile 'org.jsoup:jsoup:1.10.1'
compile 'com.google.code.gson:gson:2.7'
compile 'com.thehayro:infiniteviewpager:0.4'
}
global/top-level build.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
mavenCentral()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
mavenCentral()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Related
I am making an Intro for my app.So after some research i had got an github project which is used to make cool intros.It requires following dependencies :
compile 'com.github.paolorotolo:appintro:4.0.0'
when I compile it with gradle it gives me following errors:
Failed to resolve: com.github.paolorotolo:appintro:4.0.0
I have done some research on internet but anything didn't worked out.
here is my build.gradle(Module:app)
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion "24.0.1"
defaultConfig {
applicationId "com.example.adarsh.testapp"
minSdkVersion 16
targetSdkVersion 24
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:24.2.0'
compile 'com.android.support:support-v4:24.2.0'
compile 'com.github.paolorotolo:appintro:4.0.0'
}
and here is my build.gradle(project:testapp)
// 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:2.1.3'
// 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
}
I solved my issue by just adding mavenCentral() in repositories in build.gradle.
I am trying to add facebook login. I am following the facebook quick starts. But I am getting the following error.
`
Error:(24, 0) Gradle DSL method not found: 'compile()'
Possible causes:<ul><li>The project 'FacebookAdd' may be using a version of Gradle that does not contain the method.
Open Gradle wrapper file</li><li>The build file may be missing a Gradle plugin.
Apply Gradle plugin</li>`
and the gradle.build files.
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
mavenCentral()
}
}
dependencies {
compile 'com.facebook.android:facebook-android-sdk:[4,5)'
}
task clean(type: Delete) {
delete rootProject.buildDir
}
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion "24.0.0"
defaultConfig {
applicationId "com.psycho.ayush.facebookadd"
minSdkVersion 17
targetSdkVersion 24
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:24.1.1'
}
P.S. I have gone through almost every question related to this on this site.
It looks like you have two dependencies sections please try this:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:24.1.1'
compile 'com.facebook.android:facebook-android-sdk:[4,5)'
}
and remove this
dependencies {
compile 'com.facebook.android:facebook-android-sdk:[4,5)'}
I'm trying to put Apache Tika into my project.
But it returns error, unfortunately, I couldn't solve this problem by myself.
How can I put Apache Tika using android studio?
Error:(27, 0) Gradle DSL method not found: 'runtime()'
Possible causes:The project 'AudioTest' may be using a version of Gradle that does not contain the method.
Open Gradle wrapper fileThe build file may be missing a Gradle plugin.
Apply Gradle plugin
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.example.test.audiotest"
minSdkVersion 16
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.1.0'
compile 'com.google.android.gms:play-services-appindexing:8.1.0'
runtime 'org.apache.tika:tika-parsers:1.13'
}
this is my build.gradle module:app
// 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:2.1.2'
// 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
}
this is my build.gradle project:AudioTest
change
runtime 'org.apache.tika:tika-parsers:1.13'
to
compile 'org.apache.tika:tika-parsers:1.13'
I am trying to build gradle with the following dependencies. but its not compiling. I have tried a lot by changing the versions by seeing forums. I search for the dependencies in project structure dialog and found the following two.
de.hdodenhof:circleimageview:2.0.0
com.mcxiaoke.volley:library-aar:1.0.1
Actually I am using two pc. This was build in another pc with following
de.hdodenhof:circleimageview:1.2.1
com.mcxiaoke.volley:library-aar:1.0.19
Still no luck and the gradle build taking 20-25 minutes each time
Main 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:1.5.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
}
App build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "com.example.map"
minSdkVersion 19
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
repositories {
mavenCentral()
}
dependencies {
compile('com.mapbox.mapboxsdk:mapbox-android-sdk:0.7.4#aar') {
transitive = true
}
compile 'de.hdodenhof:circleimageview:2.0.0'
compile 'com.mcxiaoke.volley:library:1.0.19'
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.1.0'
compile 'com.android.support:design:23.1.0'
compile 'com.android.support:recyclerview-v7:23.0'
}
This sounds like gradle is unable to reach the remote repository. Does your firewall block it, is your internet connection working,...?
Hi guys I'm having a problem Gradle DSL method not found: 'compile()'. Most of the discussions I read suggest that I add compile 'com.android.support:support-v4:21.+' to individual's module build file and in my case the compile 'com.android.support:support-v4:21.+' is already there. If I remove the one I added on the top most level build file I get this error (Error:Artifact 'support-v4.jar (com.android.support:support-v4:21.0.3)' not found. Android studio 1.0.2).
Please help, here are my gradle files:
// 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:1.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
dependencies {
compile 'com.android.support:support-v4:21.+'
}
Gradle file under App folder:
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "com.example.ntokozo.myapplication"
minSdkVersion 15
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:appcompat-v7:21.0.3'
compile 'com.android.support:support-v4:21.0.3'
}
Thank you.
Remove the dependencies block from the top level build.gradle file.
dependencies {
compile 'com.android.support:support-v4:21.+'
}
Also update your sdk files.