【问题标题】:My app will not install on a HVGA device我的应用程序不会安装在 HVGA 设备上
【发布时间】:2012-01-11 07:20:44
【问题描述】:

我有一个自己开发的应用程序,我正在多台设备上对其进行测试。

该应用无法安装在 Samsung Galaxy Q(运行 Froyo 并具有 HVGA 320x480 屏幕)上。

minSdkVersion 是 7,所以这应该不是问题。它在其他设备上安装并运行良好。大屏幕设备。

我已将所有屏幕尺寸的 AndroidManifest.xml <supports-screens> 标志设置为 true。

我在尝试安装 .apk 时看到的错误是“未安装应用程序”。

它可以在具有相同屏幕分辨率和操作系统版本的模拟器上正常安装。

这是清单,请注意,由于该项目处于 NDA 之下,我已将可识别元素替换为“%%%%”。

AndroidManifest.xml

<manifest android:versionCode="1"
      android:versionName="1.0"
      package="%%%%"
      xmlns:android="http://schemas.android.com/apk/res/android">
<application android:debuggable="false"
           android:hardwareAccelerated="true"
           android:icon="@drawable/icon"
           android:label="@string/app_name"
           android:name="%%%%"
           android:theme="@style/Theme.LoadingBackground">
<activity android:label="@string/app_name"
          android:name="%%%%" />
<activity android:icon="@drawable/icon"
          android:label="@string/app_name"
          android:launchMode="singleTask"
          android:name="%%%%"
          android:screenOrientation="portrait">
  <intent-filter>
    <action android:name="android.intent.action.MAIN" />
    <category android:name="android.intent.category.DEFAULT" />
    <category android:name="android.intent.category.LAUNCHER" />
  </intent-filter>
</activity>
<activity android:label="Store Front Widget"
          android:name="%%%%"
          android:screenOrientation="portrait"
          android:taskAffinity="%%%%">
  <intent-filter>
    <action android:name="android.intent.action.MAIN" />
  </intent-filter>
</activity>
<receiver android:label="%%%%"
          android:name="%%%%">
  <intent-filter>
    <action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
  </intent-filter>
  <meta-data android:name="android.appwidget.provider"
             android:resource="@xml/widget_provider" />
</receiver>
<receiver android:name="%%%%" />
<service android:name="c%%%%" />
<service android:name="%%%%">
  <intent-filter>
    <action android:name="%%%%" />
  </intent-filter>
</service>
<service android:name="%%%%">
  <intent-filter>
    <action android:name="%%%%" />
  </intent-filter>
</service>
<uses-library android:name="com.google.android.maps" />
</application>
<supports-screens android:anyDensity="true"
                android:largeScreens="true"
                android:normalScreens="true"
                android:smallScreens="true" />

<uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.camera.autofocus" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />

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

【问题讨论】:

    标签: android android-manifest


    【解决方案1】:

    你做了什么样的应用程序?

    如果您在应用中使用相机资源,则必须检查预览帧大小。

    public Camera getCameraInstance(){
        Camera c = null;
        try {
            c = Camera.open(); 
    
            Parameters param = c.getParameters();
    
            List<Size> list = param.getSupportedPreviewSizes(); 
            int list_size = list.size();
    
            Log.e("list size", Integer.toString(list_size));
    
            int supportedH = list.get(2).height;
            int supportedW = list.get(2).width;
    
            Log.e("supported height", Integer.toString(supportedH));
            Log.e("supported width", Integer.toString(supportedW)); 
    
            param.setPreviewFormat(ImageFormat.NV21); 
            c.setParameters(param);            
        }
        catch (Exception e){
            Log.e("colorPicker", e.toString());
        }
        return c;
    }
    

    【讨论】:

    • 在哪里指定?
    • 另外,这会是安装时的问题吗?
    • 是的,我的项目也有同样的问题。
    • 获取相机实例的参数。并获得支持的预览尺寸。当我尝试时,这里出现了一种分辨率问题。
    • 我已经修改了预览大小参数,但到目前为止还没有解决它。但是 - 删除摄像头调用的任何痕迹并且允许安装应用程序的权限,所以我相信你已经为我指明了正确的方向
    【解决方案2】:

    仔细检查设备上是否还没有安装您的应用版本。如果您尝试安装一个应用程序和一个具有相同包名称但设备上已存在不同签名的应用程序,则会出现同样的错误。

    如果有一个,它可能是用不同的密钥(过期的调试密钥,或发布密钥或其他东西)签名的,卸载它,你应该很高兴。

    如果您没有安装另一个,请发布您的清单文件以便我们查看。

    【讨论】:

    • 我正在做的项目是在保密协议下,所以我需要小心我发布的内容。清单中是否有相关的特定部分?
    猜你喜欢
    • 2021-12-13
    • 1970-01-01
    • 1970-01-01
    • 2013-10-18
    • 2017-04-21
    • 2011-02-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多