安卓 - “您的设备与此版本不兼容”

5

我在应用商店发布了一个应用,我的朋友使用的是4.1版本的Nexus 7,当他尝试安装我的应用时,出现了以下错误信息:"您的设备与此版本不兼容"。为什么会出现这种情况?请问有人能帮助我吗?

Manifeast file

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

< manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.ibkr.pcg"
      android:versionCode="3"
      android:versionName="1.1">

< uses-sdk android:minSdkVersion="7"  
      android:targetSdkVersion="8"/>
<uses-permission android:name="android.permission.INTERNET"></uses-permission> 
<uses-permission android:name="android.permission.CAMERA" />        
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" ></uses-permission>  

<!-- C2DM Permissions Start -->
 <!-- Only this application can receive the messages and registration result --> 
<permission android:name="com.ibkr.pcg.permission.C2D_MESSAGE" android:protectionLevel="signature" />
<uses-permission android:name="com.ibkr.pcg.permission.C2D_MESSAGE" /> 

 <!-- This app has permission to register and receive message -->
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<!-- End of the C2DM Permissions -->

<application android:icon="@drawable/pcgicon" 
    android:label="@string/app_name" 
    android:theme="@android:style/Theme.NoTitleBar.Fullscreen" 
    android:name="MyApplication"
    android:debuggable="true">
    <activity android:name=".PriceCheckGuruSplash"
              android:label="@string/app_name">      
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />    
        </intent-filter>  
    </activity>

     <!-- Only C2DM servers can send messages for the app. If permission is not set - any other app can generate it --> 
    <receiver
     android:name=".C2DMMessageReciever" android:permission="com.google.android.c2dm.permission.SEND" >
      <!-- Receive the actual message -->
     <intent-filter >
            <action android:name="com.google.android.c2dm.intent.RECEIVE" >  
            </action>
            <category android:name="com.ibkr.pcg" /> 
        </intent-filter>
    </receiver>

   <receiver
        android:name=".C2DMRegistrationReceiver"
        android:permission="com.google.android.c2dm.permission.SEND" >
        <intent-filter >
            <action android:name="com.google.android.c2dm.intent.REGISTRATION" >
            </action>
            <category android:name="com.ibkr.pcg" />
        </intent-filter>
    </receiver>

    <activity android:name="MessageReceivedActivty" android:screenOrientation="portrait"/>
    <activity android:name="LoginScreen" android:screenOrientation="portrait"> </activity>
    <activity android:name="RegistrationScreen" android:screenOrientation="portrait"> </activity>
    <activity android:name="ForgotPasswordScreen" android:screenOrientation="portrait"> </activity>
    <activity android:name="UserPreferences" android:screenOrientation="portrait"> </activity>
    <activity android:name="TrackedItems" android:screenOrientation="portrait"> </activity> 
    <activity android:name="WebPage" android:screenOrientation="portrait"> </activity>
    <activity android:name="CustomTabActivity" android:screenOrientation="portrait"> </activity>
    <activity android:name="TabGroup1Activity" android:screenOrientation="portrait"> </activity>
    <activity android:name="TabGroup2Activity" android:screenOrientation="portrait"> </activity>
    <activity android:name="TabGroup3Activity" android:screenOrientation="portrait"> </activity>
    <activity android:name="TabGroup4Activity" android:screenOrientation="portrait"> </activity>
    <activity android:name="SearchScreen" android:screenOrientation="portrait"> </activity>
    <activity android:name="SearchResultsScreen" android:screenOrientation="portrait"></activity>
    <activity android:name="ProductDisplay" android:screenOrientation="portrait"></activity>
    <activity android:name="VendorsDisplay" android:screenOrientation="portrait"></activity>
    <activity android:name="Filter" android:screenOrientation="portrait"></activity>
    <activity android:name="barcodeScanner" android:screenOrientation="portrait"></activity>
    <activity android:name="ScannerPage" android:screenOrientation="portrait"></activity> 
    <activity android:name="Linegraphpage" android:screenOrientation="landscape"></activity>        
    <activity android:name="org.achartengine.GraphicalActivity" android:screenOrientation="landscape"/> 
    <activity android:name="org.acra.CrashReportDialog"
    android:theme="@android:style/Theme.Dialog"
    android:launchMode="singleInstance"
    android:excludeFromRecents="true"
    android:finishOnTaskLaunch="true" />
