I just started learning android studio and I just can't get out of this problem... If anybody can help I would appreciate :)
The error I get in main activity:
Cannot access 'androidx.lifecycle.LifecycleOwner' which is a supertype of 'com.my package.base.MainActivity'.
Check your module classpath for missing or conflicting dependencies
Cannot access 'androidx.savedstate.SavedStateRegistryOwner' which is a supertype of 'com.my package.base.MainActivity'.
Check your module classpath for missing or conflicting dependencies
error
Related
I just installed the new Electric Eel Android Studio stable version, but I am getting the following error messages below although the project builds without errors. The errors are happening in the build.gradle.kts file for the buildSrc module. What do I have to do to resolve the error messages?
import org.gradle.kotlin.dsl.`kotlin-dsl`
plugins {
`kotlin-dsl`
}
repositories {
mavenCentral()
}
Cannot access 'java.lang.Object' which is a supertype of 'org.gradle.plugin.use.PluginDependenciesSpec'. Check your module classpath for missing or conflicting dependencies
Cannot access 'java.lang.Comparable' which is a supertype of 'org.gradle.api.Project'. Check your module classpath for missing or conflicting dependencies
Cannot access 'java.lang.Object' which is a supertype of 'org.gradle.api.Project'. Check your module classpath for missing or conflicting dependencies
I have been trying to write test case for my Activity. But, android lint showing warnings while accessing public variable/method in Activity from Kotlin Test Class.
Here is the lint warning:
Cannot access 'androidx.core.app.OnMultiWindowModeChangedProvider' which is a supertype of 'com.app.sample.MyActivity'. Check your module classpath for missing or conflicting dependencies
Cannot access 'androidx.core.app.OnNewIntentProvider' which is a supertype of 'com.app.sample.MyActivity'. Check your module classpath for missing or conflicting dependencies
Cannot access 'androidx.core.app.OnPictureInPictureModeChangedProvider' which is a supertype of 'com.app.sample.MyActivity'. Check your module classpath for missing or conflicting dependencies
Cannot access 'androidx.core.content.OnConfigurationChangedProvider' which is a supertype of 'com.app.sample.MyActivity'. Check your module classpath for missing or conflicting dependencies
Cannot access 'androidx.core.content.OnTrimMemoryProvider' which is a supertype of 'com.app.sample.MyActivity'. Check your module classpath for missing or conflicting dependencies
Cannot access 'androidx.core.view.MenuHost' which is a supertype of 'com.app.sample.MyActivity'. Check your module classpath for missing or conflicting dependencies
These lint warnings disappear when I access same variable/method from a Java test class.
I have tried:
Cleaning and rebuilding the project.
Invalidated cache and restarted the project.
There are tons of questions with a similar title, I know. I've been through them all, tried all the proposed solutions but nothing helped.
I have an Android library with a few Exoplayer dependencies. My library is published on JCenter for a couple of years now and everything works fine. Now JCenter is shutting down and I migrated to MavenCentral/Sonatype.
I added gradle-maven-publish-plugin to upload and publish my library to Sonatype. I made no changes to my code apart from upgrading the Android Gradle Plugin from 3.5.1 to 4.0.0 and of course applying the dependencies that the newly added gradle-maven-publish-plugin requires.
The structure is as follows. My library contains a class:
open class BasePlayer: Player.EventListener, AdEvent.AdEventListener, AdErrorEvent.AdErrorListener
And in my app I extend this class:
class MyPlayer: BasePlayer
Now when I add the new artifact from MavenCentral/Sonatype to my project, the project builds and my library files are accessible but not the Exoplayer dependencies. I get the following error(s):
Cannot access 'com.google.android.exoplayer2.Player$EventListener' which is a supertype of 'com.test.playground.myapplication.MyPlayer'. Check your module classpath for missing or conflicting dependencies
Cannot access 'com.google.ads.interactivemedia.v3.api.AdEvent$AdEventListener' which is a supertype of 'com.test.playground.myapplication.MyPlayer'. Check your module classpath for missing or conflicting dependencies
Cannot access 'com.google.ads.interactivemedia.v3.api.AdErrorEvent$AdErrorListener' which is a supertype of 'com.test.playground.myapplication.MyPlayer'. Check your module classpath for missing or conflicting dependencies
And yes, the Exoplayer dependencies in my library are added using api and not implementation - as I mentioned this library has been live on JCenter for a couple of years now.
Any thoughts? I've been struggling with this for a couple of days now. If you need more info, just leave a comment - I'll be here, refreshing this page like a maniac :)
the error i'm getting is:
error: Unable to resolve dependency for 'app#debug/compileClasspath':Could not resolve com.jjoe64:graphview:4.2.2
I'm trying to integrate graphview into my android application and am following the documentation provided on their site. During gradlesync, it repeatedly tries to download the graphview pom file from the mentioned repositories but is failing and is trying the same thing again and again thus my gradlesync is taking forever.
Can anyone help with this? If there's any doubt in what i've mentioned please ask and help me solve this issue! Thanks!
I have included mavenCentral in buildscript repositories as well as allprojects repositories. In the dependencies section I have added the required dependency for graphview 4.2.2. Android Studio still can't perform a successful gradle sync.
implementation 'com.jjoe64:graphview:4.2.2'
I am using android studio 3.2.1 and Kotlin 1.2.71
classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.2.71'
for almost time whenever I build project getting below errors with respect to Kotlin classes name and object references
Eg: class DelUserIP
Unresolved reference: DelUserIP
: Cannot access class ‘input.DelUserIP’. Check your module classpath for missing or conflicting dependencies
but after an error, if I build project once again it will be success build without error after some build again I am experiencing same above error…
after renaming my package name of data classes from name "module" to some other name,then i didn't experienced issue again.