导入android包无法解析(import android packages cannot be resolved)

编程入门 行业动态 更新时间:2024-10-24 12:26:00
导入android包无法解析(import android packages cannot be resolved)

我的android应用程序内置Eclipse,突然无法编译几十个错误。 最明显的错误是指出所有android导入都无法解析。

import android.os.Bundle; import android.app.Activity; import android.graphics.drawable.Drawable; import android.media.AudioManager; import android.util.Log; import android.view.Menu; import android.view.View; import android.widget.Button; import android.widget.ImageView;

所有这些都被标记为无法解析。 我尝试删除并重新添加JRE系统库。 我试过清洁和重建。 我已经尝试了“快速修复”选项来“修复项目设置...”,但只是回应一个对话框,说...

没有提议找到解决对'android.app.Bundle'的无法解析的引用。点击此处手动配置项目'无声模式切换'的构建路径。

我是Android开发的新手,这个让我完全陷入困境。

预先感谢您提供的任何帮助。

丰富

My android application, built inside Eclipse, suddenly fails to build with dozens of errors. The most obvious are errors indicating that all the android imports cannot be resolved.

import android.os.Bundle; import android.app.Activity; import android.graphics.drawable.Drawable; import android.media.AudioManager; import android.util.Log; import android.view.Menu; import android.view.View; import android.widget.Button; import android.widget.ImageView;

All of these are flagged as unresolvable. I've tried removing and re-adding the JRE System Library. I've tried cleaning and rebuilding. I've tried the "Quick fix" option to "Fix Project Setup..." but that simply responds with a dialog box that say...

"No proposals have been found to fix the unresolvable reference to 'android.app.Bundle'. Click here to manually configure the build path of project 'Silent Mode Toggle."

I'm new to Android development and this one has me completely stumped.

Thanks in advance for any help you can provide.

Rich

最满意答案

看起来你的eclipse-workspace (或者至少是你的Project )以某种方式被破坏了。

你最近移动了你的android-sdk/Project吗? 如果它不再是Android项目,请尝试查看Preferences->Android以获取有效的android sdk-location 。

如果这是正确的,请尝试打开一个完整的新工作区,然后使用File->import->Android Project从现有Source中导入源File->import->Android Project 。

如果这仍然没有帮助,请制作一个新的android Project并从Eclipse外部手动复制您的Project的源代码。 之后重新打开Eclipse,然后进行Project->clean

It seems that your eclipse-workspace (or at least your Project) is broken somehow.

Have you moved your android-sdk/Project recently? If it's not an Android Project anymore, try to look at Preferences->Android for a valid android sdk-location.

If this is correct, try to open a complete new Workspace, and import your sources with File->import->Android Project from existing Source.

If this still doesn't help, make a new android Project and copy the sources manually inside your Project from outside Eclipse. Re-open Eclipse after that, and make a Project->clean

更多推荐

本文发布于:2023-08-06 21:53:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1456784.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:import   android   resolved   packages

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!