AndroidManifest.xml中的<compatible-screen>行无效

时间:2015-06-29 07:08:57

标签: android android-manifest

在将APK上传到Google Play商店作为更新时,我收到的错误如“您在AndroidManifest.xml中包含无效行:500/580”

这是我的AndroidManifest.xml兼容屏幕标签。

<compatible-screens> 
        <!-- all small size screens -->
       <screen android:screenSize="small" android:screenDensity="ldpi" />
       <screen android:screenSize="small" android:screenDensity="mdpi" />
       <screen android:screenSize="small" android:screenDensity="hdpi" />
      <screen android:screenSize="small" android:screenDensity="xhdpi" />

        <!-- all normal size screens -->
      <screen android:screenSize="normal" android:screenDensity="ldpi" />
      <screen android:screenSize="normal" android:screenDensity="mdpi" />
      <screen android:screenSize="normal" android:screenDensity="hdpi" />
        <screen android:screenSize="normal" android:screenDensity="xhdpi" />

        <!-- all large size screens -->
      <screen android:screenSize="large" android:screenDensity="ldpi" />
      <screen android:screenSize="large" android:screenDensity="mdpi" />
      <screen android:screenSize="large" android:screenDensity="hdpi" />
      <screen android:screenSize="large" android:screenDensity="xhdpi" />
     <screen android:screenSize="xlarge" android:screenDensity="xhdpi" />

        <!-- XXHdpi Screen -->
       <screen android:screenSize="large" android:screenDensity="480" />
       <screen android:screenSize="normal" android:screenDensity="480" />

         <!-- XXXHdpi Screen -->
       <screen android:screenSize="xlarge" android:screenDensity="580" />
       <screen android:screenSize="large" android:screenDensity="580" />

    </compatible-screens>

任何人都可以对此有所了解。

由于 提前。     Jetti

3 个答案:

答案 0 :(得分:2)

最后我用下面的代码来计算它。

 <compatible-screens> 
            <!-- all small size screens -->
            <screen android:screenSize="small" android:screenDensity="ldpi" />
            <screen android:screenSize="small" android:screenDensity="mdpi" />
            <screen android:screenSize="small" android:screenDensity="hdpi" />
            <screen android:screenSize="small" android:screenDensity="xhdpi" />
            <!-- all normal size screens -->
            <screen android:screenSize="normal" android:screenDensity="ldpi" />
            <screen android:screenSize="normal" android:screenDensity="mdpi" />
            <screen android:screenSize="normal" android:screenDensity="hdpi" />
            <screen android:screenSize="normal" android:screenDensity="xhdpi" />

            <!-- all large size screens -->
            <screen android:screenSize="large" android:screenDensity="ldpi" />
            <screen android:screenSize="large" android:screenDensity="mdpi" />
            <screen android:screenSize="large" android:screenDensity="hdpi" />
            <screen android:screenSize="large" android:screenDensity="xhdpi" />

            <screen android:screenSize="xlarge" android:screenDensity="xhdpi" />

            <!-- XXHdpi Screen -->
             <screen android:screenSize="large" android:screenDensity="480" />
             <screen android:screenSize="normal" android:screenDensity="480" />

             <!-- XXXHdpi Screen -->

             <screen android:screenSize="normal" android:screenDensity="560" />
             <screen android:screenSize="xlarge" android:screenDensity="560" />
             <screen android:screenSize="large" android:screenDensity="560" />

             <screen android:screenSize="xlarge" android:screenDensity="640" />
             <screen android:screenSize="large" android:screenDensity="640" />
             <screen android:screenSize="normal" android:screenDensity="640" /> 

        </compatible-screens>

感谢您提出的宝贵建议。

答案 1 :(得分:1)

屏幕密度标记只能采用“ldpi”,“mdpi”等值。请参阅http://developer.android.com/guide/topics/manifest/compatible-screens-element.html

但是在这里你传递的dpi值如480是无效的。

答案 2 :(得分:0)

谷歌无法识别屏幕密度为580,但560用于支持Nexus 6等设备

您可以使用<screen android:screenSize="normal" android:screenDensity="560" />

同样支持普通/大型设备获取xxhdpi和xxxhdpi分别使用screenDensity = 480和640