1.androidstudio旧版本升级到新版本后出现的编译错误问题
1.1Could not find com.android.tools.build:aapt2:3.3.2-5309881
allprojects {
repositories {
jcenter()
google() -->add this line
}
1.2 uses-sdk:minSdkVersion 9 cannot be smaller than version 14 declared in library
9改为14即可
1.3 在Android Studio本地运行GitHub上的开源Android项目
https://blog.csdn.net/csdnzouqi/article/details/84305554
1.4 android studio + opencv
1、错误:Could not find com.android.tools.build:aapt2:3.3.2-5309881
add the google() in build.gradle
allprojects {
repositories {
jcenter()
google() -->add this line
}
2、错误:Manifest merger failed : uses-sdk:minSdkVersion 1 cannot be smaller than version 14 declared in library
3、Manifest merger failed : uses-sdk:minSdkVersion 1 cannot be smaller than version 7
You have to add the minSdkVersion to your build.gradle.
Otherwise, gradle uses the default value = 1.
You are using a library with minSdk=7, then you can’t use minSdk=1.
Also pay attention that gradle overrides the values in the Manifest.
Add something like this:
android {
compileSdkVersion 22
buildToolsVersion “22.0.1”
defaultConfig {
minSdkVersion 14
targetSdkVersion 22
}
}
Pay attention to your build.gradle. You have two dependencies blocks. You have to merge these blocks.
4、旧版opencv升级到新版,导致java build失败
1.5 android studio+GIT
1)Android studio下将项目代码上传至github包括更新,同步,创建依赖
https://blog.csdn.net/asdf717/article/details/54290796
2)android studio将代码关联到git@osc(出现 Empty repository,以及push reject解决)
https://blog.csdn.net/r1254/article/details/51296258
1.6opencv build.gradle
compileSdkVersion 27和minSdkVersion 19对java的包有影响
1.7 opencv 引入函数Imgproc.Canny(tmpImage, detectedEdges, minThreshold, maxThreshold);闪退
以前手机安装opencv3.4apk时,shapedetection的contours detected也闪退,我手机改为安装opencv3.1时,就不闪退了。