I made a library with another external library as it's dependency,
eg: I used Picasso
in my library for image loading, it works fine if I include that in my sample project, but when I distribute it through jitpack
, jcenter
or maven
, the external dependencies do not get included it with.
(i.e.) My library gets imported, but Picasso
which my library depends upon do not get included, hence I get a crash as ClassNotFoundException
, Didn't find class on path: DexPathList
Error when I include my library as a dependency on some other project
Caused by: android.view.InflateException: Binary XML file line #14:
Binary
XML file line #14: Error inflating class com.rd.PageIndicatorView
Caused by: android.view.InflateException: Binary XML file line #14:
Error
inflating class com.rd.PageIndicatorView
E/AndroidRuntime: Caused by: java.lang.ClassNotFoundException:
Didn't find
class "com.rd.PageIndicatorView" on path: DexPathList
Project level build.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
google()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Library build.gradle (app leevel build.gradle)
apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'
group = 'com.github.technolifestyle'
ext {
bintrayRepo = 'AutoImageFlipper'
bintrayName = 'AutoImageFlipper'
publishedGroupId = 'com.github.technolifestyle'
libraryName = 'AutoImageFlipper'
artifact = 'imageslider'
libraryDescription = 'A carousel like implementation for Android with many functionalities'
siteUrl = 'https://github.com/therealshabi/AutoImageFlipper/'
gitUrl = 'https://github.com/therealshabi/AutoImageFlipper.git'
libraryVersion = '1.5.3-beta.5'
developerId = 'therealshabi'
developerName = 'Shahbaz Hussain'
developerEmail = 'shahbaz.h96@gmail.com'
licenseName = 'The Apache Software License, Version 2.0'
licenseUrl = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
allLicenses = ["Apache-2.0"]
}
android {
compileSdkVersion 28
buildToolsVersion '28.0.3'
defaultConfig {
multiDexEnabled true
minSdkVersion 17
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
api fileTree(include: ['*.jar'], dir: 'libs')
implementation 'androidx.appcompat:appcompat:1.1.0-alpha01'
implementation 'com.romandanylyk:pageindicatorview:1.0.3@aar'
implementation 'com.squareup.picasso:picasso:2.71828'
implementation 'androidx.multidex:multidex:2.0.1'
testImplementation 'junit:junit:4.12'
}
apply from: 'https://raw.githubusercontent.com/nuuneoi/JCenter/master/installv1.gradle'
apply from: 'https://raw.githubusercontent.com/nuuneoi/JCenter/master/bintrayv1.gradle'
Can anyone help me with where I am going wrong?