Android API 24. 在包 'android' 中找不到属性 'minimalSize' 的资源标识符

Android API 24. No resource identifier found for attribute 'minimalSize' in package 'android'

我的清单文件 activity - layout 中的 android:minimalSize 有问题。它说

No resource identifier found for attribute 'minimalSize' in package 'android'

这很奇怪。从这里 https://developer.android.com/preview/features/multi-window.html#configuring 看来 android:minimalSize 是 multi-window 模式的合法属性。

此外,activity - layout 中的其他属性如 android:defaultHeightandroid:defaultWidth 都可以。

也许有人遇到过类似的问题。

应用级别build.gradle

apply plugin: 'com.android.application'

android {
    compileSdkVersion 24
    buildToolsVersion "24.0.0"

    defaultConfig {
        //...
        minSdkVersion 16
        targetSdkVersion 24
        //...
    }
    //...
}

dependencies {
    //...
    compile 'com.android.support:appcompat-v7:24.0.0'
}

AndroidManifest.xml:

//...
<activity
    //...
    android:resizeableActivity="true">
    <layout android:minimalSize="450dp" />
    //...
</activity>
//...

根据 New APIs in Developer Preview 4:

The Multi-Window android:minimalHeight and android:minimalWidth attributes have been renamed to android:minHeight and android:minWidth.

documentation page you linked to 也更新为引用新名称。