2017-06-29 48 views
1

的錯誤,我已經取得了在AndroidManifest.xml文件中的一些變化來觸發屏幕方向的事件。這裏是我的AndroidManifest.xml文件...搖籃任務[:應用:assembleDebug]上configChanges

<manifest xmlns:android="http://schemas.android.com/apk/res/android" 
    package="com.domain.product"> 

    <application 
     android:name=".Product" 
     android:allowBackup="true" 
     android:icon="@mipmap/ic_launcher" 
     android:label="@string/app_name" 
     android:largeHeap="true" 
     android:supportsRtl="true" 
     android:theme="@style/AppTheme"> 

     <activity 
      android:name=".MainActivity" 
      android:configChanges="screenSize|orientation|screenLayout" /> 
    </application> 
</manifest> 

這是...的build.gradle

android:configChanges
apply plugin: 'com.android.application' 

android { 
    compileSdkVersion 25 
    buildToolsVersion "25.0.3" 
    defaultConfig { 
     applicationId "com.domain.product" 
     minSdkVersion 15 
     targetSdkVersion 25 
     versionCode 9 
     versionName '2.1' 
     multiDexEnabled true 
    } 
    buildTypes { 
     release { 
      shrinkResources true 
      minifyEnabled true 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
     } 
    } 
    packagingOptions { 
     exclude 'META-INF/LICENSE' 
     exclude 'META-INF/LICENSE-FIREBASE.txt' 
     exclude 'META-INF/NOTICE' 
    } 
} 

後,gradle這個在消息事件日誌顯示錯誤,而建設該項目。看到錯誤在下面圖片...

Messages Event Log

在-儘管有這些錯誤,應用程序在仿真器和設備成功運行。但是有一些錯誤,這就是爲什麼顯示錯誤。有人知道有什麼問題嗎?

回答

0

這可能是因爲你的Android最低目標SDK API級別低於API等級13screenSizeorientation需求。

更在android:configChanges閱讀。

+0

請查看更新的問題,我已經添加的build.gradle文件 – Khan

+0

我已經測試你的代碼。沒有什麼是錯的。請刪除'android:configChanges'行並重新編寫它。也許線上有無形的角色。 –

+0

仍然收到相同的錯誤。 – Khan