I installed an instrumentation test APK from Eclipse(Run->Run As Android application) on device as the log shows below.
[2013-08-08 22:14:13 - SettingsTests] /SettingsTests/bin/SettingsTests.apk installed on device
However, on the home screen of the device, somehow the test APK does not show. In Settings->Application Manager, the list shows the test apk correctly.
Any idea what's going on?
The android system info shows:
Source:/data/app/PACKAGE.test.test-1.apk
data:/data/app/PACKAGE.test.test
Here's the test apk's manifest.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="PACKAGE.test.test"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="17" />
<instrumentation
android:name="android.test.InstrumentationTestRunner"
android:targetPackage="my.package" />
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name" >
<uses-library android:name="android.test.runner" />
</application>
</manifest>
Only the activity defined in manifest like below will be shown. You must define at least one activty like that.
<activity
android:name="YourActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
What you are trying to install doesn't have an activity defined in the manifest.
As per the docs
An activity is that implements part of the application's visual user interface.
All activities must be represented by <activity> elements in the manifest file.
Any that are not declared there will not be seen by the system and will never be run.
You can refer the document so as to have an idea how activity works
It's quite normal behavior, as you don't have any activity in your instrumentation package. Didn't you mean to run it as Android JUnit Test?
Related
I am new on app's code. My project runs perfectly on emulators. However the apk is not running in my samsung device. Checking it with the Android Studio Analyzer the line xmlns:android="http://schemas.android.com/apk/res/android" in the manifest.xml returns in red. It seems that something is wrong with my project Manifest. Any Help? My manifest is copied below.
<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
android:versionCode="1"
android:versionName="1.0"
package="com.ferleecidade.a100dia11">
<uses-sdk
android:minSdkVersion="16"
android:targetSdkVersion="26" />
<application
android:theme="#ref/0x7f0f0005"
android:label="#ref/0x7f0e001f"
android:icon="#ref/0x7f0c0000"
android:debuggable="true"
android:exported="true"
android:allowBackup="true"
android:supportsRtl="true"
android:roundIcon="#ref/0x7f0c0002">
<activity
android:name="com.ferleecidade.a100dia11.MainActivity">
<intent-filter>
<action
android:name="android.intent.action.MAIN" />
<category
android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.ferleecidade.a100dia11.MyCustomList" />
<meta-data
android:name="preloaded_fonts"
android:resource="#ref/0x7f020003" />
<meta-data
android:name="android.support.VERSION"
android:value="26.1.0" />
<meta-data
android:name="android.arch.lifecycle.VERSION"
android:value="27.0.0-SNAPSHOT" />
</application>
</manifest>
Help? Yes.
I am actively looking into this right now.
I don't believe your manifest is causing this or at least isn't the sole cause.
I have a project that I can run on my devices and emulators and deploy without a glitch.
I also get an error on the same line you do when analyzing the APK (Build/.Analyze APK).
If you hover your cursor over the red text you will see your error popup.
Mine says "URI is not registered (Settings | Languages and Frameworks | Schemes and DTDs)"
I performed a quick experiment.
created a brand new project in Android Studio with a single activity.
Cleaned the project.
Ran in an emulator.
Generated a signed APK.
Analyzed the APK and the error is there.
I suggest you try this.
This leads me to believe one of two things.
There is something wrong with my default project settings.
The error is being incorrectly reported by Android studio.
I hope this was useful.
I'm a beginner when it comes to both Java and android SDK, and I had some issues that I dealt with to finally be able to run my app, and than I get this error and I just can't figure it out.
So this is the Console:
[2013-09-17 19:59:23 - AndroidFlow] Installation error:INSTALL_PARSE_FAILED_MANIFEST_MALFORMED
[2013-09-17 19:59:23 - AndroidFlow] Please check logcat output for more details.
[2013-09-17 19:59:23 - AndroidFlow] Launch canceled!
(Sorry for text fragmentation, it doesn't fit in the same line)
And heres the logcat snap:
Also, heres the Manifest file:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.domiq.androidapp"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="16"
android:targetSdkVersion="18" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<service android:enabled="true"
android:exported="false"
android:isolatedProcess="false"
android:label="flow service"
android:name="com.domiq.androidapp.appservice"
android:permission="string"
android:process="string" >
</service>
<activity
android:name="com.domiq.androidappp"
android:label="androidapp" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
Any suggestions? I've tried a lot of stuff (as you can see nothing is in capital letters etc...)
In the future, copy the text out of LogCat (select the lines, press <Ctrl>-<C> to copy) rather than use screenshots.
That being said, here are some obvious problems:
Your android:name in the <activity> is invalid, as it does not have the name of your Activity class.
The one that is causing your error is the android:process attribute in the <service> element, which is malformed and unnecessary.
I am skeptical that the android:name in your <service> points to a Service implementation class.
I strongly encourage you to get rid of android:isolatedProcess and android:permission, as what you have will probably not work the way you expect.
Are you sure your Activity's name is com.domiq.androidappp. This looks to be the package name.
So change below line to the Activity class Name. Use the Eclipse Manifest editor rather than adding manually
<activity
android:name="com.domiq.androidappp"
You need to remove the android:permission="string" and android:permission="string". It looks like you just copied pasted that incorrectly. You are supposed to replace "string" with the proper values.
Also your android:name under your Activity should be the Activity name, e.g. android:name="com.domiq.androidapp.MyActivity".
When I install my app on an AVD (or a real device), it shows the requested permissions as "Storage - modify/delete SD card contents" and "Phone calls - read phone state and identity"
However, I don't need these permissions and have not requested them in my AndroidManifest.xml (see below).
What is causing these permissions to be requested, and how can I prevent the permissions being required?
<?xml version="1.0" encoding="utf-8"?>
<manifest android:versionCode="1" android:versionName="1.0" package="my.App"
xmlns:android="http://schemas.android.com/apk/res/android">
<application android:label="#string/app_name" android:debuggable="true">
<activity android:label="#string/app_name" android:icon="#drawable/icon" android:name="com.co.my.App">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
There may not be enough information here to diagnose the problem - any information about how required permissions are specified / calculated would be appreciated
These permissions were not required in the first release of Android.
In order to avoid apps developed against that breaking on subsequent release devices where they are required to perform associated actions, they are automatically added at install time if the AndroidManifest.xml does not have a uses sdk tag declaring a version subsequent to their introduction (which would be 3, if I recall correctly).
See http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#target
I have 2 apps:
1 - ContentProvider;
2 - Application that uses this ContentProvider.
I need to install these 2 apps using single apk file. I want to push these two apps simultaneously, in Eclipse if I add to buildpath of one app another project and add several lines in the manifest.Is it possible to install simultaneously two apps(one of them is ContentProvider) using one apk?
Is it possible to install simultaneously two apps(one of them is ContentProvider) using one apk?
No, sorry.
You may define multiple activitys, services etc in one manifest.xml. So if you were to move both of your applications into one project, and then add them both to the manifest, you can in a way install multiple apps in one apk.
Look here for more info about the manifest: http://developer.android.com/guide/topics/manifest/manifest-intro.html
However, as already pointed out, the application-tag can only occur once.
Yes it's possible to have two apps (internally activities) installed in one api.
Extending to dac2009's answer..
Here is one sample Manifest file that does this.
`<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.dualapp"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="19" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name_people"
android:theme="#style/AppTheme" >
<activity
android:name="com.example.dualapp.MeetPeopleActivity"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name_people"
android:taskAffinity="com.example.dualapp.MeetPeopleActivity" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.example.dualapp.MeetTechieActivity"
android:icon="#drawable/ic_tech"
android:label="#string/app_name_techie"
android:taskAffinity="com.example.dualapp.MeetTechieActivity" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>`
Installing this puts two app icons in my mobile.
I have searched through the forum, but found no match for the issue I am currently facing:
I have an app, which installs and works ok, but when I try to update it (install again), the application does not update, but is installed separately one more time - I get two shortcuts, different app data, both versions work, etc.
I have not changed the application name, have observed the same behavior in adb and with actual phone and tablet, also tried with same and increased app version...
This is my manifest:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.rts.android.language" android:versionCode="1" android:versionName="1.1"
android:installLocation="auto">
<uses-sdk android:minSdkVersion="8" />
<uses-permission android:name="android.permission.VIBRATE"/>
<application android:icon="#drawable/icon" android:label="#string/app_name">
<activity android:name="com.rts.android.language.ui.MainActivity"
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>
</application>
</manifest>
Any ideas what the reason might be?
Thanks!
please, make sure both applications contain same package name?
package="com.rts.android.language"
First, try to rename your activity:
from:
<activity android:name="com.rts.android.language.ui.MainActivity" />
to :
<activity android:name=".ui.MainActivity" />
Try to clean your project then build/rebuild...
When doing that you need to clean your Keystore:
%USERPROFILE%/.androidon Windows
~/.android/debug.keystore on Linux and Mac OS X