我在Eclipse中导入了一个Android项目,产生的错误如下:
Multiple markers at this line
- The type java.lang.String cannot be resolved. It is indirectly referenced from required .class files
- The type java.lang.Class cannot be resolved. It is indirectly referenced from required .class files
- The type android.app.Instrumentation cannot be resolved. It is indirectly referenced from required .class
files
- The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files
解决方案是安装Android API Level 18.但是,我的问题是 - 在项目中指定了哪个位置?
如果我看project.properties
,我会看到:
# This file is automatically generated by Android Tools.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must be checked in Version Control Systems.
#
# To customize properties used by the Ant build system edit
# "ant.properties", and override values to adapt the script to your
# project structure.
#
# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
# Project target.
target=android-18
明确指出API级别18.但是,我不知道它来自何处。例如。查看项目属性我没有看到指定的项目构建目标:
并在Manifest文件中显示<uses-sdk android:minSdkVersion="16" />
所以我认为它会使用API Level 17
。但事实并非如此。它似乎需要API Level 18
。
那么,这是指定的位置?