Build failed after updating tools for Android L

▼魔方 西西 提交于 2020-01-01 01:38:30

问题


I cannot build my project after updating the tools. I get this error in Android Studio.

/build/exploded-aar/com.android.support/support-v4/21.0.0-rc1/AndroidManifest.xml:3] Failed to parse : must be an integer number or codename.

Any ideas?

This manifest is from the support library I think. I also have another for my project which is 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.+'


回答1:


In your app/build.gradle file, change
compile 'com.android.support:support-v4:+'
to
compile 'com.android.support:support-v4:19.1.0'

The '+' means that it will look for the newest version of the dependency. If you download the L preview, the latest version will be the support library for L - which isn't going to work for a project whose target is API 19.




回答2:


Did you update your build.gradle file to reflect these changes?

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

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




回答3:


This solved the issue for me and I was able to build the app.

compile('com.android.support:support-v4:19.1.0'){
    force = true
}


来源:https://stackoverflow.com/questions/24437950/build-failed-after-updating-tools-for-android-l

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!