簡體   English   中英

我根本不知道Manifest.xml錯誤

[英]Manifest.xml error i do not know at all

我一點也不知道..我使用的各種方法都無法解決

07-18 15:09:15.697: E/AndroidRuntime(22016): FATAL EXCEPTION: main
07-18 15:09:15.697: E/AndroidRuntime(22016): java.lang.RuntimeException: Unable to start activity ComponentInfo{kr.co.crooz.plugin.googleplustestplugin/kr.co.crooz.plugin.googleplustestplugin.AndroidGooglePlus}: java.lang.IllegalStateException: A required meta-data tag in your app's AndroidManifest.xml does not exist.  You must have the following declaration within the <application> element:     <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />
07-18 15:09:15.697: E/AndroidRuntime(22016):    at dalvik.system.NativeStart.main(Native Method)
07-18 15:09:15.697: E/AndroidRuntime(22016): Caused by: java.lang.IllegalStateException: A required meta-data tag in your app's AndroidManifest.xml does not exist.  You must have the following declaration within the <application> element:     <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />

代碼中的AndroidGooglePlus.java onCreate(Bundle savedInstanceState)

    setContentView(R.layout.activity_main)

Manifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="kr.co.crooz.plugin.googleplustestplugin"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="21" />

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity 
            android:name="kr.co.crooz.plugin.googleplustestplugin.AndroidGooglePlus" 
            android:label="@string/app_name"
            android:configChanges="orientation">
           <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
           <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />
        </activity>
    </application>

</manifest>

我需要幫助。 請。

元數據android:name =“ com.google.android.gms.version” android:value =“ @ integer / google_play_services_version”

盡管代碼仍然存在,但仍會發生錯誤。

您需要將<meta-data>標簽移到<meta-data> <activity>標簽之外,並移到<application>標簽內。

像這樣

<application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    >
    <activity 
       ......
     ......
    </activity>

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

</application>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM