最近在装phoneGap的环境,遇到问题并解决,记录下来,
问题是:
:processDebugManifest
E:\workspace\AndroidStudioProjects\cordova\hello\platforms\android\AndroidManife
st.xml:15:5 Error:
uses-sdk:minSdkVersion 8 cannot be smaller than version 14 declared in l
ibrary E:\workspace\AndroidStudioProjects\cordova\hello\platforms\android\build\
intermediates\exploded-aar\android\CordovaLib\unspecified\debug\AndroidManifest.
xml
Suggestion: use tools:overrideLibrary="org.apache.cordova" to force usag
e
:processDebugManifest FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':processDebugManifest'.
> Manifest merger failed : uses-sdk:minSdkVersion 8 cannot be smaller than versi
on 14 declared in library E:\workspace\AndroidStudioProjects\cordova\hello\platf
orms\android\build\intermediates\exploded-aar\android\CordovaLib\unspecified\deb
ug\AndroidManifest.xml
Suggestion: use tools:overrideLibrary="org.apache.cordova" to force usag
e
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug
option to get more log output.
BUILD FAILED
Total time: 7.358 secs
问题处理的方式是:
在E:\workspace\AndroidStudioProjects\cordova\hello\platforms\android\AndroidManifest.xml
中添加xmlns:tools="http://schemas.android.com/tools"
以及<uses-sdk tools:overrideLibrary="org.apache.cordova" />
完整的如下:
<?xml version='1.0' encoding='utf-8'?>
<manifest android:hardwareAccelerated="true" android:versionCode="1" android:versionName="0.0.1" package="com.example.hello" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools">
<supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:resizeable="true" android:smallScreens="true" android:xlargeScreens="true" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<application android:hardwareAccelerated="true" android:icon="@drawable/icon" android:label="@string/app_name" android:supportsRtl="true">
<activity android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale" android:label="@string/activity_name" android:launchMode="singleTop" android:name="MainActivity" android:theme="@android :style/Theme.Black.NoTitleBar" android:windowSoftInputMode="adjustResize">
<intent-filter android:label="@string/launcher_name">
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
<uses-sdk tools:overrideLibrary="org.apache.cordova" />
<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="8" />
</manifest>