3

我在 Eclipse 中导入了示例项目 CastSampleActivity(Googlecast sampleapp for android)。我手动导入googlecastsdk,通过操作【项目】-【Android工具】-【添加支持库】导入android支持库。

下载 [Android Support Library,revision 18] 后,[android-support-v4.jar] 在 [/libs] 中。

然而错误发生在 2 个文件中,1 个是 CastSampleActivity.java;

"The import android.support.v7.app cannot be resolved"
"The import android.support.v4 cannot be resolved"

1是cast_sample.xml;

"No resource identifier found for attribute 'showAsAction' in package 'com.example.castsample'  cast_sample.xml /CastSampleActivity/res/menu    line 4  Android AAPT Problem"
"No resource identifier found for attribute 'actionProviderClass' in package 'com.example.castsample'   cast_sample.xml /CastSampleActivity/res/menu    line 4  Android AAPT Problem"

有人有答案吗?

4

4 回答 4

4

以防万一其他答案不起作用,这对我有用: Project--Propertes--Android--Is Library--Add.. 并添加了 appcompat_v7_2

于 2014-03-21T16:36:42.837 回答
1

我通过右键单击项目->构建路径->配置构建路径来修复它。进入 Java Build Path-->Project 选项卡并(通过单击添加)添加 appcompat_v7 库。应该解决导入问题。

于 2014-10-09T09:06:40.187 回答
0

If you have issue with broken appcompat_v7 or appcompat_v4 library when you right click on your project - properties - Android , then follow the step on this: https://www.youtube.com/watch?v=5BG1-kZc_qE

After that copy the android-support-v7-appcompat.jar and android-support-v4.jar from the android-support-v7-appcompat project's libs to your own.

Then go back to project - properties - Android and click on add in library section. Select android-support-v7-appcompat or android-support-v4, click ok and you're done. This is how I resolved my issue. :)

于 2014-07-29T05:11:25.847 回答
0

您需要导入 2 个支持库。我关注了https://github.com/stigsfoot/cast-android-sample/blob/master/INSTALL_CAST_ECLIPSE.txt,它对我来说效果很好。

编辑:链接现在是https://developer.android.com/tools/support-library/setup.html

于 2013-09-28T17:34:16.530 回答