AppCompatActivity is not assigned to Activity

After a year of coding in android and everything works fine until yesterday. Today I found something really weird after upgrading to gradle 3 alpha 2 and studio 3 build 2.

This is the declaration of one of the actions causing the error: <w640 "

This is the activity code:  <w640 "

What's wrong?

EDIT

appompap dependency:

  compile 'com.android.support:appcompat-v7:23.2.1'

      

+3


source to share


2 answers


Maybe this will help:

In your build.gradle app, change compileSdkVersion and targetSdkVersion to 25.

Also update your appcompat library version to 25.3.1:

compile 'com.android.support:appcompat-v7:25.3.1'

      

UPDATE 05/31/2017:



As @ cricket_007 pointed out in the comments, this is not caused by an issue with the lack of AppCompatActivity as I theorized (in the comments).

And although I was unable to track it down, it looks like lint checking behaves differently or doesn't work correctly in Android Studio 3 Preview or in the 3.0.0 alpha2 version of Android Gradle Plugin, some build tools version (or somewhere).

If your code compiles fine (despite the "assignable" complaint appearing in AndroidManifest.xml) and you want to keep using Android Studio 3 Preview, it might be worth trying to suppress the "AndroidDomInspection" in this activity tag

<!--suppress AndroidDomInspection -->
<activity android:name=".admin.AdminChangeCoach">
    . . .
</activity>

      

But, FWIW, I also agree with the previous comment by @ cricket_007: I am not using Android Studio 3 for production yet.

+5


source


Alternatively, you can simply change the class you extended to class Activity

instead of AppCompatActivity

.



0


source







All Articles