0
votes

Hello everyone I want to use sign in with google in my application, I've got this error, then I did what logcat say:

A required meta-data tag in your app's AndroidManifest.xml does not exist. You must have the following declaration within the element: meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version"

but still getting same error.

this is manifest file:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.example.deathstroke.uniqueoff1">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

<application
    android:name=".Calligraphy"
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:roundIcon="@mipmap/ic_launcher_round"
    android:supportsRtl="true"
    android:theme="@style/AppTheme"
    tools:replace="android:allowBackup">

this is meta data that i added to this file:

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

and this is rest of the file:

    <activity
        android:name=".MainActivity"
        android:label="@string/title_activity_test_navigation_drawer"
        android:screenOrientation="portrait"
        android:theme="@style/AppTheme">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity
        android:name=".SignUpActivity"
        android:screenOrientation="portrait" />
    <activity
        android:name=".SingInActivity"
        android:screenOrientation="portrait" />
    <activity
        android:name=".CooperationActivity"
        android:screenOrientation="portrait" />

</application>

</manifest>

what is wrong then ?

1

1 Answers

0
votes

After you add following meta tag in the manifest file

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

Make sure "@integer/google_play_services_version" being defined in a custom value file like this: In /res/values/strings.xml

<?xml version="1.0" encoding='utf-8' standalone='no'?>

<integer name="google_play_services_version">12451000</integer>

</resources>

If the issue remains, please let me know