I get ClassCircularityError when my app launch. It seems to appear after I added
implementation 'com.google.android.play:core:1.6.5'
to my app level gradle file. Here is my stacktrace:
Fatal Exception: java.lang.ClassCircularityError: Class byte extends itself (declaration of 'byte' appears in base.apk!classes3.dex)
at dalvik.system.DexFile.defineClassNative(DexFile.java)
at dalvik.system.DexFile.defineClass(DexFile.java:282)
at dalvik.system.DexFile.loadClassBinaryName(DexFile.java:275)
at dalvik.system.DexPathList$Element.findClass(DexPathList.java:677)
at dalvik.system.DexPathList.findClass(DexPathList.java:466)
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:123)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
Crash appears on this piece of code:
public void onCreate() {
super.onCreate();
.......................
db = Room.databaseBuilder(getApplicationContext(),
AppDatabase.class, "database-name")
.fallbackToDestructiveMigration()
.build(); // on this line
.............................
Also it appears in another place, just in first line of launching activity onCreate() method.
Here is my whole dependency list:
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
// Required for local unit tests (JUnit 4 framework)
implementation "com.android.support:support-v4:28.0.0"
testImplementation 'junit:junit:4.12'
testImplementation 'org.mockito:mockito-core:2.17.0'
//Room
implementation "android.arch.persistence.room:runtime:1.1.1"
kapt "android.arch.persistence.room:compiler:1.1.1"
// Required for instrumented tests
androidTestImplementation "com.android.support:support-annotations:$supportVersion"
androidTestImplementation 'com.android.support.test:runner:1.0.2'
implementation 'com.afollestad.material-dialogs:core:0.9.5.0'
//social networks
implementation 'com.facebook.android:facebook-android-sdk:[5,6)'
//support libs
implementation 'com.android.support:multidex:1.0.3'
implementation "com.android.support:appcompat-v7:28.0.0"
implementation "com.android.support:cardview-v7:28.0.0"
implementation "com.android.support:customtabs:28.0.0"
implementation "com.android.support:recyclerview-v7:28.0.0"
implementation "com.android.support:design:28.0.0"
implementation "com.android.support:percent:28.0.0"
//google libs
implementation "com.google.firebase:firebase-messaging:17.4.0"
implementation "com.google.firebase:firebase-core:16.0.7"
implementation "com.google.android.gms:play-services-location:$googleVersion"
implementation 'com.google.android.play:core:1.6.5'
//cupboard
implementation 'nl.qbusict:cupboard:2.2.0'
implementation 'nl.littlerobots.cupboard-tools:gson:0.3.1'
implementation 'com.github.smart-fun:XmlToJson:1.4.4'
//rest
implementation 'com.squareup.retrofit:retrofit:1.9.0'
implementation 'com.squareup.okhttp:okhttp:2.7.0'
implementation 'com.squareup.okhttp:okhttp-urlconnection:2.5.0'
implementation 'io.reactivex:rxandroid:1.2.1'
implementation 'io.reactivex:rxjava:1.3.1'
//MVP
implementation "com.arello-mobile:moxy:$moxyVersion"
implementation "com.arello-mobile:moxy-app-compat:$moxyVersion"
kapt "com.arello-mobile:moxy-compiler:$moxyVersion"
//butter
implementation "com.jakewharton:butterknife:$butterKnifeVersion"
kapt "com.jakewharton:butterknife-compiler:$butterKnifeVersion"
//animation
implementation 'com.andkulikov:transitionseverywhere:1.7.6'
implementation 'org.greenrobot:eventbus:3.1.1'
implementation 'com.github.bumptech.glide:glide:4.8.0'
kapt 'com.github.bumptech.glide:compiler:4.8.0'
implementation 'joda-time:joda-time:2.9.9'
implementation 'com.romandanylyk:pageindicatorview:0.2.0'
implementation 'com.github.markomilos:paginate:0.5.1'
implementation 'com.splunk.mint:mint:5.0.0'
implementation 'androidmads.library.qrgenearator:QRGenearator:1.0.3'
implementation group: 'com.jakewharton.rxrelay', name: 'rxrelay', version: '1.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
implementation('com.journeyapps:zxing-android-embedded:3.6.0') { transitive = false }
implementation 'com.journeyapps:zxing-android-embedded:3.2.0#aar'
implementation 'me.relex:circleindicator:1.2.2#aar'
implementation 'com.birbit:android-priority-jobqueue:2.0.1'
implementation 'com.makeramen:roundedimageview:2.3.0'
implementation 'com.github.jakob-grabner:Circle-Progress-View:v1.3'
implementation 'com.github.javiersantos:BottomDialogs:1.2.1'
implementation 'com.github.zcweng:switch-button:0.0.3#aar'
implementation 'jp.wasabeef:blurry:2.1.1'
implementation 'co.infinum:goldfinger:1.1.1'
implementation 'co.infinum:goldfinger-rx:1.1.1'
implementation "android.arch.work:work-runtime:1.0.1"
implementation "ru.tinkoff.decoro:decoro:1.3.4"
implementation 'com.facebook.stetho:stetho:1.5.0'
implementation 'com.github.GoodieBag:Pinview:v1.3'
implementation 'com.beust:klaxon:3.0.1'
implementation 'com.jakewharton.rxbinding2:rxbinding:2.2.0'
implementation('com.crashlytics.sdk.android:crashlytics:2.9.1#aar') {
transitive = true
}
implementation 'io.reactivex.rxjava2:rxandroid:2.1.1'
implementation project(':bottom-navigation-bar-release')
implementation 'com.google.android.gms:play-services-maps:16.1.0'
implementation 'com.squareup.whorlwind:whorlwind:2.0.0'
implementation 'com.google.maps.android:android-maps-utils:0.4.4'
implementation 'com.bartoszlipinski:recyclerviewheader2:2.0.1'
implementation group: 'org.simpleframework', name: 'simple-xml', version: '2.7'
//App icon badge related library dependency
implementation "me.leolin:ShortcutBadger:1.1.22#aar"
implementation 'com.thoughtbot:expandablecheckrecyclerview:1.4'
// Range seekbar library dependency
compile 'com.crystal:crystalrangeseekbar:1.1.3'
implementation 'android.arch.persistence.room:rxjava2:1.1.1'
// Date and Time picker dialog
implementation 'com.github.florent37:SingleDateAndTimePicker:v2.0.4'
}
Related
I have upgraded gradle to latest gradle 7 from gradle 4 .
while executing allDepInsight --configuration compileClasspath --dependency log4j-core I am getting below error
Could not determine the dependencies of task ':project-module-test:allDepInsight'.
Cannot query the value of task 'allDepInsight' property 'showingAllVariants' because it has no value available.
Please find below build.gradle file
apply plugin: 'groovy'
sourceSets {
attributesTest {
java { srcDir 'src/main/java' }
groovy { srcDir 'src/main/groovy' }
resources { srcDirs = ['src/main/resources'] }
compileClasspath = sourceSets.main.output + configurations.runtimeClasspath
runtimeClasspath = compileClasspath + output
}
}
dependencies {
testImplementation group: 'junit', name: 'junit', version: '4.13.1'
implementation 'org.jboss.resteasy:jaxrs-api:3.0.12.Final'
implementation 'org.jboss.resteasy:resteasy-client:3.11.3.Final'
implementation 'org.freemarker:freemarker:2.3.30'
implementation 'com.google.code.gson:gson:2.8.9'
implementation 'org.apache.httpcomponents:httpmime:4.5.1'
implementation 'org.apache.commons:commons-lang3:3.1'
implementation 'org.apache.commons:com.springsource.org.apache.commons.lang:2.6.0'
implementation "org.springframework:spring-beans:$rev_spring"
implementation "org.springframework:spring-context:$rev_spring"
implementation "org.springframework:spring-core:$rev_spring"
implementation "org.springframework:spring-web:$rev_spring"
implementation "org.springframework:spring-webmvc:$rev_spring"
implementation "org.springframework:spring-context-support:$rev_spring"
implementation "org.springframework:spring-aop:$rev_spring"
implementation "org.springframework:spring-expression:$rev_spring"
implementation "org.springframework:spring-jdbc:$rev_spring"
implementation "org.springframework:spring-orm:$rev_spring"
implementation "org.springframework:spring-tx:$rev_spring"
implementation "org.springframework.security:spring-security-web:$rev_spring_security"
implementation "org.springframework.security:spring-security-config:$rev_spring_security"
implementation "org.springframework:spring-test:$rev_spring"
implementation 'org.json:json:20090211'
implementation "org.jasypt:jasypt:$rev_jasypt"
implementation "org.codehaus.groovy:groovy-all:$rev_groovy"
implementation "org.codehaus.gpars:gpars:$rev_gpars"
implementation "org.spockframework:spock-core:$rev_spock"
implementation "org.spockframework:spock-spring:$rev_spock"
implementation libraries.spring
implementation libraries.rest
implementation libraries.groovy
testImplementation libraries.test
testImplementation libraries.encryption
}
task attributesTest(type: Test) {
testClassesDirs = sourceSets.attributesTest.output.classesDirs
classpath = sourceSets.attributesTest.runtimeClasspath
systemProperties System.properties
testLogging.showStandardStreams = true
}
I try to implement the code described in the "java with callbacks" section of the document in https://developer.android.com/guide/topics/large-screens/make-apps-fold-aware.
But ActivitySplitLayoutBinding is unresolved.
Here is an extract of my build.gradle file:
dependencies {
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'com.google.android.material:material:1.5.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
implementation 'androidx.core:core:1.7.0'
implementation 'io.reactivex.rxjava2:rxjava:2.2.9'
implementation 'io.reactivex.rxjava2:rxandroid:2.1.1'
implementation "androidx.window:window:1.0.0"
implementation "androidx.window:window-java:1.0.0"
implementation "androidx.window:window-rxjava2:1.0.0"
implementation 'androidx.startup:startup-runtime:1.1.1'
implementation 'androidx.navigation:navigation-fragment:2.4.1'
implementation 'androidx.navigation:navigation-ui:2.4.1'
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.4.1'
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.4.1'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.4.1'
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
implementation 'androidx.recyclerview:recyclerview-selection:1.1.0'
implementation 'com.opencsv:opencsv:5.0'
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}
What am I missing?
ActivitySplitLayoutBinding is not coming from any library but is just a view bindings definition linked to a xml layout.
E.g. in this sample, there will be a .xml named activity_split_layout.xml when you use ViewBindings, then you will have a definition named ActivitySplitLayoutBinding in your Activity class, so you can access to all its views from the layout.
You can learn more about ViewBindings here: https://developer.android.com/topic/libraries/view-binding
Hope that this helps.
-Cesar
i have a R8 error in android studio with same error:
Program type already present: androidx.recyclerview.widget.AdapterHelper$Callback
this is my gradle dependencies:
dependencies {
implementation 'androidx.core:core:1.2.0-beta01'
implementation 'androidx.palette:palette:1.0.0'
implementation 'androidx.exifinterface:exifinterface:1.1.0-rc01'
compileOnly 'org.checkerframework:checker-qual:2.5.2'
compileOnly 'org.checkerframework:checker-compat-qual:2.5.0'
implementation 'com.google.firebase:firebase-messaging:20.0.0'
implementation 'com.google.firebase:firebase-config:19.0.0'
implementation 'com.google.android.gms:play-services-maps:17.0.0'
implementation 'com.google.android.gms:play-services-auth:17.0.0'
implementation 'com.google.android.gms:play-services-vision:16.2.0'
implementation 'com.google.android.gms:play-services-wallet:17.0.0'
implementation 'com.google.android.gms:play-services-wearable:17.0.0'
implementation 'com.google.android.gms:play-services-location:17.0.0'
implementation 'net.hockeyapp.android:HockeySDK:5.2.0'
implementation 'com.googlecode.mp4parser:isoparser:1.0.6'
implementation 'com.stripe:stripe-android:2.0.2'
implementation 'com.google.android.material:material:+'
implementation files('libs/android-viewbadger.jar')
implementation 'com.android.support:multidex:+'}
i must add:
implementation 'com.google.android.material:material:+'
or:
implementation 'com.android.support:design:+'
for use TabLayout
but when i add that's implementation , i get that error.
Exclude packages :
implementation('com.google.android.material:material:+') {
exclude group: 'androidx.recyclerview'
}
I've imported the gs-ui-android and gs-core-2.0-alpha modules and they are reflected in the settings.gradle as well. Also included these in gradle app module
implementation files(':gs-ui-android')
implementation files(':gs-core-2.0-alpha')
Also included import statements
import org.graphstream.graph.*;
import org.graphstream.graph.implementations.*;
I still get an error in this code
error: package org.graphstream.graph does not exist error: package
org.graphstream.graph.implementations does not exist error: cannot
find symbol class SingleGraph error: incompatible types: String cannot
be converted to Node error: cannot find symbol class Viewer
Code Sample:
Graph graph1 = new SingleGraph("I can see dead pixels");
graph1.addNode("A" );
graph1.addNode("B" );
graph1.addNode("C" );
graph1.addEdge("AB", "A", "B");
graph1.addEdge("BC", "B", "C");
graph1.addEdge("CA", "C", "A");
Viewer viewer = graph1.display();
Build.gradle(app module):
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.0.1'
implementation 'io.particle:devicesetup:0.4.9'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
implementation 'com.github.john990:WaveView:v0.9'
implementation 'org.giwi:android-network-graph:0.0.1'
// implementation 'guru.nidi:graphviz-java:0.2.3'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.android.support:multidex:1.0.3'
api 'com.github.graphstream:gs-ui-android:2.0-alpha'
api 'com.github.graphstream:gs-core:2.0-alpha'
// implementation files(':gs-ui-android')
// implementation files(':gs-core-2.0-alpha')
}
repositories {
mavenCentral()
}
You can use jitpack to import github projects
allprojects {
repositories {
maven { url 'https://jitpack.io' }
}
}
Then you can put the links to the desired version
dependencies {
api 'com.github.graphstream:gs-ui-android:2.0-alpha'
api 'com.github.graphstream:gs-core:2.0-alpha'
}
Here you can see an example
https://github.com/graphstream/gs-ui-android-test
I've got two objects which I inject with dagger2 without any problems. When I add third one (the same way like two before), project does not rebuild and gives errors, that points into first two (nothing here about added third one):
error: com.google.firebase.database.DatabaseReference cannot be provided without an #Inject constructor or from an #Provides- or #Produces-annotated method.
com.google.firebase.database.DatabaseReference is injected at
com.hotmail.at.jablonskimichal.dni.wolne.od.handlu.ui.splash.SplashPresenter.freeDaysCloudReference
com.hotmail.at.jablonskimichal.dni.wolne.od.handlu.ui.splash.SplashPresenter is injected at
com.hotmail.at.jablonskimichal.dni.wolne.od.handlu.providers.components.MainPresenterComponent.inject(destination)
Every three modules and components are implemented in the same way. Of course when I delete added third one, projects compiles easily.
Module which messes project build:
#Module
public class MainPresenterModule {
private final MainPresenter presenter;
public MainPresenterModule(MainPresenter presenter) {
this.presenter = presenter;
}
#Singleton
#Provides
MainPresenter provideMainPresenter() {
return presenter;
}
}
Component:
#Singleton
#Component(modules = {MainPresenterModule.class})
public interface MainPresenterComponent {
void inject(SplashPresenter destination);
}
Maybe useful:
I am using those libraries for DI with dagger2:
implementation 'com.google.dagger:dagger-android:2.11'
implementation 'com.google.dagger:dagger-android-support:2.11'
annotationProcessor 'com.google.dagger:dagger-android-processor:2.11'
annotationProcessor 'com.google.dagger:dagger-compiler:2.11'
with newest android studio (3.1.1) and gradle (3.1.1) on mac osx. Of course I've tried invalidating cache and restarts, cleans etc. I've checked imports and all of them are the same.
Edit:
When I remove usage of injection
#Inject
DatabaseReference shopsCloudReference;
public MainPresenter(MainController controller) {
super(controller);
Core.injectShopsComponent().into(this);
}
And
#Inject
DatabaseReference freeDaysCloudReference;
public SplashPresenter(SplashController controller) {
super(controller);
Core.injectFreeDaysComponent().into(this);
}
project compiles, but it is not what I wanted.
EDIT
There's lot of answers that I didn't add firebase libs in gradle. My full gradle:
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.hotmail.at.jablonskimichal.dni.wolne.od.handlu"
minSdkVersion 21
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
allprojects {
repositories {
mavenCentral()
google()
maven { url "https://jitpack.io" }
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
//tests
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
//support
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
//images loading
implementation 'com.github.bumptech.glide:glide:4.4.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.4.0'
//network
implementation 'com.squareup.okhttp3:okhttp:3.9.0'
implementation 'com.squareup.okhttp3:logging-interceptor:3.9.0'
implementation 'com.squareup.retrofit2:retrofit:2.2.0'
//json parsing
implementation 'com.squareup.retrofit2:converter-gson:2.2.0'
implementation 'com.google.code.gson:gson:2.8.0'
//for view bindings
implementation 'com.jakewharton:butterknife:8.8.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
//rxjava
def rxVersion = '2.0.2'
implementation "io.reactivex.rxjava2:rxandroid:$rxVersion"
implementation "io.reactivex.rxjava2:rxjava:$rxVersion"
implementation 'com.jakewharton.retrofit:retrofit2-rxjava2-adapter:1.0.0'
//dagger
implementation 'com.google.dagger:dagger-android:2.11'
implementation 'com.google.dagger:dagger-android-support:2.11'
annotationProcessor 'com.google.dagger:dagger-android-processor:2.11'
annotationProcessor 'com.google.dagger:dagger-compiler:2.11'
//google
implementation 'com.google.android.gms:play-services-maps:15.0.0'
implementation 'com.google.firebase:firebase-database:15.0.0'
implementation 'com.google.firebase:firebase-core:15.0.0'
//datetime
implementation group: 'joda-time', name: 'joda-time', version: '2.9.9'
//transitions
implementation "com.andkulikov:transitionseverywhere:1.7.9"
//kotlin
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
apply plugin: 'com.google.gms.google-services'
Well, you wrote :
#Component(modules = {MainPresenterComponent.class})
It should be :
#Component(modules = {MainPresenterModule.class})