【问题标题】:Android Manifest doesn't find <meta-data>Android Manifest 未找到 <元数据>
【发布时间】:2014-05-31 01:46:15
【问题描述】:

我正在尝试将我的应用配置为对 Chromecast 特色按钮进行编程。

我正在阅读所有 chromecast SDK,它说我必须安装 Google Play 服务。 我在同一个工作区将库链接到我的项目。我做得很好,因为我有一个名为 google_play_services.jar 的新 Android 依赖库

当我到达这一点时,我想测试googlePlayServices是否可用,所以我想使用:

GooglePlayServicesUtil.isGooglePlayServicesAvailable(getApplicationContext());

并打印带有结果的日志。

但是问题出现在这里。当我运行我的应用时,它说它不在我的 Android 清单中。

我的 Android Manifest 已经包含以下几行:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.chromecastAPP"
android:versionCode="1"
android:versionName="1.0" >

<uses-sdk
    android:minSdkVersion="9"
    android:targetSdkVersion="18" />
<uses-permission android:name="android.permission.INTERNET"/>

<meta-data 
    android:name="com.google.android.gms.version"
    android:value="@integer/google_play_services_version" />

<application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <activity
        android:name="com.example.chromecastAPP.MainActivity"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
</application>
</manifest>

任何不同的解决方案?

谢谢

【问题讨论】:

  • 请发布您的整个清单文件
  • 帖子已编辑,包括我的所有清单
  • 元数据必须在应用程序标签中
  • 看看我的回答是否对你有帮助,我把它贴在下面
  • 为什么我有反对票? :S:S

标签: android android-manifest google-play-services chromecast


【解决方案1】:

元数据必须在应用程序标签中。 “编辑您的应用程序的 AndroidManifest.xml 文件,并在 &lt;application&gt; 元素中添加以下声明。这嵌入了应用程序编译时使用的 Google Play 服务版本。”看this 链接。 试试这个:

 <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.chromecastAPP"
android:versionCode="1"
android:versionName="1.0" >

<uses-sdk
    android:minSdkVersion="9"
    android:targetSdkVersion="18" />
<uses-permission android:name="android.permission.INTERNET"/>



<application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <activity
        android:name="com.example.chromecastAPP.MainActivity"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
<meta-data 
    android:name="com.google.android.gms.version"
    android:value="@integer/google_play_services_version" />
</application>
</manifest>

【讨论】:

  • 现在你的答案是完美的!向我 +1。
【解决方案2】:

我也遇到过这个问题。我刚刚使用其更新版本更新了我的 SDK Google Play 服务,它对我有用... 试试吧,也许它也适合你..

【讨论】:

  • 我今天早上更新了所有 SDK google Play 服务,然后才开始将它包含到我的应用程序中。这对我不起作用。谢谢
  • ok 然后首先在你的 libs 文件夹中添加 google play service jar 文件然后右键单击你的项目->properties->java build path->Libraries->add library->select library from your libs folder (你添加的)->之后去订购和导出->如果没有检查你的谷歌播放服务库..希望它能帮助你..
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2013-03-11
  • 1970-01-01
  • 2021-09-24
  • 2022-07-24
相关资源
最近更新 更多