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

アダビスの答えをありがとう。

于 2015-03-23T16:11:11.497 に答える