Error in Android manifest file - android

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 :)

Related

MonkeyRunner unable to use startActivity

The following is my AndroiManifest.xml:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.helloworld"
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=".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>
I want to launch my app using monkeyrunner but when I give the command
device.startActivity(component='com.exmaple.helloworld/com.example.helloworld.MainActivity')
It doesn't start my app. Am I missing anything. I read Issues using monkeyrunner startActivity but still it didn't work.
Add android:exported="true" line for the activity in AndroidManifest.xml file
device.startActivity(component='com.exmaple.helloworld/com.example.helloworld.MainActivity')
have you tried fixing the typo (exmaple instead of example) ?
device.startActivity(component='com.example.helloworld/com.example.helloworld.MainActivity')
Have you tried device.startActivity(component='com.exmaple.helloworld/.MainActivity')?
You should change activity name in manifest, from:
android:name=".MainActivity"
to
android:name="com.example.helloworld.MainActivity"
then your script will work.

Android Manifest doesn't find <meta-data>

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

Android - error opening trace file: No such file or directory(2)

I am developing an android application and one part of it is to check whether the wifi of the phone is enabled or not.
I am running the application directly on mobile phone.These are some errors
error opening trace file: No such file or directory (2)
Refusing to reopen boot DEX 'system/framework/hwframework.jar'
This is my manifest file
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.demo"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.example.demo.Test_allActivity"
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>
I am very new to android , and can't figure out the solution. Thanks is advance
I guess you need the ACCESS_NETWORK_STATE in your manifest.
Need to check your main class(MainActivity) file is mentioned or not in 'Manifest.xml'.
<activity
android:label="#string/app_name"
android:name="com.androidexample.demo.MainActivity" >
<intent-filter >
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

Test project icon not visible in android

I am unit testing an android applications using Robitium. When I install the test project in to android emulator, I can't find the icon of the test project, but I can run it.
The manifest file of the test project is like this:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.smartek.screens.test"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="7" />
<instrumentation
android:name="android.test.InstrumentationTestRunner"
android:targetPackage="com.smartek.screens" />
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name" >
<uses-library android:name="android.test.runner" />
</application>
What should I do to make the test project icon visible?
The test project will not contain the launcher entry in manifest file, so you cannot see the icon on launcher.
<intent-filter>
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
We can do this and its same as the normal android application .
Add the following lines to the android manifest file
<activity android:name=".Testing class name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

INSTALL_FAILED_MISSING_SHARED_LIBRARY when using a custom library

I'm using CloudApp Java Wrapper, this is my android manifest:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.github.cloudapp"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="15" />
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<uses-library android:name="com.cloudapp.api" />
<uses-library android:name="com.cloudapp.api.model" />
<uses-library android:name="com.cloudapp.impl" />
<uses-library android:name="com.cloudapp.impl.model" />
<activity
android:name=".MainActivity"
android:label="#string/title_activity_main" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
I keep getting INSTALL_FAILED_MISSING_SHARED_LIBRARY check LogCat, but on LogCat there is nothing there, I'm sure I correctly declared the library in the manifest. What am I doing wrong? Are the packages names wrong? I'm using the jar from here.
Here is also the screenshot of the library:
Just remove these lines from AndroidManifest.xml
<uses-library android:name="com.cloudapp.api" />
<uses-library android:name="com.cloudapp.api.model" />
<uses-library android:name="com.cloudapp.impl" />
<uses-library android:name="com.cloudapp.impl.model" />
You only need to use these tags when you happens to use shared-libraries, which are *.so files, which are usually at /libs directories. These shared-libraries are loaded at run-time; however, your references-libraries are built with projects at compile-time.

Categories

Resources