无法使用 L SDK 的某些功能 [英] Can't use some of L SDK features

查看:25
本文介绍了无法使用 L SDK 的某些功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在新 SDK 中使用新的活动转换.

I'm trying to use the new Activity transitions in the new SDK.

我试过这条线:

getWindow().requestFeature(Window.FEATURE_CONTENT_TRANSITIONS);

但问题在于 Window 不包含 FEATURE_CONTENT_TRANSITIONS.

But the problem is that Window doesn't include FEATURE_CONTENT_TRANSITIONS.

我也试过这条线:

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

并且 Explode 类不存在...

And Explode class doesn't exist...

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

I already set my project to be compiled with L SDK (android-L) and use the new SDK tools (20.0.0)

build.gradle:

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.+'
    }
}

推荐答案

Try File -> Invalidate Caches/Restart.

Try File -> Invalidate Caches / Restart.

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

If that doesn't work, you can try deleting ~/.AndroidStudioBeta (or ~/.AndroidStudioPreview, whichever you are using). It will clear all your settings so be prepared for that, but this solved the issue in my case.

对于 Mac,清除:
〜/库/应用程序支持/AndroidStudioBeta
~/Library/Caches/AndroidStudioBeta
~/Library/Logs/AndroidStudioBeta
~/Library/Preferences/AndroidStudioBeta

For Mac, clear:
~/Library/Application Support/AndroidStudioBeta
~/Library/Caches/AndroidStudioBeta
~/Library/Logs/AndroidStudioBeta
~/Library/Preferences/AndroidStudioBeta

这篇关于无法使用 L SDK 的某些功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