2017-05-08 87 views
0

我正在將< compatible-screens>替換爲< supports-screens>。 ZXing庫代碼掃描條形碼是依賴性問題。錯誤顯示在下面。Gradle錯誤:app:processDevDebugManifest失敗時添加<支持屏幕>

AndroidManifest.xml:121:9-37 Error: Attribute [email protected] value=(false) from AndroidManifest.xml:121:9-37 is also present at [xyz:unspecified] AndroidManifest.xml:17:9-36 value=(true).

:app:processDevDebugManifest FAILED

FAILURE: Build failed with an exception.

我還在工具中添加了:replace in manifest。

<manifest xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools" 
    package="c.x.y"> 

    <!--<compatible-screens>--> 

     <!--&lt;!&ndash; all small size screens &ndash;&gt;--> 
     <!--&lt;!&ndash; <screen android:screenSize="small" android:screenDensity="ldpi" /> &ndash;&gt;--> 
     <!--<screen--> 
      <!--android:screenDensity="mdpi"--> 
      <!--android:screenSize="small" />--> 
     <!--<screen--> 
      <!--android:screenDensity="hdpi"--> 
      <!--android:screenSize="small" />--> 
     <!--<screen--> 
      <!--android:screenDensity="xhdpi"--> 
      <!--android:screenSize="small" />--> 
     <!--<screen--> 
      <!--android:screenDensity="480"--> 
      <!--android:screenSize="small" /> &lt;!&ndash; xxhdpi &ndash;&gt;--> 
     <!--<screen--> 
      <!--android:screenDensity="640"--> 
      <!--android:screenSize="small" /> &lt;!&ndash; xxxhdpi &ndash;&gt;--> 


     <!--&lt;!&ndash; all normal size screens &ndash;&gt;--> 
     <!--&lt;!&ndash; <screen android:screenSize="normal" android:screenDensity="ldpi" /> &ndash;&gt;--> 
     <!--<screen--> 
      <!--android:screenDensity="mdpi"--> 
      <!--android:screenSize="normal" />--> 
     <!--<screen--> 
      <!--android:screenDensity="hdpi"--> 
      <!--android:screenSize="normal" />--> 
     <!--<screen--> 
      <!--android:screenDensity="xhdpi"--> 
      <!--android:screenSize="normal" />--> 
     <!--<screen--> 
      <!--android:screenDensity="420"--> 
      <!--android:screenSize="normal" />--> 
     <!--<screen--> 
      <!--android:screenDensity="480"--> 
      <!--android:screenSize="normal" />--> 
     <!--<screen--> 
      <!--android:screenDensity="560"--> 
      <!--android:screenSize="normal" />--> 
     <!--<screen--> 
      <!--android:screenDensity="640"--> 
      <!--android:screenSize="normal" />--> 
    <!--&lt;!&ndash; all small size screens &ndash;&gt;--> 
    <!--&lt;!&ndash; <screen android:screenSize="small" android:screenDensity="ldpi" /> &ndash;&gt;--> 
    <!--<screen--> 
    <!--android:screenDensity="mdpi"--> 
    <!--android:screenSize="small" />--> 
    <!--<screen--> 
    <!--android:screenDensity="hdpi"--> 
    <!--android:screenSize="small" />--> 
    <!--<screen--> 
    <!--android:screenDensity="xhdpi"--> 
    <!--android:screenSize="small" />--> 
    <!--<screen--> 
    <!--android:screenDensity="480"--> 
    <!--android:screenSize="small" /> &lt;!&ndash; xxhdpi &ndash;&gt;--> 
    <!--<screen--> 
    <!--android:screenDensity="640"--> 
    <!--android:screenSize="small" /> &lt;!&ndash; xxxhdpi &ndash;&gt;--> 


    <!--&lt;!&ndash; all normal size screens &ndash;&gt;--> 
    <!--&lt;!&ndash; <screen android:screenSize="normal" android:screenDensity="ldpi" /> &ndash;&gt;--> 
    <!--<screen--> 
    <!--android:screenDensity="mdpi"--> 
    <!--android:screenSize="normal" />--> 
    <!--<screen--> 
    <!--android:screenDensity="hdpi"--> 
    <!--android:screenSize="normal" />--> 
    <!--<screen--> 
    <!--android:screenDensity="xhdpi"--> 
    <!--android:screenSize="normal" />--> 
    <!--<screen--> 
    <!--android:screenDensity="420"--> 
    <!--android:screenSize="normal" />--> 
    <!--<screen--> 
    <!--android:screenDensity="480"--> 
    <!--android:screenSize="normal" />--> 
    <!--<screen--> 
    <!--android:screenDensity="560"--> 
    <!--android:screenSize="normal" />--> 
    <!--<screen--> 
    <!--android:screenDensity="640"--> 
    <!--android:screenSize="normal" />--> 
    <!--</compatible-screens>--> 

    <supports-screens 
     android:largeScreens="true" 
     android:normalScreens="true" 
     android:smallScreens="false" 
     android:xlargeScreens="false" /> 

    <application 
     android:allowBackup="false" 
     android:hardwareAccelerated="true" 
     android:icon="@mipmap/ic_launcher" 
     android:label="@string/app_name" 
     android:largeHeap="true" 
     android:theme="@style/AppTheme" 
     tools:replace="android:label, android:icon, android:allowBackup, android:smallScreens, android:xlargeScreens"> 

感謝。

+0

把你的清單放在這裏... –

回答

0

解決:

除了使用工具:替換應用的標籤,我的<支持屏幕內移動在>和它的工作。

<supports-screens 
     android:largeScreens="true" 
     android:normalScreens="true" 
     android:smallScreens="false" 
     android:xlargeScreens="false" 
     tools:replace="android:smallScreens, android:xlargeScreens" 
     /> 
相關問題