问题描述:

On Android 4.2, I'm trying to install the same app onto 2 different users accounts. When I try to do this, I get "App not installed" after I click "Install" on the permissions page. Here are the steps I used to get this message:

1) Login to owner account on tablet.

2) Download (using Chrome) app.apk and from the Downloads popup, select it to install it.

3) Click Install on the permissions page

4) Logout

5) Login to different user account on tablet

6) Download (using Chrome) app.apk and from the Downloads popup, select it to install it.

7) Click Install on the permissions page

A dialog is not displayed with the unhelpful message "X App not installed."

How can I get this app to install onto 2 different user accounts on the same tablet?

Here is the app's manifest:

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

<manifest xmlns:android="http://schemas.android.com/apk/res/android"

android:versionCode="121212"

android:versionName="0.1"

package="com.company.app">

<uses-sdk android:minSdkVersion="8" />

<uses-permission android:name="android.permission.INTERNET" />

<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />

<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

<uses-permission android:name="android.permission.VIBRATE"/>

<application android:icon="@drawable/app_icon" android:label="@string/app_name" android:debuggable="true" >

<activity android:name="Activity1"

android:configChanges="keyboardHidden|orientation"

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="Activity2" android:configChanges="keyboardHidden|orientation" />

<activity android:name="Activity3" android:configChanges="keyboardHidden|orientation" />

</application>

网友答案:

After further investigation, from logcat I determined I was getting a INSTALL_FAILED_UID_CHANGED error. This was caused by a version problem. We have a process where we email an old version of our app to users wanting to install it. The first thing the app does is check for and install a new version if it is available.

So the problem was that the first user installed the old version, then updated to the latest version. Then when the second user tried to install the old version, it was rejected because it was an older version then the app that was installed by the vi.

Turns out on a multi-user tablet, there can only be one version of the app installed. If I update the app for one user, all the other users are updated too.

Hope this helps other Android developers.

相关阅读:
Top