简体   繁体   English

Android Studio中的几个导入错误+无法编译

[英]several import errors in android studio + unable to compile

Today I wanted to start working on my app after some time. 今天,我想在一段时间后开始使用我的应用程序。 I have tried to compile the old project but now I get the following error: 我试图编译旧项目,但是现在出现以下错误:

    ERROR: Asset package include '/Users/me/Library/Android/sdk/platforms/android-23/android.jar' not found.
Error:Execution failed for task ':app:processDebugResources'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Users/me/Library/Android/sdk/build-tools/23.0.0/aapt'' finished with non-zero exit value 1

Additionally, most of the import fail. 此外,大多数导入都会失败。 For example, all the following give me the red error message "cannot import name ..." 例如,以下所有内容均给我红色错误消息“无法导入名称...”

 import android.app.ActionBar;
import android.content.Intent;
import android.content.res.Resources;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.graphics.Color;
import android.os.Bundle;

In order to solve the issue, I have tried to do "Invalidate Cache", but it doesn't work. 为了解决此问题,我尝试做“ Invalidate Cache”,但是它不起作用。 I have no idea where this error comes from. 我不知道这个错误是从哪里来的。 I have the impression that I have touched something which changed the configuration of my Android Studio. 我的印象是,我接触过一些东西,从而改变了Android Studio的配置。 Help please! 请帮助!

As this is your first time opening the app in a while, I would recommend using SDK manager to get the latest SDKs that you use. 由于这是您一段时间以来第一次打开该应用程序,因此建议您使用SDK管理器来获取您使用的最新SDK。

Secondly I would check your build.gradle file to see if any of the dependencies used are still correct (they may have newer versions available). 其次,我将检查您的build.gradle文件,以查看所使用的任何依赖项是否仍然正确(它们可能具有较新的版本)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM