Question

I'm trying to configure my app to program Chromecast featured button.

I'm reading all chromecast SDK and it says that i have to install Google Play Services. I linked the library to my project, at the same workspace. I did it well because I have a new Android Dependencies library called google_play_services.jar

When I reach this point, I want to test if googlePlayServices are available, so I want to use:

GooglePlayServicesUtil.isGooglePlayServicesAvailable(getApplicationContext());

and print a Log with the result.

But the problem appeared here. When I run my app, it says that is not in my Android Manifest.

My Android Manifest has these lines already:

<?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>

Any different solution?

Thank you

Was it helpful?

Solution

Meta-data must be in application tags. "Edit your application's AndroidManifest.xml file, and add the following declaration within the <application> element. This embeds the version of Google Play services that the app was compiled with." Look this link. Try 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>

OTHER TIPS

I also Faced this problem. I just updated my SDK Google Play Service with its update Version and it worked for me... Try it may be it works for you also..

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top