문제

I have built & sign my apk by Eclipse ADT as it is describes (export and sign by creating a new key). But it can't be install on real device while an errors occurs, such as "installer package error". I have no Android device & sent my apk to friends by email. I'm using AVD and everyth is fine with it. Any suggestions? Thanx guys.

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.XXXX.YYYY"
android:versionCode="0"
android:versionName="0.9.2" android:installLocation="internalOnly">

<uses-sdk
    android:minSdkVersion="13"
    android:targetSdkVersion="17" />    
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

<application
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" 
    android:hardwareAccelerated="true" 
    android:permission="android.permission.INTERNET" 
    android:allowBackup="true">
    <activity
        android:name="com.XXXX.YYYY.ActivityMain"
        android:label="@string/main_activity_title" 
        android:launchMode="singleTop" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity android:name="com.XXXX.YYYY.ActivityDetails"
        android:parentActivityName="com.XXXX.YYYY.ActivityMain"
        android:excludeFromRecents="true"
        android:configChanges="orientation|screenSize">            
    </activity>
</application></manifest>

UPD: apk installs good, but the error occurs if choose Open (see screenshot). After that app works fine. But on tablet if try open app it says "App deleted". enter image description here

UPD2: add supporting API 4+ meta tag for the 2nd activity, but it takes no effect

<meta-data
            android:name="android.support.PARENT_ACTIVITY"
            android:value="com.XXXX.YYYY.ActivityMain" />
도움이 되었습니까?

해결책 4

My problem was a duplicate internet permission request on Manifest! When I remove that from activity app was run normally.

다른 팁

You probably need to make sure your device and your friend's devices can install apps that are not from the play store.

This is a feature you have to specifically set, or else apps that are outside the play store will not install.

Here is how to set it:

  1. Open settings
  2. Find the Security settings (Pre 4.0 it is under Applications)
  3. Look for a setting that says Unknown sources, or non-market apps
  4. Enable that setting

Everything should work after that!

Here is an article with pictures if you are still confused :)

Your example was missing the closing </manifest> and android:enabled. I'm not sure if the latter would prevent a device from fully installing it but the first one would.

I've also had issues using the full activity names in the past, so you may want to try using simplifying them to see if it helps.

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.XXXX.YYYY"
    android:versionCode="0"
    android:versionName="0.9.2" android:installLocation="internalOnly">

    <uses-sdk
        android:minSdkVersion="13"
        android:targetSdkVersion="17" />    

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

    <application
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" 
        android:hardwareAccelerated="true" 
        android:allowBackup="true">

        <activity
            android:name=".ActivityMain"
            android:label="@string/main_activity_title"
            android:enabled="true" 
            android:permission="android.permission.INTERNET"
            android:launchMode="singleTop" >

            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

        <activity android:name=".ActivityDetails"
            android:parentActivityName=".ActivityMain"
            android:excludeFromRecents="true"
            android:configChanges="orientation|screenSize">            
        </activity>
    </application>
</manifest>

Is "Unknown sources" option under "security" allowed on device?

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top