I am trying to import this library:
https://android-arsenal.com/details/1/2822
The instructions say:
The following goes in your module's build.gradle file:
repositories {
maven { url "https://jitpack.io" }
}
dependencies {
// ... other dependencies here
dependencies {
compile 'com.github.TouchBoarder:weekdays-buttons-bar:v1.0.2'
}
}
So I added to my app gradle the dependency (last line):
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "com.amazon.mysampleapp"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
multiDexEnabled = true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
debuggable true
}
}
lintOptions {
abortOnError false
}
sourceCompatibility = 1.7
targetCompatibility = 1.7
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile fileTree(include: ['*.jar'], dir: 'app/libs')
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:support-v4:23.4.0'
compile 'com.amazonaws:aws-android-sdk-core:2.2.18'
compile 'com.amazonaws:aws-android-sdk-cognito:2.2.18'
compile 'com.amazonaws:aws-android-sdk-s3:2.2.18'
compile 'com.amazonaws:aws-android-sdk-mobileanalytics:2.2.18'
compile 'com.amazonaws:aws-android-sdk-lambda:2.2.18'
compile 'com.android.support:design:23.4.0'
compile 'com.wdullaer:materialdatetimepicker:2.3.0'
compile 'com.yarolegovich:lovely-dialog:1.0.4'
compile 'com.amulyakhare:com.amulyakhare.textdrawable:1.0.1'
compile 'com.github.TouchBoarder:weekdays-buttons-bar:v1.0.2'
}
Then added the repository to my top level all projects gradle file:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.3'
}
}
allprojects {
repositories {
jcenter()
compile 'com.github.TouchBoarder:weekdays-buttons-bar:v1.0.2'
}
}
But it is not working I am getting the error:
Could not find method compile() for arguments [com.github.TouchBoarder:weekdays-buttons-bar:v1.0.2] on repository container.
I am obviously not writing my gradle file correctly but not sure what is wrong.
Try with removing repository from top level all projects gradle file like below...
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.3'
}
}
allprojects {
repositories {
jcenter()
}
}
Also you need to add maven url inside repositories to your app gradle.
apply plugin: 'com.android.application'
repositories {
maven {
url "https://jitpack.io"
}
}
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "com.amazon.mysampleapp"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
multiDexEnabled = true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
debuggable true
}
}
lintOptions {
abortOnError false
}
sourceCompatibility = 1.7
targetCompatibility = 1.7
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile fileTree(include: ['*.jar'], dir: 'app/libs')
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:support-v4:23.4.0'
compile 'com.amazonaws:aws-android-sdk-core:2.2.18'
compile 'com.amazonaws:aws-android-sdk-cognito:2.2.18'
compile 'com.amazonaws:aws-android-sdk-s3:2.2.18'
compile 'com.amazonaws:aws-android-sdk-mobileanalytics:2.2.18'
compile 'com.amazonaws:aws-android-sdk-lambda:2.2.18'
compile 'com.android.support:design:23.4.0'
compile 'com.wdullaer:materialdatetimepicker:2.3.0'
compile 'com.yarolegovich:lovely-dialog:1.0.4'
compile 'com.amulyakhare:com.amulyakhare.textdrawable:1.0.1'
compile 'com.github.TouchBoarder:weekdays-buttons-bar:v1.0.2'
}
I think it's a very simple error:
Try removing the v from v1.0.2
So, instead of
compile 'com.github.TouchBoarder:weekdays-buttons-bar:v1.0.2'
try this:
compile 'com.github.TouchBoarder:weekdays-buttons-bar:1.0.2'
I'm not sure if that's the issue, but you can give it a try.
EDIT: You also have to add jitpack to your repositories. If you look at the instructions, you can see it contains this:
repositories {
maven { url "https://jitpack.io" }
}
So add that to your gradle file:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.3'
}
}
allprojects {
repositories {
jcenter()
maven { url "https://jitpack.io" }
}
dependencies {
compile 'com.github.TouchBoarder:weekdays-buttons-bar:v1.0.2'
}
}
Related
I have this gradle in studio.Its works correctly but when i try to add new dependencies of graphView (compile 'com.jjoe64:graphview:4.2.2').It give me that failed to resolve error.
Here is my 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:2.2.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
mavenLocal()
maven { url "https://jitpack.io" }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Here is module gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "28.0.1"
defaultConfig {
applicationId "com.example.yawarabbas.gymcoach_app"
minSdkVersion 15
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true //important
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
dexOptions {
javaMaxHeapSize "4g"
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:26.0.0-alpha1'
testCompile 'junit:junit:4.12'
compile 'com.android.support:recyclerview-v7:26.0.0-alpha1'
compile 'com.android.support:design:26.0.0-alpha1'
compile 'com.android.support:support-core-ui:26.0.0-alpha1'
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'com.romandanylyk:pageindicatorview:1.0.2'
compile 'com.google.code.gson:gson:2.4'
compile 'pl.droidsonroids.gif:android-gif-drawable:1.2.15'
compile 'com.github.HotBitmapGG:RingProgressBar:V1.2.3'
compile 'com.jjoe64:graphview:4.2.2'
}
How to resolve it? I have read many solutions but it's not work.
I just added the volley from Jcenter :
compile 'com.android.volley:volley:1.0.0'
But I get the following error when syncing Gradle :
Error:Gradle DSL method not found: 'has()'
This is my gradle project file :
// 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.3.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
maven { url "https://jitpack.io" }
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
And this is my module gradle file :
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion '25.0.2'
defaultConfig {
applicationId "com.dash.dashapp"
minSdkVersion 21
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
debug {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:design:25.3.1'
compile 'com.android.support:support-v4:25.3.1'
compile 'com.android.support:recyclerview-v7:25.3.1'
compile 'com.android.support:cardview-v7:25.3.1'
compile 'com.google.code.gson:gson:2.8.0'
compile 'com.mindorks:placeholderview:0.2.7'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.github.PhilJay:MPAndroidChart:v3.0.2'
compile 'com.android.volley:volley:1.0.0'
testCompile 'junit:junit:4.12'
}
Changing the line in Volley's bintray.gradle file from
publish = project.has("release")
to
publish = project.hasProperty("release")
I have been trying for hours now to enable data binding in Android. Here is my gradle:
buildscript {
repositories {
mavenCentral()
maven { url 'http://download.crashlytics.com/maven' }
maven { url 'https://oss.sonatype.org/content/repositories/ksoap2-android-releases/' }
}
dependencies {
classpath 'com.crashlytics.tools.gradle:crashlytics-gradle:1.+'
classpath 'com.google.code.ksoap2-android:ksoap2-android:3.1.1'
classpath "com.android.databinding:dataBinder:1.0-rc0"
}
}
allprojects {
repositories {
jcenter()
mavenCentral()
}
}
apply plugin: 'com.android.application'
apply plugin: 'crashlytics'
repositories {
maven { url 'http://download.crashlytics.com/maven' }
maven { url 'https://oss.sonatype.org/content/repositories/ksoap2-android-releases/' }
}
android {
compileSdkVersion 16
buildToolsVersion "20.0.0"
defaultConfig {
applicationId "ts.kiosk.app.checkout"
minSdkVersion 16
targetSdkVersion 16
versionCode 2
versionName "0.0.2.258"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
lintOptions {
abortOnError false
}
sourceSets {
main {
assets.srcDirs = ['src/main/assets', 'src/main/assets/']
}
}
sourceSets {
androidTest.setRoot('src/test')
}
dataBinding {
enabled = true
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:support-v4:20.0.0'
compile 'com.crashlytics.android:crashlytics:1.+'
compile 'net.danlew:android.joda:2.7.2'
compile 'com.google.code.ksoap2-android:ksoap2-android:3.1.1'
compile 'com.squareup.retrofit:retrofit:1.6.1'
compile 'com.squareup.okhttp:okhttp-urlconnection:2.0.0'
compile 'com.squareup.okhttp:okhttp:2.0.0'
compile project(':asterixmodule')
compile project(':servicemodule')
compile project(':sdfclient')
// Robolectric
testCompile 'junit:junit:4.12'
testCompile 'org.hamcrest:hamcrest-library:1.3'
testCompile 'org.apache.maven:maven-ant-tasks:2.1.3' // fixes issue on linux/mac
testCompile 'org.robolectric:robolectric:3.0'
}
I keep getting the error:
Error:Could not find com.android.databindig:databinder:1.0.-rc1 .
I have also read similar posts on SO stating that you also have to add:
classpath 'com.android.tools.build:gradle:1.3.0-beta1'
but my gradle is 2.4 so I'm thinking I don't need that and of course if I do add that statement, gradle cannot find that version of gradle (1.3.0)
I upgraded to version 2.0 of Android Studio and the gradle build issue went away
remove
classpath "com.android.databinding:dataBinder:1.0-rc0"
Starting with android gradle plugin 1.5.0, all you need is
android {
dataBinding.enabled = true
}
check your gradle version, i resolved it by upgrading :
previously :
classpath "com.android.tools.build:gradle:1.3.0"
I updated to :
classpath "com.android.tools.build:gradle:2.2.0"
Or 1.5.0 and newer.
I'm getting error, while building gradle in android studio.
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion '23.0.2'
defaultConfig {
applicationId "com.whyz.kitetech.mobile.cdrapp"
minSdkVersion 18
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
repositories {
mavenCentral()
// maven { url 'http://repo1.maven.org/maven2' }
// maven { url "http://owasp-java-html-sanitizer.googlecode.com/svn/maven" }
//maven { url 'https://oss.sonatype.org/content/repositories/ksoap2-android-releases/' }
}
buildTypes {
debug {
debuggable = true
}
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile 'junit:junit:4.12'
compile 'com.android.support:cardview-v7:23.0.1'
compile 'com.android.support:appcompat-v7:23.0.1'
compile 'com.android.support:design:23.0.1'
compile 'com.android.support:recyclerview-v7:23.0.1'
// NOTE: vector-compat is available on API level 14 or later
compile 'com.wnafee:vector-compat:1.0.5'
compile 'de.codecrafters.tableview:tableview:0.9.5'
compile 'com.diogobernardino:williamchart:2.0.1'
}
First of all you have to move the repository block out side android block.
apply plugin: 'com.android.library'
android {
}
repositories {
mavenCentral()
// maven { url 'http://repo1.maven.org/maven2' }
// maven { url "http://owasp-java-html-sanitizer.googlecode.com/svn/maven" }
// maven { url 'https://oss.sonatype.org/content/repositories/ksoap2-android-releases/' }
}
Then your issue is that de.codecrafters.tableview doesn't exist on Central Maven or Jcenter.
As workaround you can use the github repo with the jitpack plugin
It is very simple.
Just add this repo tp your build.gradle
repositories {
// ...
maven { url "https://jitpack.io" }
}
and the dependency:
dependencies {
compile 'com.github.User:Repo:Tag'
}
In your case it seems to be:
compile 'com.github.ISchwarz23:SortableTableView:v0.9.5'
I'm trying to add this Library
But when Sync the Android Studio project following error is coming ..
Error:(58, 13) Failed to resolve: com.mikepenz:materialdrawer:4.3.5
I'm struck with this, please help me...
Build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig {
minSdkVersion 15
targetSdkVersion 22
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
repositories {
maven {
url "https://jitpack.io"
}
maven { url 'https://dl.bintray.com/kennyc1012/maven' }
}
repositories{
flatDir{
dirs 'libs'
}
}
dependencies {
compile files('libs/YouTubeAndroidPlayerApi.jar')
compile files('libs/android-support-v7-recyclerview.jar')
compile files('libs/jsoup-1.7.3.jar')
compile files('libs/universal-image-loader-1.9.2.jar')
compile 'com.android.support:appcompat-v7:22.2.1'
compile 'com.google.android.gms:play-services:7.8.0'
compile 'com.github.JayFang1993:DropDownMenu:96d390f9c4'
compile 'com.oguzdev:CircularFloatingActionMenu:1.0.2'
compile 'com.github.mrengineer13:snackbar:1.2.0'
compile 'com.mcxiaoke.volley:library-aar:1.0.0'
compile 'com.android.support:design:22.2.1'
}
dependencies {
compile('com.mikepenz:materialdrawer:4.3.5#aar') {
transitive = true
}
}
My guess is that this dependency is available on maven central. Try to add the central maven repo to your repositories and resync again.
repositories {
maven {
url "https://jitpack.io"
}
maven { url 'https://dl.bintray.com/kennyc1012/maven' }
mavenCentral()
}
Just remove the jcenter() in the Project build.gradle file with mavenCentral()