The import statement is not recognized by Android Studio.

Asked 2 years ago, Updated 2 years ago, 65 views

We are currently developing an Android app. Even though it is imported on the library class, the import statement is not reflected and it is in the red as follows:

Enter a description of the image here

As a result, the gradle syncs, but when I try to run the app, I get an error.
If you know what's causing it, could you tell me?

*Import is in the specified folder as follows (the contents are also public and accessible from the outside)

Enter a description of the image here

*I tried the following solution, but it didn't work

·file->Invalidate Caches/Restart

·Delete the Library folder under the idea folder of the project→invalidate Cache/Restart

·Close Project ->Open an existing android studio project

バージョンVersion information

Android Studio: 3.5.1 Gradle: 5.4.1
Gradle Plugin: 3.5.1

*build.gradle (below app) (posted just in case)

Enter a description of the image here

Thank you for your cooperation.

java android android-studio

2022-09-29 22:29

1 Answers

It seems that we have to implement the annotation separately.
To dependencies

implementation'com.android.support:support-annotations:28.0.0'

I think there will be no problem if you add .

I haven't checked the latest version, so I'll put an official link on it.
https://developer.android.com/studio/write/annotations.html?hl=ja


2022-09-29 22:29

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.