【问题标题】:Flashlight app doesn't install on all phones and Installation error: INSTALL_FAILED_OLDER_SDK手电筒应用程序未安装在所有手机上并且安装错误:INSTALL_FAILED_OLDER_SDK
【发布时间】:2014-07-29 01:43:28
【问题描述】:

我为基本手电筒编写了一个安卓应用程序。我已经在 5 台设备上测试了该应用程序 Galaxy s2、note 3、moto g、micromax canvas hd、xolo q800。

该应用程序在 s2、note 3 和 canvas hd 上运行良好。而在其余设备中,当我尝试安装使用调试密钥存储签名的签名 apk 时,在安装过程中包管理器崩溃但是应用程序图标已创建,当我点击它时,它会显示一条 toast 消息“应用程序未安装”

我发现了一些类似的线程,但引用它们我无法解决我的问题。

这是清单文件

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.flashone"
android:versionCode="1"
android:versionName="1.0" >

<uses-sdk
    android:minSdkVersion="7"
    android:targetSdkVersion="18
    " />
<uses-permission android:name="android.permission.FLASHLIGHT"/>
<uses-permission android:name="android.permission.CAMERA"/>
<uses-feature android:name="android.hardware.camera"/>


<application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
                                                                                                                                                                        android:theme="@style/AppTheme"                                                                    android:permission="android.permission.BIND_APPWIDGET">
    <activity
        android:screenOrientation="portrait"
       android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
        android:name="com.example.flashone.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>

编辑:现在又出现了一个问题 没有改变清单中的任何内容,这从无到有 我现在的测试设备是galaxy s2,它是4.1.2 API 16

[2014-07-28 21:59:12 - FlashOne] Installation error: INSTALL_FAILED_OLDER_SDK
[2014-07-28 21:59:12 - FlashOne] Please check logcat output for more details.
[2014-07-28 21:59:12 - FlashOne] Launch canceled!

logcat 显示以下消息

    07-28 22:35:08.058: D/AndroidRuntime(539): >>>>>> AndroidRuntime START       com.android.internal.os.RuntimeInit <<<<<<
    07-28 22:35:08.058: D/AndroidRuntime(539): CheckJNI is ON
    07-28 22:35:08.877: D/AndroidRuntime(539): Calling main entry com.android.commands.pm.Pm
    07-28 22:35:08.937: W/ActivityManager(91): No content provider found for permission revoke: file:///data/local/tmp/FlashOne.apk
    07-28 22:35:08.999: W/ActivityManager(91): No content provider found for permission revoke: file:///data/local/tmp/FlashOne.apk
    07-28 22:35:09.007: W/PackageParser(91): /data/app/vmdl156967055.tmp (at Binary XML file line #6): Requires development platform 18          but this is a release platform.
    07-28 22:35:09.147: D/dalvikvm(91): GC_EXPLICIT freed 32K, 14% free 14620K/16903K, paused 24ms+9ms
    07-28 22:35:09.217: D/AndroidRuntime(539): Shutting down VM
    07-28 22:35:09.237: D/dalvikvm(539): GC_CONCURRENT freed 123K, 78% free 466K/2048K, paused 0ms+1ms
    07-28 22:35:09.237: D/dalvikvm(539): Debugger has detached; object registry had 1 entries
    07-28 22:35:09.257: I/AndroidRuntime(539): NOTE: attach of thread 'Binder Thread #3' failed

【问题讨论】:

    标签: android eclipse android-camera android-manifest


    【解决方案1】:

    android.hardware.cameraandroid.hardware.camera.autofocus 都是从 CAMERA permission 静默声明的,正如 here 所说(最后一节)。

    我认为您是从 apk 而不是 Play 商店安装的,因为如果设备没有这两个功能,您将无法看到该应用程序。我认为从未知来源安装时,包管理器不能很好地处理缺失的功能。

    您需要声明这两个功能,并将“必需”设置为 false(我认为 camera 实际上是必需的,autofocus 不是)。

    【讨论】:

      【解决方案2】:

      好的,部分问题解决了

      安装错误:INSTALL_FAILED_OLDER_SDK

      错误就在这里

      <uses-sdk
      android:minSdkVersion="7"
      android:targetSdkVersion="18
      " />
      

      应该写成

      <uses-sdk
      android:minSdkVersion="7"
      android:targetSdkVersion="18" 
       />
      

      只是双引号的位置很重要。

      【讨论】:

        猜你喜欢
        • 2013-11-29
        • 2011-07-20
        • 2020-12-07
        • 1970-01-01
        • 2020-08-01
        • 1970-01-01
        • 2020-03-19
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多