17

更新工具后我无法构建我的项目。我在 Android Studio 中收到此错误。

/build/exploded-aar/com.android.support/support-v4/21.0.0-rc1/AndroidManifest.xml:3] 解析失败:必须是整数或代号。

有任何想法吗?

这个清单来自我认为的支持库。我的项目还有另一个是min=14 target=19

<?xml version="1.0" encoding="utf-8"?>
<!--
 Copyright (C) 2014 The Android Open Source Project

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="android.support.v4" >

    <uses-sdk
        android:minSdkVersion="L"
        android:targetSdkVersion="L" />

    <application />

</manifest>

gradle 类路径 'com.android.tools.build:gradle:0.9.+'

4

3 回答 3

25

在您的 app/build.gradle 文件中,更改
compile 'com.android.support:support-v4:+'

compile 'com.android.support:support-v4:19.1.0'

'+' 表示它将寻找最新版本的依赖项。如果您下载 L 预览版,最新版本将是 L 的支持库——它不适用于目标为 API 19 的项目。

于 2014-06-26T23:23:35.707 回答
2

您是否更新了 build.gradle 文件以反映这些更改?

compileSdkVersion is set to 'android-L'
minSdkVersion is set to 'L'
targetSdkVersion is set to 'L'

来源:http: //developer.android.com/preview/setup-sdk.html

于 2014-06-26T18:51:28.317 回答
1

这为我解决了这个问题,我能够构建应用程序。

compile('com.android.support:support-v4:19.1.0'){
    force = true
}
于 2014-07-15T21:09:25.967 回答