android studio 2.2.3 升級到3.1.2 原有專案編譯問題
編譯不過,需要修改一下幾個檔案:紅色部分是需要修改的。
1)build.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
google()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
2) app/build.gradle
apply plugin: 'com.android.application'
/*def getTime() {
return new Date().format("yyyyMMdd", TimeZone.getTimeZone("UTC"))
}*/
android {
compileSdkVersion 27
// buildToolsVersion '27.0.3'
defaultConfig {
applicationId "com.orbbec.obdepth"
minSdkVersion 15
targetSdkVersion 27
versionCode 3
versionName "1.1.7"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
// shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
/*applicationVariants.all { variant ->
variant.outputs.each { output ->
def outputFile = output.outputFile
def fileName
if (outputFile != null && outputFile.name.endsWith('.apk')) {
if (variant.buildType.name.equals('release')) {
fileName = "obDepth_${defaultConfig.versionName}_${getTime()}.apk"
} else if (variant.buildType.name.equals('debug')) {
fileName = "obDepth_${defaultConfig.versionName}_${getTime()}.apk"
}
output.outputFile = new File(outputFile.parent, fileName)
}
}
}*/
sourceSets{
main{
jniLibs.srcDirs =['libs']
}
}
}
/*
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
implementation 'com.android.support:appcompat-v7:23.2.1'
testImplementation 'junit:junit:4.12'
}
*/
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.0.2'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
android {
lintOptions {
checkReleaseBuilds false
// Or, if you prefer, you can continue to check for errors in release builds,
// but continue the build even when errors are found:
abortOnError false
}
}
3)gradle\wrapper\gradle-wrapper.properties
#Mon Dec 28 10:00:20 PST 2015
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4.1-all.zip
相關文章
- Android Studio3.1.2及Android P相關問題Android
- Android studio 升級到3.1出現的問題Caused by: java.util.NoSuchElementExceptionAndroidJavaException
- Swift3.0專案升級到4.2遇到問題Swift
- 【Android Studio】解決升級 macOS High Sierra 後 Android Studio 同步專案時 gradle 構AndroidMacGradle
- Android studio gradle升級到4.10.3,以後找不到R檔案AndroidGradle
- 用 Visual Studio 升級 .NET 專案
- Android Studio 升級3.5後,格式化XML佈局檔案層級順序錯亂問題AndroidXML
- 專案升級到.Net8.0 Autofac引發詭異的問題
- Android Studio升級gradle版本之後編譯出現CreateProcess error=206異常解決AndroidGradle編譯Error
- android studio匯入專案--解決gradle-headache問題AndroidGradle
- 專案 Laravel 框架 5.1 升級到 5.5 過程中的一些問題Laravel框架
- android studio jdk問題AndroidJDK
- Android Studio打包專案:APKAndroidAPK
- Android編譯通過,執行編譯錯誤問題總結Android編譯
- Android Studio常見問題(+)Android
- Android studio 問題記錄Android
- Android Studio中編譯除錯Launcher3Android編譯除錯
- studio升級api28和butternife不相容問題(二)API
- Android Studio:截至2023年3月已有 12% 的安卓使用者升級到 Android 13Android安卓
- 解決Android Studio每次匯入專案都會下載Gradle和Android Gradle plugin的問題AndroidGradlePlugin
- JDK升級專題JDK
- Android targetSdkVersion 升級到 26 總結Android
- libmemcached編譯問題IBM編譯
- SPI編譯問題編譯
- Linux平滑編譯升級php至5.5.0Linux編譯PHP
- Android studio glide包重複問題AndroidIDE
- Laravel 5.5.* 升級到 5.7.* 問題記錄Laravel
- SpringBoot 2.1.0 升級到 2.5.4 遇到的問題彙總Spring Boot
- visual studio建立專案時需要注意的問題
- Android Apk反編譯系列教程(三)Android Studio除錯smali程式碼AndroidAPK編譯除錯
- 【問題記錄】—.NetCore 編譯問題NetCore編譯
- 專案編譯報錯編譯
- 使用命令列建立Android Studio專案命令列Android
- Android Studio修改專案名和包名Android
- [譯] 前端專案中常見的 CSS 問題前端CSS
- Android 編譯打包的那些疑問Android編譯
- ArchLinux/Manjaro升級到6.9核心後的問題解決LinuxJAR
- Laravel5.5 升級到 5.7 問題及解決方法Laravel