问题
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, changecompile 'com.android.support:support-v4:+'
tocompile '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