</application>

< /manifest>

enter image description here


可能你的目标版本是错误的。 - rajeshwaran
2
请移除以下的编程代码 android:targetSdkVersion="8" 和 android:name="android.permission.CAMERA". - Padma Kumar
使用 android:targetSdkVersion="15"。 - rajeshwaran
@njzk2:为什么?那个设备支持相机。 - naresh
7个回答

5
由于您的应用程序使用了“android.permission.ACCESS_NETWORK_STATE”权限,但是该设备没有手机调制解调器,因此您需要在权限中添加android:required="false",以允许其安装在不支持它的设备上。
为了控制过滤,始终要在元素中明确声明硬件功能,而不是依赖Google Play来“发现”元素中的要求。然后,如果您想禁用特定功能的过滤,可以向该声明添加android:required="false"属性。
参考链接:http://developer.android.com/guide/topics/manifest/uses-permission-element.html

5

//移除这个 android:targetSdkVersion="8"

Nexus 7没有后置摄像头功能。

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

注意:如果您通过意图使用相机,则您的应用程序不需要请求此权限。 相机功能 - 您的应用程序还必须声明使用相机功能,例如:
  <uses-feature android:name="android.hardware.camera" />

要查看相机功能列表,请参阅清单功能参考。 将相机功能添加到您的清单中会使Google Play禁止将您的应用安装到不包括相机或不支持您指定的相机功能的设备上。了解更多信息

如果您的应用程序可以使用相机或相机功能进行正确操作,但不需要它,则应在清单中指定这一点,方法是包括android:required属性,并将其设置为false:

注意:你需要提到supports-screens


2

像其他人已经建议的那样-相机可能是一个问题。Android开发者博客上有一篇很好的文章介绍了Nexus 7。基本上,它只有一个前置摄像头,因此您的应用程序要求默认相机会失败...

基本上,您需要扩展请求以表示它不是关键问题,然后在您的应用程序中处理细节...

<uses-feature android:name="android.hardware.camera" 
              android:required="false"/>

更多详细信息请访问以下链接:http://android-developers.blogspot.com.au/2012/07/getting-your-app-ready-for-jelly-bean.html


1

android:targetSdkVersion 应该是构建应用程序时可用的最高 SDK,除非您有非常特定的原因不这样做。也许您想保证不会调用较新的方法和 API,因为您必须在特定设备上正确工作,即使这意味着在更新的设备上牺牲行为。

大多数情况下,下载最新的 SDK 并将 android:targetSdkVersion 设置为最新版本。


0

只需使用此代码

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

Android:targetSdkVersion有什么问题? - naresh

0

在编写应用程序时,需要在Manifest中定义属性,以便通过Google Playstore将应用程序过滤到某些设备上。

例如:
  1. 声明特定的目标Sdk 版本
  2. 定义相机权限(将过滤掉没有相机的设备)。
  3. 使用相机功能。
  4. SIM卡启用的设备。
  5. 带有Wifi的设备。

因此,在发布应用程序之前,您必须考虑到要针对最大数量的目标设备,因此您必须选择一些功能和权限进行退出,大多数情况下是Sdk版本目标

希望这能给您发布应用程序的想法。


0
使用以下内容:
<supports-screens
    android:largeScreens="true"
    android:normalScreens="true"
    android:smallScreens="true"
    android:xlargeScreens="true" />

<uses-sdk
    android:minSdkVersion="7"
    android:targetSdkVersion="16" /> //or just remove the targetSdkVersion, altough it is not recommended

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接