简体   繁体   English

Eclipse显示错误(无法解析目标)

[英]Eclipse shows error (unable to resolve target)

I got a project and imported it in Eclipse (it is an android project). 我有一个项目并将其导入Eclipse(这是一个android项目)。 The project works on other computers, but unfortunately not on mine. 该项目可在其他计算机上运行,​​但不幸的是,该项目不适用于我的计算机。 The error which comes up is in the console of eclipse when i import the project: "Unable to resolve target 'android-8'" 当我导入项目时,出现的错误是在Eclipse的控制台中:“无法解析目标'android-8'”

Furthermore do i get multiple errors in on of the .java-files in the src folder of the project. 此外,我在项目的src文件夹中的.java文件中是否遇到多个错误。

3 of them are showing "String cannot be resolved to type": 其中3个显示“字符串无法解析为类型”:

Here the code (It is for a music player the timer /showing of the seconds): 此处的代码(用于音乐播放器的计时器/秒显示):

    /**
 * Function to convert milliseconds time to
 * Timer Format
 * Hours:Minutes:Seconds
 * */
public String milliSecondsToTimer(long milliseconds){
    String finalTimerString = "";
    String secondsString = "";

I hope you can help me! 我希望你能帮帮我!

Thank you so much in advance! 提前非常感谢您!

If you have any questions please let me know. 如果您有任何疑问,请告诉我。

Thanks guys. 多谢你们。

Cheers 干杯

You'll be having project.properties file open that and change the android-8 to whatever android version you have. 您将打开project.properties文件,并将android-8更改为您拥有的任何android版本。 After changing this goto Window->Preferences->Android. 更改后,转到窗口->首选项-> Android。 You'll be having target name & api level . 您将拥有目标名称和api级别 select any one of them & specify it in project.properties file. 选择其中任何一个并在project.properties文件中指定它。

右键单击项目,属性-> Android->选择构建目标->应用->确定

It seems you have something set with a build target of API 8. Perhaps a subproject or library? 看来您已经设置了一些API 8的构建目标。也许是子项目或库?

If that's intended then it sounds like you need to download Android 2.2 (API 8) through your Android SDK manager. 如果您打算这样做,那么听起来您需要通过Android SDK管理器下载Android 2.2(API 8)。

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

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