Android Manifest doesn't find <meta-data> - android

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

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>

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

Related

how to in including ViewPagerIndicator

i am trying to include ViewPagerIndicator in my project. if i a create a new project its possible to include this library but i cant include it in my imported project. here is screenshot of my problem in eclipse.
problem picture
and here is my manifest file
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.swipetabs"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
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=".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>
<activity
android:name=".FragmentA"
android:label="#string/title_activity_fragment" >
</activity>
</application>
I think your project and your library is in different path. Make sure that both are in same folder and try it once more . it will work

Content in prolog not allowed error importing project into Android Studio

I am trying to import an Eclipse project into Android Studio but this error shows up:
Invalid XML file: C:manifestlocation\AndroidManifest.xml: Content is
not allowed in prolog.
Now this of course means that somehow my AndroidManifest file of the project I want to import is corrupt and has content before the first XML statement. But this is not the case. Here is my full manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.timkranen.flikrboard"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="14" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name=".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" />
<service
android:name="com.timkranen.extra.FetchAdressIntentService"
android:enabled="true"
android:exported="false" />
</application>
</manifest>
There is no content before the <?xml version="1.0" encoding="utf-8"?> line. The project is valid and works in Eclipse. But importing it into Android Studio is giving me this problems.
Any solutions? Is there a way to avoid this error?

How to list all packages in android project?

I downloaded google's sample in app purchase app and renamed the package to "com.iap.android.trivialdrivesample" wherever it appeared in AndroidManifest.xml:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.iap.android.trivialdrivesample"
android:versionCode="3"
android:versionName="1.3" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="15" />
<!-- VERY IMPORTANT! Don't forget this permission, or in-app billing won't work. -->
<uses-permission android:name="com.android.vending.BILLING" />
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.iap.android.trivialdrivesample.MainActivity"
android:label="#string/title_activity_main"
android:screenOrientation="portrait"
>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
Uploading the apk into google play shows the error "cannot use package name com.example". I expanded all my folders in android studio and don't see any packages starting with "com.example". How can I list them from the command line to make sure?

Error in Android manifest file

My manifest FILE IS:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.Smsr"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="15" />
<uses-permission android:name="android.permission.RECEIVE_SMS" />
<instrumentation
android:name="android.test.InstrumentationTestRunner"
android:label="#string/app_name"
android:targetPackage="com.example.Smsr" />
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name" >
<activity
android:name=".SmsrActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<receiver android:name=".SimpleSmsReciever" >
<intent-filter>
<action android:name="android.provider.Telephony.SMS_RECEIVED" />
</intent-filter>
</receiver>
</application>
</manifest>
Error is :smsr does not specify a android.test.InstrumentationTestRunner instrumentation or does not declare uses-library android.test.runner in its AndroidManifest.xml
i have two classes here , first is main activity i.e smsrActivity and other is simplesmsreciever class , help me
thanx in advance
I think may be ur problem is you have to set minsdk version and target version. Then it will work
<uses-sdk
android:minSdkVersion="15"
android:targetSdkVersion="20" />
You are missing <uses-library android:name="android.test.runner" /> in application tag.
for more causes and detailed knowledge check out a previous question
Android Eclipse Plugin: Instrumentation Test Runner not specified
try to run your application as android application. right click your application folder and go down to run as --> android application.
I don't know how or why but this worked with me :)

Android app is not visible in mobile app store but from browser its is availabe

I have uploaded the android app in the android app store. The app is not visible from the mobile app store but from my browser it is visible.
The devices I have tried:
GT-S5360 (Samsung) gingerbread
A60 (Micromax) gingerbread
The AndroidManifest.xml code is
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.hyperwebenable.techpanels"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="4" />
<application android:icon="#drawable/sitelogo"
android:label="#string/app_name">
<activity android:name=".MessageList"
android:label="#string/app_name"
android:theme="#android:style/Theme.NoTitleBar" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category
android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".SecondActivity"
android:theme="#android:style/Theme.NoTitleBar" >
</activity>
<meta-data android:name="com.mobclix.APPLICATION_ID"
android:value=""/>
<activity
android:name="com.mobclix.android.sdk.MobclixBrowserActivity"
android:theme="#android:style/Theme.Translucent.NoTitleBar" />
</application>
<uses-sdk android:minSdkVersion="2" />
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission
android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission
android:name="android.permission.READ_PHONE_STATE">
</uses-permission>
</manifest>
Please let me know what I am doing wrong here.
I'm not sure if this could cause a problem, but your uses-sdk is defined twice (with a different minSdkVersion). Try removing the second one.

Categories

Resources