3

[环境]
Android Studio 1.1.0
buildToolsVersion "21.1.2"

当我构建“androidtv-Leanback-master”时出现以下错误:

Executing tasks: [clean, :app:compileDebugSources]

Configuration on demand is an incubating feature.
:app:clean
:app:preBuild
:app:preDebugBuild
:app:checkDebugManifest
:app:preReleaseBuild
:app:prepareComAndroidSupportAppcompatV72200Library
:app:prepareComAndroidSupportLeanbackV172200Library
:app:prepareComAndroidSupportRecyclerviewV72200Library
:app:prepareComAndroidSupportSupportV42200Library
:app:prepareDebugDependencies
:app:compileDebugAidl
:app:compileDebugRenderscript
:app:generateDebugBuildConfig
:app:generateDebugAssets UP-TO-DATE
:app:mergeDebugAssets
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources
:app:mergeDebugResources
D:\andorid_code\androidtv-Leanback-master\app\build\intermediates\exploded-aar\com.android.support\appcompat-v7\22.0.0\res\drawable-hdpi-v4\abc_spinner_mtrl_am_alpha.9.png: libpng warning: iCCP: Not recognizing known sRGB profile that has been edited

:app:processDebugManifest
:app:processDebugResources
D:\andorid_code\androidtv-Leanback-master\app\build\intermediates\res\debug\transition-v22\lb_browse_entrance_transition.xml:23: error: Error: String types not allowed (at 'slideEdge' with value 'end').

D:\andorid_code\androidtv-Leanback-master\app\build\intermediates\res\debug\transition-v22\lb_browse_return_transition.xml:18: error: Error: String types not allowed (at 'slideEdge' with value 'start').

D:\andorid_code\androidtv-Leanback-master\app\build\intermediates\res\debug\transition-v22\lb_browse_return_transition.xml:27: error: Error: String types not allowed (at 'slideEdge' with value 'end').


 FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:processDebugResources'.
> com.android.ide.common.internal.LoggedErrorException: Failed to run command:
    D:\AndroidSDK\build-tools\21.1.2\aapt.exe package -f --no-crunch -I D:\AndroidSDK\platforms\android-21\android.jar -M D:\andorid_code\androidtv-Leanback-master\app\build\intermediates\manifests\full\debug\AndroidManifest.xml -S D:\andorid_code\androidtv-Leanback-master\app\build\intermediates\res\debug -A D:\andorid_code\androidtv-Leanback-master\app\build\intermediates\assets\debug -m -J D:\andorid_code\androidtv-Leanback-master\app\build\generated\source\r\debug -F D:\andorid_code\androidtv-Leanback-master\app\build\intermediates\res\resources-debug.ap_ --debug-mode --custom-package com.example.android.tvleanback -0 apk --output-text-symbols D:\andorid_code\androidtv-Leanback-master\app\build\intermediates\symbols\debug
Error Code:
    1
Output:
    D:\andorid_code\androidtv-Leanback-master\app\build\intermediates\res\debug\transition-v22\lb_browse_entrance_transition.xml:23: error: Error: String types not allowed (at 'slideEdge' with value 'end').

    D:\andorid_code\androidtv-Leanback-master\app\build\intermediates\res\debug\transition-v22\lb_browse_return_transition.xml:18: error: Error: String types not allowed (at 'slideEdge' with value 'start').

    D:\andorid_code\androidtv-Leanback-master\app\build\intermediates\res\debug\transition-v22\lb_browse_return_transition.xml:27: error: Error: String types not allowed (at 'slideEdge' with value 'end').



* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 48.334 secs
4

2 回答 2

5

我通过升级我的项目以使用API-22解决了这个问题。即,我更改了以下内容:

android {
    compileSdkVersion 22
    buildToolsVersion '21.1.2'

    defaultConfig {
        minSdkVersion 11
        targetSdkVersion 22
...
    }

...

   dependencies {
     ...
     androidTVCompile 'com.android.support:recyclerview-v7:22.0.0'
     androidTVCompile 'com.android.support:leanback-v17:22.0.0'
     androidTVCompile 'com.android.support:appcompat-v7:22.0.0'
  }
}

这还需要更改某些片段中HeaderItem标记的使用。您也可以只使用以前版本的库并继续使用API-21

于 2015-03-22T18:23:44.163 回答
0
android {
    compileSdkVersion 22
    buildToolsVersion "21.1.2"
    defaultConfig {
        applicationId "com.example.android.tvleanback"
        minSdkVersion 21
        targetSdkVersion 22
        versionCode 1
        versionName "1.0"
    }
...... 
dependencies {
        compile fileTree(dir: 'libs', include: ['*.jar'])
        compile 'com.android.support:recyclerview-v7:22.0.0'
        compile 'com.android.support:appcompat-v7:22.0.0'
        compile 'com.github.bumptech.glide:glide:3.4.+'
        compile 'com.android.support:support-v4:+'
        compile 'com.android.support:leanback-v17:22.0.0'
    }

感谢adavis的回答。

于 2015-03-23T16:11:11.497 回答