Could not resolve com.commonsware.cwac:camera:0.6.+ - android

I have added tedpicker in my applications from https://github.com/ParkSangGwon/TedPicker
but now for weeks when I try to sync gradle with internet this error shows up
Error:A problem occurred configuring project ':app'.
> Could not resolve all dependencies for configuration ':app:_debugApkCopy'.
> Could not resolve com.commonsware.cwac:camera:0.6.+.
Required by: YourApp:app:unspecified > com.github.ParkSangGwon:TedPicker:v1.0.10
> Could not resolve com.commonsware.cwac:camera:0.6.+.
> Failed to list versions for com.commonsware.cwac:camera.
> Unable to load Maven meta-data from https://repo.commonsware.com.s3.amazonaws.com/com/commonsware/cwac/camera/maven-metadata.xml.
> Could not GET https://repo.commonsware.com.s3.amazonaws.com/com/commonsware/cwac/camera/maven-metadata.xml'.
> Host name 'repo.commonsware.com.s3.amazonaws.com' does not match the certificate subject provided by the peer (CN=*.s3.amazonaws.com, O=Amazon.com Inc., L=Seattle, ST=Washington, C=US)
but It works fine if I switch to offline mode in gradle
also this is my app's buid.gradle
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.jakewharton.hugo:hugo-plugin:1.2.1'
}
} apply plugin: 'com.android.application'
apply plugin: 'com.jakewharton.hugo'
android {
compileSdkVersion 24
buildToolsVersion "24.0.2"
defaultConfig {
applicationId "org.urapp.urapp"
minSdkVersion 19
targetSdkVersion 22
versionCode 2
multiDexEnabled true
versionName "1.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/ASL2.0'}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
dexOptions {
maxProcessCount 4
javaMaxHeapSize "4g"
}
}
repositories {
mavenCentral()
jcenter()
maven {
url "https://repo.commonsware.com.s3.amazonaws.com"
}
maven { url "https://jitpack.io" }
}
android {
useLibrary 'org.apache.http.legacy'
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile project(':flexjson-2.1')
compile('org.apache.httpcomponents:httpmime:4.2.6') {
exclude module: 'httpclient'
}
compile project(':Android-AdvancedWebView')
compile project(':flexjson-2.1')
compile 'com.google.firebase:firebase-messaging:9.4.0'
compile 'com.google.firebase:firebase-core:9.4.0'
compile 'com.google.android.gms:play-services-auth:9.6.0'
compile 'com.google.android.gms:play-services-identity:9.6.0'
compile 'com.android.support:appcompat-v7:24.2.1'
compile 'org.apache.httpcomponents:httpclient:4.3.5'
compile 'com.android.support:design:24.2.1'
compile 'net.opacapp:multiline-collapsingtoolbar:1.2.2'
compile 'com.android.support:palette-v7:24.2.1'
compile 'com.github.ParkSangGwon:TedPicker:v1.0.10'
compile 'com.theartofdev.edmodo:android-image-cropper:2.3.+'
compile 'com.android.support:cardview-v7:24.2.1'
compile 'com.android.support:recyclerview-v7:24.2.1'
compile 'com.google.guava:guava:18.0'
compile 'com.github.oliveiradev:image-zoom:0.3.0'
compile 'com.android.support:percent:24.2.1'
compile 'com.android.support:multidex:1.0.1'
compile 'com.android.volley:volley:1.0.0'
compile 'de.hdodenhof:circleimageview:2.1.0'
compile 'com.toptoche.searchablespinner:searchablespinnerlibrary:1.3.1'
compile 'com.google.firebase:firebase-crash:9.4.0'
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'com.squareup.picasso:picasso:2.5.2'
}
afterEvaluate {
tasks.matching {
it.name.startsWith('dex')
}.each { dx ->
if (dx.additionalParameters == null) {
dx.additionalParameters = ['--multi-dex']
} else {
dx.additionalParameters += '--multi-dex'
}
}
}
subprojects {
project.plugins.whenPluginAdded { plugin ->
if ("com.android.build.gradle.AppPlugin".equals(plugin.class.name)) {
project.android.dexOptions.preDexLibraries = false
} else if ("com.android.build.gradle.LibraryPlugin".equals(plugin.class.name)) {
project.android.dexOptions.preDexLibraries = false
}
}
}
apply plugin: 'com.google.gms.google-services'

I have added tedpicker in my applications
I do not recommend using that library, since it has a dependency on a discontinued library (namely, my CWAC-Camera library).
but now for weeks when I try to sync gradle with internet this error shows up
Change url "https://repo.commonsware.com.s3.amazonaws.com" to url "https://s3.amazonaws.com/repo.commonsware.com".

29 March 2022
Just use it like this in Groovy:
implementation 'com.commonsware.cwac.camera:camera:0.6.17'
and in Kotlin:
implementation("com.commonsware.cwac.camera:camera:0.6.17")
and in build.gradle of project:
repositories {
google()
mavenCentral()
maven { url "https://s3.amazonaws.com/repo.commonsware.com"
allowInsecureProtocol = true}
}
https://mvnrepository.com/artifact/com.commonsware.cwac.camera/camera/0.6.17

Related

OneSignal and Google gms incompatibility

There is this error I get which you can see below.
I found what causes the error is the incompatibility between the gms version in my project and the one used in Onesignal.
I have checked every single solution proposed in these posts:
https://github.com/OneSignal/OneSignal-Android-SDK/issues/286
https://stackoverflow.com/questions/43430401/android-nosuchmethoderror-no-static-method-zzyljava-lang-object/43430478#comment86259725_43430478
Couldn't add OneSignal's Gradle plugin as suggested by OneSignal's official site.
Removing
apply plugin: 'com.google.gms.google-services'
and
classpath 'com.google.gms:google-services:3.2.0'
from gradle files will solve this error. But I cannot do it since I want to inflate MapView in my project and I need google-services.
Here is the error I get:
java.lang.NoSuchMethodError: No static method zza(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; in class Lcom/google/android/gms/common/internal/zzbq; or its super classes (declaration of 'com.google.android.gms.common.internal.zzbq' appears in /data/app/com.blah.blah-1/base.apk:classes2.dex)
at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source)
at android.app.ActivityThread.installProvider(ActivityThread.java:6326)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:5918)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5857)
at android.app.ActivityThread.-wrap3(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1699)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6682)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1410)
My build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
buildToolsVersion '27.0.3'
defaultConfig
{
applicationId "com.parsdigit.helsa"
manifestPlaceholders = [onesignal_app_id : "4af7b2c1-a1a8-4b4a-ade3-d65289b38267",
// Project number pulled from dashboard, local value is ignored.
onesignal_google_project_number: "REMOTE"]
minSdkVersion 21
targetSdkVersion 27
versionCode 1
versionName "1.0"
vectorDrawables.useSupportLibrary = true
multiDexEnabled true
}
buildTypes
{
release
{
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
debuggable true
}
}
aaptOptions {
cruncherEnabled = false
}
packagingOptions
{
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/notice.txt'
exclude 'META-INF/ASL2.0'
}
lintOptions
{
checkReleaseBuilds false
}
dexOptions
{
preDexLibraries = false
jumboMode true
javaMaxHeapSize "4g"
}
}
dependencies
{
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.squareup.okhttp3:okhttp:3.+'
compile 'com.android.support:multidex:1.0.2'
compile 'com.android.support:design:27.1.0'
compile 'com.android.support:appcompat-v7:27.1.0'
compile 'com.google.android.gms:play-services-maps:12.0.0'
compile 'com.android.support:recyclerview-v7:27.1.0'
compile 'com.onesignal:OneSignal:[3.8.3, 3.99.99]'
compile 'org.apache.httpcomponents:httpclient:4.5.4'
compile 'com.google.maps.android:android-maps-utils:0.4.3'
compile 'com.google.code.gson:gson:2.8.2'
compile 'uk.co.chrisjenx:calligraphy:2.2.0'
compile 'com.pixplicity.easyprefs:library:1.8.1#aar'
compile 'gun0912.ted:tedpermission:1.0.3'
compile 'com.kennyc:snackbar:2.5'
compile 'me.itangqi.waveloadingview:library:0.3.5'
compile 'com.daimajia.androidanimations:library:2.3#aar'
compile 'com.fujiyuu75:sequent:0.2.1'
compile 'pl.charmas.android:android-reactive-location:0.10#aar'
compile 'io.reactivex:rxjava:1.2.0'
compile 'me.zhanghai.android.materialratingbar:library:1.2.0'
compile 'cn.lightsky.infiniteindicator:library:1.2.2'
compile 'de.hdodenhof:circleimageview:2.2.0'
compile 'com.github.wooplr:Spotlight:1.2.3'
compile 'com.caverock:androidsvg:1.2.1'
compile 'com.github.bumptech.glide:glide:3.8.0'
compile project(':sidemenulibrary')
compile('com.github.ozodrukh:CircularReveal:1.1.1#aar') {
transitive = true;
}
compile 'org.greenrobot:eventbus:3.0.0'
compile 'com.nex3z:notification-badge:0.3.0'
compile 'com.github.Shashank02051997:FancyGifDialog-Android:1.1'
compile 'br.com.simplepass:loading-button-android:1.+'
compile 'com.github.blennerSilva:AwesomeDialog:2.0.5'
compile 'me.relex:circleindicator:1.2.2#aar'
compile 'com.airbnb.android:lottie:2.2.5'
compile 'net.yslibrary.keyboardvisibilityevent:keyboardvisibilityevent:2.1.0'
compile 'com.github.RobertApikyan:SegmentedControl:release_1.0.1'
compile 'com.github.skydoves:powermenu:2.0.1'
compile 'com.otaliastudios:cameraview:1.4.1'
compile 'com.github.Mostafa-MA-Saleh:EditCredit:1.5.0'
compile 'com.github.mreram:ShowCaseView:1.0.5'
compile 'com.mohamadamin:persianmaterialdatetimepicker:1.2.1'
compile 'com.alirezaafkar:sundatepicker:2.0.8'
compile('com.cedarmaps:CedarMapsSDK:2.0.0#aar') {
transitive = true
}
}
afterEvaluate
{
tasks.matching
{
it.name.startsWith('dex')
}
.each
{ dx ->
if (dx.additionalParameters == null) {
dx.additionalParameters = ['--multi-dex']
} else {
dx.additionalParameters += '--multi-dex'
}
}
}
apply plugin: 'com.google.gms.google-services'
My toplevel build.gradle:
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.0'
classpath 'com.google.gms:google-services:3.2.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
maven { url "http://repo.cedarmaps.com/android/" }
jcenter()
mavenCentral()
maven { url 'https://jitpack.io' }
maven { url 'https://dl.bintray.com/kennyc1012/maven' }
maven { url "http://dl.bintray.com/glomadrian/maven" }
maven { url "https://maven.google.com" }
google()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
POOOH! After struggling for a long couple of hours finally fixed the issue by:
changing
classpath 'com.google.gms:google-services:3.2.0'
to
classpath 'com.google.gms:google-services:3.2.1'
and updating
implementation 'com.google.android.gms:play-services-maps:12.0.0'
to
implementation 'com.google.android.gms:play-services-maps:12.0.1'

