Gradle 导入错误
eg:
1. renderscript support mode in android studio
2. Gradle DSL method not found: ‘runProguard’
这都是因为gradle版本更新导致的问题:
参考:http://tools.android.com/tech-docs/new-build-system
DSL/API changes:
Renamed a few properties to make things more consistent.
- BuildType.runProguard -> minifyEnabled
- BuildType.zipAlign -> zipAlignEnabled
- BuildType.jniDebugBuild -> jniDebuggable
- BuildType.renderscriptDebug -> renderscriptDebuggable
- ProductFlavor.renderscriptSupportMode -> - renderscriptSupportModeEnabled
- ProductFlavor.renderscriptNdkMode -> renderscriptNdkModeEnabled
eg:
3. uses-sdk element cannot have a “tools:node” attribute
Solution:–
Add this line to uses-sdk tag like this:
<uses-sdk
tools:node="merge" <----This line do the magic
android:minSdkVersion="14"
android:targetSdkVersion="19" />
And add the tools name space in manifest :
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" .....
.../>