首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >更新Android L工具后构建失败

更新Android L工具后构建失败
EN

Stack Overflow用户
提问于 2014-06-27 02:47:11
回答 3查看 11.5K关注 0票数 17

更新工具后,我无法构建我的项目。我在Android Studio中遇到了这个错误。

/build/exploded-aar/com.android.support/support-v4/21.0.0-rc1/AndroidManifest.xml:3]

无法分析:必须是整数或代码名。

有什么想法吗?

我认为这个清单来自于支持库。我还为我的项目准备了一个min=14 target=19

代码语言:javascript
复制
<?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.+'

EN

回答 3

Stack Overflow用户

回答已采纳

发布于 2014-06-27 07:23:36

在您的应用程序/build.gradle文件中,更改

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

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

'+‘表示它将查找最新版本的依赖项。如果你下载L预览版,最新的版本将是L的支持库-这对于一个目标是API 19的项目是不起作用的。

票数 25
EN

Stack Overflow用户

发布于 2014-06-27 02:51:28

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

代码语言:javascript
复制
compileSdkVersion is set to 'android-L'
minSdkVersion is set to 'L'
targetSdkVersion is set to 'L'

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

票数 2
EN

Stack Overflow用户

发布于 2014-07-16 05:09:26

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

代码语言:javascript
复制
compile('com.android.support:support-v4:19.1.0'){
    force = true
}
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/24437950

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档