更新Android L工具后生成失败该怎么办?

内容来源于 Stack Overflow,并遵循CC BY-SA 3.0许可协议进行翻译与使用

  • 回答 (2)
  • 关注 (0)
  • 查看 (25)

更新工具后,我无法构建我的项目。我在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 classpath'com.android.tools.build:gradle:0.9.+'

提问于
用户回答回答于

在你的app / build.gradle文件中: compile 'com.android.support:support-v4:+' 改为: compile 'com.android.support:support-v4:19.1.0'

'+'表示它将查找最新版本的依赖关系。如果你下载了L预览版,最新版本将成为L的支持库 - 这不适用于目标为API 19的项目。

用户回答回答于

你有没有更新你的build.gradle文件来反映这些变化:

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

扫码关注云+社区