其他分享
首页 > 其他分享> > androidtv-Leanback-master构建错误

androidtv-Leanback-master构建错误

作者:互联网

[环境]
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

解决方法:

我通过升级我的项目来使用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.

标签:android,android-studio,leanback
来源: https://codeday.me/bug/20190830/1765087.html