无法使用某些L SDK功能

时间:2014-06-27 09:03:58

标签: java android android-studio adt android-5.0-lollipop

我试图在新SDK中使用新的Activity转换。

我尝试过这一行:

getWindow().requestFeature(Window.FEATURE_CONTENT_TRANSITIONS);

但问题是Window不包含FEATURE_CONTENT_TRANSITIONS

我也试过这一行:

getWindow().setExitTransition(new Explode());

并且Explode课程不存在......

我已将项目设置为使用L SDK(android-L)编译并使用新的SDK工具(20.0.0)

的build.gradle:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 'android-L'
    buildToolsVersion '20.0.0'
    defaultConfig {
        applicationId 'com.tester'
        minSdkVersion 'L'
        targetSdkVersion 'L'
        versionCode 1
        versionName '1.0'
    }
    buildTypes {
        release {
            runProguard false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    productFlavors {
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile "com.android.support:support-v4:+"
}

buildscript {
    repositories {
        mavenCentral()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:0.12.+'
    }
}

2 个答案:

答案 0 :(得分:0)

您似乎没有在构建路径中包含L SDK库。 库是否列为项目的依赖项?

答案 1 :(得分:0)

尝试文件 - >使高速缓存/重新启动无效。

如果这不起作用,您可以尝试删除〜/ .AndroidStudioBeta(或〜/ .AndroidStudioPreview,无论您使用哪个)。它将清除所有设置,以便为此做好准备,但这解决了我的问题。

对于Mac,请清楚:
〜/ Library / Application Support / AndroidStudioBeta
〜/图书馆/缓存/ AndroidStudioBeta
〜/资源库/日志/ AndroidStudioBeta
〜/ Library / Preferences / AndroidStudioBeta