Error:Execution failed for task ':app:compileRetrolambdaDebug' - After Firebase integration

I am creating an application with the support of Retrolambda & RxJava2. Everything works fine until I needed to implement push notification functionality. I have configured firebase in my application, since then the execution failed with below error message.
Error:Execution failed for task ':app:transformClassesWithRetrolambdaForDebug'.
> Process 'command '/Library/Java/JavaVirtualMachines/jdk1.8.0_71.jdk/Contents/Home/bin/java'' finished with non-zero exit value 1
Top Level Build.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'me.tatarka:gradle-retrolambda:3.7.0'
classpath 'com.google.gms:google-services:3.0.0'
}
}
allprojects {
repositories {
jcenter()
maven { url "https://jitpack.io" }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Application level Build.gradle
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
apply plugin: 'me.tatarka.retrolambda'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.solver.inventory"
minSdkVersion 21
targetSdkVersion 25
versionCode 2
versionName "Beta V2.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary true
multiDexEnabled true
}
dexOptions {
preDexLibraries = false
javaMaxHeapSize "4g"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
packagingOptions {
//Use “exclude” to point at the specific file (or files) that Android Studio is complaining about//
exclude 'META-INF/rxjava.properties'
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile(name: 'aficustomprint', ext: 'aar')
compile('com.github.KingsMentor:MobileVisionBarcodeScanner:v1.2') { transitive = true; }
compile('com.crashlytics.sdk.android:crashlytics:2.6.8#aar') {
transitive = true;
}
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:cardview-v7:25.3.1'
compile 'com.android.support:recyclerview-v7:25.3.1'
compile 'com.android.support:design:25.3.1'
compile 'io.reactivex.rxjava2:rxjava:2.1.0'
compile 'io.reactivex.rxjava2:rxandroid:2.0.1'
compile 'com.squareup.retrofit2:retrofit:2.3.0'
compile 'com.google.code.gson:gson:2.8.1'
compile 'com.squareup.retrofit2:adapter-rxjava2:2.3.0'
compile 'com.squareup.retrofit2:converter-gson:2.3.0'
compile 'com.squareup.okhttp3:okhttp:3.8.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:support-v4:25.3.1'
compile 'com.mcxiaoke.volley:library:1.0.6'
compile 'org.apache.commons:commons-io:1.3.2'
compile 'com.jakewharton.rxbinding:rxbinding-appcompat-v7:0.4.0'
compile 'com.getbase:floatingactionbutton:1.10.1'
compile 'com.google.firebase:firebase-messaging:10.0.1'
testCompile 'junit:junit:4.12'
}
repositories {
flatDir {
dirs 'libs'
}
maven { url 'https://maven.fabric.io/public' }
}
retrolambda {
javaVersion JavaVersion.VERSION_1_7
jvmArgs '-noverify'
defaultMethods false
incremental true
}
apply plugin: 'com.google.gms.google-services'
Everything works fine again if I remove the firebase from my application. Please help me out of this.

Failed to resolve com.android.support.test:runner:1.0.0 and 'com.android.support.test.espresso:espresso-core:3.0.0'

This is my build.gradle(app)
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
repositories {
maven { url 'https://maven.fabric.io/public' }
}
android {
compileSdkVersion 26
buildToolsVersion "26.0.1"
defaultConfig {
applicationId "com.my.app"
minSdkVersion 16
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
dataBinding {
enabled = true
}
packagingOptions {
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
}
}
ant.importBuild 'assets.xml'
preBuild.dependsOn(list, checksum)
clean.dependsOn(clean_assets)
def dagger_version = "2.10"
def retrofit2_version = "2.2.0"
def support_package_version = "26.0.0-alpha1"
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'
})
//dagger
compile "com.google.dagger:dagger:${dagger_version}"
annotationProcessor "com.google.dagger:dagger-compiler:${dagger_version}"
//retrofit2
compile "com.squareup.retrofit2:retrofit:${retrofit2_version}"
compile "com.squareup.retrofit2:converter-jackson:${retrofit2_version}"
//okhttp3
//support packages
compile "com.android.support:appcompat-v7:${support_package_version}"
compile "com.android.support:cardview-v7:${support_package_version}"
compile "com.android.support:design:${support_package_version}"
compile project(':pocketsphinx-android-5prealpha-release')
compile 'pl.bclogic:pulsator4droid:1.0.3'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.squareup.okhttp3:logging-interceptor:3.4.1'
compile 'com.android.support:support-annotations:25.3.1'
testCompile 'junit:junit:4.12'
testCompile 'org.mockito:mockito-core:1.10.19'
androidTestCompile 'com.android.support.test.espresso:espresso-core:3.0.0'
androidTestCompile 'com.android.support.test:runner:1.0.0'
compile('com.crashlytics.sdk.android:crashlytics:2.6.8#aar') {
transitive = true;
}
}
I have noted the controversial dependencies from here
And I get the following errors
Failed to resolve:com.android.support.test.espresso:espresso-core:3.0.0
Failed to resolve:com.android.support.test:runner:1.0.0
I have updated the sdk manager, but still facing this. Do I have to downgrade to a lower version?
Can anyone help?
I had the same problem when I wanted to try Espresso.
I've resolved it by adding
maven {
url "https://maven.google.com"
}
to
allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}
}
in the project's build.gradle file. See https://developer.android.com/topic/libraries/testing-support-library/packages.html#gradle-dependencies.

