3

I am trying to add

 compile 'com.applozic.communication.uiwidget:mobicomkitui:3.38'

under dependencies in build.gradle but it is giving the following error Here is the whole logcat

I have added

include 'com.applozic.communication.uiwidget:mobicomkitui:3.38'

in settings.gradle.

Please help, I am new to these things. The link from which I am trying to implement my project is here Here is build.gradle(module:app)

apply plugin: 'com.android.application'

android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
packagingOptions{

    exclude 'META-INF/DEPENDENCIES'
    exclude 'META-INF/NOTICE'
    exclude 'META-INF/LICENSE'
    exclude 'META-INF/LICENSE.txt'
    exclude 'META-INF/NOTICE.txt'
    exclude 'META-INF/ECLIPSE_.SF'
    exclude 'META-INF/ECLIPSE_.RSA'


}

defaultConfig {
    applicationId "com.urjapawar.bevyphase1"
    minSdkVersion 14
    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.android.support:design:23.1.0'
compile 'com.applozic.communication.uiwidget:mobicomkitui:3.38'

}

and here is build.gradle(module:project)

buildscript {
repositories {
    mavenCentral()
}
dependencies {
    classpath 'com.android.tools.build:gradle:1.3.0'

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

allprojects {
  repositories {
    mavenCentral()
   }
  }

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

here is the log after cleaning project

Error:A problem occurred configuring project ':app'.

Could not resolve all dependencies for configuration ':app:_debugCompile'. Could not find com.applozic.communication.uiwidget:mobicomkitui:3.38. Searched in the following locations: https://repo1.maven.org/maven2/com/applozic/communication/uiwidget/mobicomkitui/3.38/mobicomkitui-3.38.pom https://repo1.maven.org/maven2/com/applozic/communication/uiwidget/mobicomkitui/3.38/mobicomkitui-3.38.jar file:/C:/Users/DELL/AppData/Local/Android/sdk/extras/android/m2repository/com/applozic/communication/uiwidget/mobicomkitui/3.38/mobicomkitui-3.38.pom file:/C:/Users/DELL/AppData/Local/Android/sdk/extras/android/m2repository/com/applozic/communication/uiwidget/mobicomkitui/3.38/mobicomkitui-3.38.jar file:/C:/Users/DELL/AppData/Local/Android/sdk/extras/google/m2repository/com/applozic/communication/uiwidget/mobicomkitui/3.38/mobicomkitui-3.38.pom file:/C:/Users/DELL/AppData/Local/Android/sdk/extras/google/m2repository/com/applozic/communication/uiwidget/mobicomkitui/3.38/mobicomkitui-3.38.jar Required by: BevyPhase1:app:unspecified

Devashish Mamgain
  • 2,077
  • 1
  • 18
  • 39
Urja Pawar
  • 1,087
  • 1
  • 15
  • 29
  • Post your build.gradle file – Harsh Dattani May 16 '16 at 06:57
  • Do you have a `respositories { }` section of your Gradle file? – OneCricketeer May 16 '16 at 07:00
  • 1
    It happens because you have to add the jcenter() repo. This library is not in the mavenCentral. – Gabriele Mariotti May 16 '16 at 10:53
  • But if jcenter() is added then Failed to resolve: com.android.support:appcompat-v7:23.1.1, Error:Failed to resolve: com.google.android.gms:play-services-location:8.4.0 etc which are present in https://github.com/AppLozic/Applozic-Android-SDK/blob/master/app/build.gradle occurs...I am udating my SDK that's why – Urja Pawar May 16 '16 at 11:05

2 Answers2

2

Go to your project's build.gradle file, and add jcenter()

 buildscript {
        repositories {
            jcenter()
        }
        dependencies {
            classpath 'com.android.tools.build:gradle:2.1.0'
            classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.1'
            //classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3'
           // classpath 'com.github.dcendents:android-maven-plugin:1.2'
            classpath 'com.novoda:bintray-release:0.3.4'

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

    allprojects {
        repositories {
            jcenter()
        }
    }

Source: https://github.com/AppLozic/Applozic-Android-SDK/blob/master/build.gradle

Devashish Mamgain
  • 2,077
  • 1
  • 18
  • 39
  • Now it shows six errors like Error:Failed to resolve: com.android.support:appcompat-v7:23.1.1, Error:Failed to resolve: com.google.android.gms:play-services-location:8.4.0 etc and they are not in my dependencies – Urja Pawar May 16 '16 at 08:11
  • @UrjaPawar can you try with: compile 'com.android.support:support-v4:23.1.1' compile 'com.android.support:appcompat-v7:23.1.1' compile 'com.android.support:design:23.1.1' – Devashish Mamgain May 16 '16 at 08:36
  • 1
    also use buildToolsVersion as 23.0.2 android { compileSdkVersion 23 buildToolsVersion "23.0.2" – Devashish Mamgain May 16 '16 at 08:37
1

try

repositories {
    mavenCentral()
}

 dependencies {
   compile fileTree(dir: 'libs', include: ['*.jar'])
   testCompile 'junit:junit:4.12'
   compile 'com.android.support:appcompat-v7:23.1.0'
   compile 'com.android.support:design:23.1.0'
   compile 'com.applozic.communication.uiwidget:mobicomkitui:3.39'
}
Shubhank
  • 21,721
  • 8
  • 65
  • 83