且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

导入项目无法解析目标“android-7”

更新时间:2023-09-16 19:01:16

嗯,是的,这是你的问题。您没有下载API级别7。您可以右键单击该项目并转到properties-> android并选择另一个可用的API。只要您不更改清单中的最小sdk版本,您仍然按照以前的设备进行定位。

Well, yes that is your problem. You don't have the API level 7 downloaded. You can right click the project and go properties->android and select another available API. As long as you don't change the min sdk version in your manifest you are still targeting as many devices as before.

<uses-sdk android:minSdkVersion="7"/>

更新

您不必这样做,但您可以在 SDK档案页面上获取旧的API

You don't have to do this, but you can get the older APIs on the SDK Archives page

我不知道下一个声明是否有官方来源,但这是我在工作中发现的。如果任何人可以用更好的答案完成此操作,我将非常感激。

I don't know if there is any official source for the next statement but that is what I found while working. If anybody can complete this with a better answer I would appreciate it very much.

只要不使用任何内容,您可以使用较新的SDK版本编译代码代码与以前的代码不兼容。

You can compile the code with a newer SDK version as long as you don't use any code not compatible to the previous ones.

示例:

我希望我的应用可用于API级别7.但是我只有API级别15安装。只要我在我的清单中保持minSdkVersion =7,并且不要使用以前的API中没有的资源,那么应用程序在我的目标设备上工作正常。

I want my app to be available for API level 7. But i only have API level 15 installed. As long as I keep the minSdkVersion="7" in my Manifest and don't use any resource not available in the previous APIs the app will work just fine on my targeted devices.