Java Android Studio:Android.jar缺少一些类
我收到“无法解析符号”错误,因为android.jar缺少一些类。例如:Java Android Studio:Android.jar缺少一些类,java,android,android-studio,Java,Android,Android Studio,我收到“无法解析符号”错误,因为android.jar缺少一些类。例如: import android.annotation.MainThread; import android.annotation.WorkerThread; import android.annotation.CallSuper; import android.annotation.DrawableRes; import android.annotation.IdRes; import android.annotation
import android.annotation.MainThread;
import android.annotation.WorkerThread;
import android.annotation.CallSuper;
import android.annotation.DrawableRes;
import android.annotation.IdRes;
import android.annotation.IntDef;
import android.annotation.LayoutRes;
import android.annotation.MainThread;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.RequiresPermission;
import android.annotation.StyleRes;
import android.annotation.SystemApi;
还有很多其他的
这些类在sources/android xx中以.java文件的形式存在,但在实际的.jar文件中不存在
我做错了什么?首先,您进入默认设置。然后在搜索框中键入gradle。接下来,您将看到脱机。删除勾号。应用设置。然后重新启动android studio。重新启动studio后,丢失的jar文件将自动下载。
下一步是完全删除你的gradle文件。在你的android studio中启动新项目。所有的gradle文件和jar文件都会通过互联网自动下载问题是android.annotation.Nullable和其他文件都标有@hide javadoc属性,因此不能在google之外使用。有关@hide,请参见此处:
对于android注释,尝试使用支持注释:这没有帮助,只是今天遇到了同样的问题。你解决了吗?你知道怎么处理这个问题吗?我知道了,但那是很久以前的事了,我不记得问题出在哪里了,对不起