How to include .aar dependency into Android library .aar file

I write some library, which has a portion of UI. Also, this library uses another libraries.
I want to provide release .aar to use this portion of UI in any App.
My library has next dependecies:
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:design:23.1.1'
compile 'com.android.support:support-v4:23.1.1'
compile ('com.android.support:recyclerview-v7:22.2.1'){
exclude group: 'com.android.support', module: 'support-v4'
}
compile 'com.inthecheesefactory.thecheeselibrary:stated-fragment-support-v4:0.10.0'
//Http communication, websockets, etc.
compile 'com.squareup.okhttp:okhttp:2.4.0'
compile 'com.squareup.retrofit:retrofit:1.9.0'
//Fonts
compile 'uk.co.chrisjenx:calligraphy:2.1.0'
//Unit tests
testCompile 'junit:junit:4.12'
testCompile 'org.mockito:mockito-core:1.9.5'
//Other
compile ('org.apache.commons:commons-lang3:3.4'){
exclude group: 'org.apache.httpcomponents'
}
//Reactive programmnig
compile 'io.reactivex:rxjava:1.0.13'
compile 'io.reactivex:rxandroid:0.25.0'
compile 'com.github.bumptech.glide:glide:3.6.1'
When I built .aar everything is fine, but when I inlude this .aar into another app, I have next problems:
1). ./gradlew clean build
/home/user/projects/MainApp/app/build/intermediates/exploded-aar/com.my.sdk/SDK/0.0.1/res/values/values.xml:78:21-29
: No resource found that matches the given name: attr 'fontPath'.
/home/user/projects/MainApp/app/build/intermediates/exploded-aar/com.my.sdk/SDK/0.0.1/res/values/values.xml:78:21-29
: No resource found that matches the given name: attr 'fontPath'.
/home/user/projects/MainApp/app/build/intermediates/exploded-aar/com.my.sdk/SDK/0.0.1/res/values/values.xml:78:21-29
: No resource found that matches the given name: attr 'fontPath'.
/home/user/projects/MainApp/app/build/intermediates/exploded-aar/com.my.sdk/SDK/0.0.1/res/values/values.xml:78:21-29
: No resource found that matches the given name: attr 'fontPath'.
/home/user/projects/MainApp/app/build/intermediates/exploded-aar/com.my.sdk/SDK/0.0.1/res/values/values.xml:78:21-29
: No resource found that matches the given name: attr 'fontPath'.
/home/user/projects/MainApp/app/build/intermediates/exploded-aar/com.my.sdk/SDK/0.0.1/res/values/values.xml:78:21-29
: No resource found that matches the given name: attr 'fontPath'.
:app:processDebugResources FAILED
Solution is very simple - add to MainApp/app/build.gradle next line:
compile 'uk.co.chrisjenx:calligraphy:2.1.0'
2). When I run MainApp getting this error:
java.lang.NoClassDefFoundError: com.my.sdk.ui.fragment.DialogAppNotInstalledFragment
To solve this I need to add compile 'com.inthecheesefactory.thecheeselibrary:stated-fragment-support-v4:0.10.0' to MainApp/app/build.gradle.
Same to other dependecies.
In the result I need just copy-paste all my dependecies from my library project to MainApp project.
Is it possible to make library aar contain all necessery dependecies?
build.gradle of library:
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.3.0'
}
}
apply plugin: 'com.android.library'
apply plugin: 'maven-publish'
//apply from: 'https://raw.github.com/chrisbanes/gradle-mvn-push/master/gradle-mvn-push.gradle'
repositories {
mavenCentral()
}
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
minSdkVersion 14
targetSdkVersion 23
versionCode 1
versionName "0.0.1"
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_6
targetCompatibility JavaVersion.VERSION_1_6
}
dexOptions {
preDexLibraries = false
incremental true
javaMaxHeapSize "4g"
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude '.readme'
}
lintOptions {
abortOnError false
}
sourceSets {
main {
assets.srcDirs = ['src/main/assets', 'src/main/assets/']
}
}
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:23.1.1'
compile 'com.android.support:design:23.1.1'
compile 'com.android.support:support-v4:23.1.1'
compile ('com.android.support:recyclerview-v7:22.2.1'){
exclude group: 'com.android.support', module: 'support-v4'
}
compile 'com.inthecheesefactory.thecheeselibrary:stated-fragment-support-v4:0.10.0'
//Http communication, websockets, etc.
compile 'com.squareup.okhttp:okhttp:2.4.0'
compile 'com.squareup.retrofit:retrofit:1.9.0'
//Fonts
compile 'uk.co.chrisjenx:calligraphy:2.1.0'
//Unit tests
testCompile 'junit:junit:4.12'
testCompile 'org.mockito:mockito-core:1.9.5'
//Other
compile ('org.apache.commons:commons-lang3:3.4'){
exclude group: 'org.apache.httpcomponents'
}
//Reactive programmnig
compile 'io.reactivex:rxjava:1.0.13'
compile 'io.reactivex:rxandroid:0.25.0'
compile 'com.github.bumptech.glide:glide:3.6.1'
}
// To publish to maven local execute "gradle clean build publishToMavenLocal"
// To publish to nexus execute "gradle clean build publish"
android.libraryVariants
publishing {
publications {
maven(MavenPublication) {
artifact "${project.buildDir}/outputs/aar/${project.name}-release.aar"
artifactId = POM_ARTIFACT_ID
groupId = GROUP
version = VERSION_NAME
// Task androidSourcesJar is provided by gradle-mvn-push.gradle
//artifact androidSourcesJar {
// classifier "sources"
//}
}
}
repositories {
maven {
credentials {
username System.getenv('NEXUS_USER_NAME')
password System.getenv('NEXUS_PASSWORD')
}
url "http://my-nexus-url/"
}
}
}
MainApp/app/build.gradle:
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
repositories {
maven { url 'https://maven.fabric.io/public' }
maven { url 'http://my-nexus-url/' }
flatDir {
dirs 'libs'
}
}
android {
signingConfigs {
some_config {
keyAlias 'some alias'
keyPassword '741789654uppy'
storeFile file('../my-keystore.jks')
storePassword 'some_password'
}
}
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.company.app.android"
minSdkVersion 14
targetSdkVersion 23
versionCode 9
versionName "1.0.0"
}
dexOptions {
preDexLibraries = false
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
signingConfig signingConfigs.some_config
}
}
}
dependencies {
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:support-v4:23.1.1'
compile files('libs/StartAppInApp-2.3.1.jar')
// compile files('libs/android-support-v4.jar')
compile files('libs/applovin-sdk-5.2.0.jar')
compile('com.crashlytics.sdk.android:crashlytics:2.5.2#aar') {
transitive = true;
}
//here is my library!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
compile('com.my.sdk:SDK:0.0.1#aar'){
transitive = true;
exclude(group:'android.support', module: 'support-v4')
}
//***********************************************
//Dependecies from library
//***********************************************
compile 'uk.co.chrisjenx:calligraphy:2.1.0'
compile 'com.squareup.okhttp:okhttp:2.4.0'
compile 'com.squareup.retrofit:retrofit:1.9.0'
compile 'io.reactivex:rxjava:1.0.13'
compile 'io.reactivex:rxandroid:0.25.0'
compile 'com.github.bumptech.glide:glide:3.6.1'
compile ('com.android.support:recyclerview-v7:22.2.1'){
exclude group: 'com.android.support', module: 'support-v4'
}
compile 'org.lucasr.twowayview:twowayview:0.1.4'
compile 'com.android.support:appcompat-v7:23.1.1'
compile ('org.apache.commons:commons-lang3:3.4'){
exclude group: 'org.apache.httpcomponents'
}
compile 'com.inthecheesefactory.thecheeselibrary:stated-fragment-support-v4:0.10.0'
//************************************************
}
UPDATE
Generated POM file:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.my.sdk</groupId>
<artifactId>SDK</artifactId>
<version>0.0.1</version>
<packaging>aar</packaging>
</project>
If anybody have the same problem, you may obtain correct answer here
Result build.gradle is:
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.3.0'
}
}
apply plugin: 'com.android.library'
apply plugin: 'maven-publish'
repositories {
mavenCentral()
}
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
minSdkVersion 14
targetSdkVersion 23
versionCode 1
versionName "0.0.1"
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_6
targetCompatibility JavaVersion.VERSION_1_6
}
dexOptions {
preDexLibraries = false
incremental true
javaMaxHeapSize "4g"
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude '.readme'
}
lintOptions {
abortOnError false
}
sourceSets {
main {
assets.srcDirs = ['src/main/assets', 'src/main/assets/']
}
}
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:23.1.1'
compile 'com.android.support:design:23.1.1'
compile 'com.android.support:support-v4:23.1.1'
compile ('com.android.support:recyclerview-v7:22.2.1'){
exclude group: 'com.android.support', module: 'support-v4'
}
compile 'com.inthecheesefactory.thecheeselibrary:stated-fragment-support-v4:0.10.0'
//Http communication, websockets, etc.
compile 'com.squareup.okhttp:okhttp:2.4.0'
compile 'com.squareup.retrofit:retrofit:1.9.0'
//Fonts
compile 'uk.co.chrisjenx:calligraphy:2.1.0'
//Unit tests
testCompile 'junit:junit:4.12'
testCompile 'org.mockito:mockito-core:1.9.5'
//Other
compile ('org.apache.commons:commons-lang3:3.4'){
exclude group: 'org.apache.httpcomponents'
}
//Reactive programmnig
compile 'io.reactivex:rxjava:1.0.13'
compile 'io.reactivex:rxandroid:0.25.0'
compile 'com.github.bumptech.glide:glide:3.6.1'
}
// To publish to maven local execute "gradle clean build publishToMavenLocal"
// To publish to nexus execute "gradle clean build publish"
android.libraryVariants
publishing {
publications {
maven(MavenPublication) {
artifact "${project.buildDir}/outputs/aar/${project.name}-release.aar"
artifactId = POM_ARTIFACT_ID
groupId = GROUP
version = VERSION_NAME
pom.withXml {
def depsNode = asNode().appendNode('dependencies')
configurations.compile.allDependencies.each { dep ->
if(dep.name != null && dep.group != null && dep.version != null) {
def depNode = depsNode.appendNode('dependency')
depNode.appendNode('groupId', dep.group)
depNode.appendNode('artifactId', dep.name)
depNode.appendNode('version', dep.version)
//optional add scope
//optional add transitive exclusions
}
}
}
}
}
repositories {
maven {
credentials {
username System.getenv('NEXUS_USER_NAME')
password System.getenv('NEXUS_PASSWORD')
}
url "http://nexus-repository-url/"
}
}
}

Gradle cannot find volley on maven

I can't find the url on maven too build my project.
My android studio gives the following error:
Error:com.mcxiaoke.volley:library:1.0.+ (double-click here to find usages.)
The whole build.gradle file
apply plugin: 'android'
android {
compileSdkVersion 19
buildToolsVersion '19.0.3'
defaultConfig {
minSdkVersion 9
targetSdkVersion 19
versionCode 100
versionName "1.00"
}
buildTypes {
release {
runProguard false
proguardFile getDefaultProguardFile('proguard-android.txt')
}
}
productFlavors {
defaultFlavor {
proguardFile 'proguard-rules.txt'
}
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/LICENSE'
exclude 'META-INF/NOTICE'
}
}
repositories {
mavenCentral()
maven {
url 'https://oss.sonatype.org/content/repositories/snapshots/'
}
maven {
url 'http://clinker.47deg.com/nexus/content/groups/public'
}
}
dependencies {
compile 'com.android.support:appcompat-v7:+'
compile 'com.android.support:support-v4:19.1.0'
compile 'com.google.android.gms:play-services:4.3.23'
compile 'joda-time:joda-time:2.3#jar'
compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.0'
compile 'com.j256.ormlite:ormlite-core:4.48#jar'
compile 'com.j256.ormlite:ormlite-android:4.48#jar'
compile 'com.loopj.android:android-async-http:1.4.5-SNAPSHOT'
compile 'com.mcxiaoke.volley:library:1.0.+'
compile 'com.google.code.gson:gson:2.2.4'
compile 'com.github.chrisbanes.actionbarpulltorefresh:extra-abc:+'
compile 'com.astuetz:pagerslidingtabstrip:1.0.1'
compile ('com.fortysevendeg.swipelistview:swipelistview:1.0-SNAPSHOT#aar') {
transitive = true
}
compile project(':libraries:facebook')
}
As you see in the file I added mavenCentral() to the dependencies but that didn't help.
Double check you have the right repository declaration in your build.gradle:
repositories {
mavenCentral()
}

Categories

Resources