android studio编译异常处理

来源:互联网 发布:单片机与arm的异同 编辑:程序博客网 时间:2024/05/20 11:25

一、
Could not find method renderscriptSupportMode() for arguments [true] on ProductFlavor_Decorated{name=main, dimension=null,
minSdkVersion=ApiVersionImpl{mApiLevel=14, mCodename=’null’}, targetSdkVersion=ApiVersionImpl{mApiLevel=19, mCodename=’null’}
, renderscriptTargetApi=19, renderscriptSupportModeEnabled=null, renderscriptNdkModeEnabled=null, versionCode=null, versionNa
me=null, applicationId=null, testApplicationId=null, testInstrumentationRunner=null, testInstrumentationRunnerArguments={}, t
estHandleProfiling=null, testFunctionalTest=null, signingConfig=null, resConfig=null, mBuildConfigFields={}, mResValues={}, m
ProguardFiles=[], mConsumerProguardFiles=[], mManifestPlaceholders={}}
resolve:
BuildType.runProguard -> minifyEnabled
BuildType.zipAlign -> zipAlignEnabled
BuildType.jniDebugBuild -> jniDebuggable
BuildType.renderscriptDebug -> renderscriptDebuggable
ProductFlavor.renderscriptSupportMode -> renderscriptSupportModeEnabled
ProductFlavor.renderscriptNdkMode -> renderscriptNdkModeEnabled

二、
Fix the issues identified by lint, or add the following to your build script to proceed with errors:

android {
lintOptions {
abortOnError false
}
}

解决方法:在gradle 的 lintOptions内加上 abortOnError false


AAPT err(1304209106): ERROR: 9-patch image M:\project\supervisor-android\app\src\main\res\drawable\

解决方法:很多人的解决方法是叫UI重新修改图片,其实在build.gradle里添加以下两句:aaptOptions.cruncherEnabled = false aaptOptions.useNewCruncher = false,就直接添加到buildToolsVersion的下方即可,造成这个error的原因是as检查图片的合法性越来越严格,这两句是用来关闭Android Studio的PNG合法性检查的


failed to complete Gradle execution, a fatal exception is occured

解决方法:File -> Settings -> Build,Execution,Deployment -> Build Tools -> Gradle

Input the following in the “Gradle VM options” box: -XX:MaxHeapSize=256m -Xmx256m


java.lang.UnsupportedClassVersionError: com/android/dx/command/Main : Unsupported major.minor version 52.0
网上总是说修改java环境变量(我的是jdk1.7,环境变量没错),最后发现是把build.gradle文件下的buildToolsVersion “24.0.0.rc3”改成buildToolsVersion “23.0.2”,把这个版本降低就ok(我的compileSdkVersion 23)

六、
java.lang.UnsatisfiedLinkError: No implementation found for…….
某些手机加载so库文件的时候会出现这个exception,一般是64位的cpu出的问题,有3种方法可以提供
1). targetSdkVersion不要使用23,改为21 或 22
2). 去掉64位库,lib文件夹只保留armeabi文件夹,去除-v7a -v8a的
3).在build.gradle的defaultConfig里面加入
ndk {
abiFilters “armeabi”, “armeabi-v7a”, “x86”
}

0 0
原创粉丝点击