Reputation: 141
My gradle dependency is
repositories {
google()
mavenCentral()
// maven { url "http://maven.ghostscript.com" }
maven { url 'https://jitpack.io' }
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
Use these app dependency
buildTypes {
release {
shrinkResources true
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/NOTICE'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
}
kotlinOptions {
jvmTarget = '1.8'
}
}
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.core:core-ktx:1.3.2'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
//implementation files('libs/aspose-slides-20.6-android.via.java.jar')
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
implementation 'com.google.android.material:material:1.2.1'
implementation 'com.github.bumptech.glide:glide:4.11.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.11.0'
implementation 'commons-io:commons-io:20030203.000550'
implementation "com.pdfview:pdfview-android:1.0.0"
//implementation 'com.android.support:multidex:1.0.3'
// https://github.com/googlesamples/easypermissions
// implementation 'pub.devrel:easypermissions:1.1.0'
implementation ('com.github.junrar:junrar:7.4.0') {
['org.apache.commons','commons-logging'].each {
exclude group: "$it"
}
}
implementation 'io.reactivex.rxjava3:rxandroid:3.0.0'
// Because RxAndroid releases are few and far between, it is recommended you also
// explicitly depend on RxJava's latest version for bug fixes and new features.
// (see https://github.com/ReactiveX/RxJava/releases for latest 3.x.x version)
implementation 'io.reactivex.rxjava3:rxjava:3.0.8'
// implementation files('libs/itsrts_pptviewer.jar')
implementation 'com.agrawalsuneet.androidlibs:dotsloader:1.4'
implementation 'com.google.android.gms:play-services-ads:19.6.0'
implementation 'org.apache.commons:commons-lang3:3.11'
implementation files('libs/jxl.jar')
implementation files('libs/aspose-words-17.2.0-android.jar')
implementation "com.folioreader:folioreader:0.5.4"
}
While creating release signed Apk this error occurs, how can I solve it? Cannot solve these error while delete gradle cache and also invalidate and restart Android Studio.
java.lang.ClassCastException: com.android.tools.r8.s.b.C cannot be cast to com.android.tools.r8.s.b.B
com.android.tools.r8.CompilationFailedException: Compilation failed to complete, position:Lorg/readium/r2/streamer/parser/epub/OPFParser;parseSpine(Lorg/readium/r2/shared/parser/xml/Node;Lorg/readium/r2/shared/Publication;)V, origin: C:\Users\Asif Malik.gradle\caches\transforms2\files2.1\202fad4fee5b15436e55e2114f613e17\jetified-r2streamerkotlin1.0.42runtime.jar:org/readium/r2/streamer/parser/epub/OPFParser.class
com.android.tools.r8.s.b.C cannot be cast to com.android.tools.r8.s.b.B
Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)
Re-download dependencies and sync project (requires network)
The state of a Gradle build process (daemon) may be corrupt
Upvotes: 2
Views: 963
Reputation: 370
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
ndk {
debugSymbolLevel 'SYMBOL_TABLE'
}
}
}
Set minifyEnabled false solved my issue .go to build.gradle and do this change
Upvotes: 0
Reputation: 4628
This is the R8 issue tracked in http://issuetracker.google.com/175132220.
Upvotes: 1