import android.support.v7.app.AppCompatActivity;出现cannot resolve symbol ‘app’
时间: 2023-12-11 14:04:52 浏览: 217
一劳永逸解决Failed to resolve:com.android.support:appcompat-v7:28.+
This error message usually occurs when the support library is not properly added to the project.
To resolve this issue, you can try the following steps:
1. Make sure that your project level build.gradle file has the required dependencies added for the support library.
2. Synchronize the gradle files by clicking on the "Sync Now" button in the toolbar or by selecting "Sync Project with Gradle Files" from the "File" menu.
3. Clean and rebuild the project by selecting "Clean Project" and "Rebuild Project" from the "Build" menu.
If none of the above steps work, you can try adding the following line to your app level build.gradle file under the dependencies section:
```
implementation 'com.android.support:appcompat-v7:28.0.0'
```
This will add the support library to your project and resolve the 'cannot resolve symbol app' error.
阅读全文