Я создал библиотеку с другой внешней библиотекой в качестве ее зависимости,
Например: я использовал Picasso
в своей библиотеке для загрузки изображений, она прекрасно работает, если я включаю ее в свой пример проекта, но когда яраспространяйте его через jitpack
, jcenter
или maven
, внешние зависимости не включаются в него.
(т.е.) Моя библиотека импортируется, но Picasso
, от которой зависит моя библиотека, невключить, следовательно, я получаю сбой как ClassNotFoundException
, не нашел класс по пути: DexPathList
Ошибка, когда я включаю свою библиотеку в качестве зависимости от какого-то другого проекта
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
Уровень проекта 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
}
Библиотека build.gradle (appeevel 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'
Может кто-нибудь помочь мне с моей ошибкой?