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 Studio到1.0.2的問題解決Android
- Android Studio3.1.2及Android P相關問題Android
- 【填坑】vue+webpack 升級後在原有專案上的適配問題VueWeb
- Swift3.0專案升級到4.2遇到問題Swift
- Android 升級到Android Studio2.2 後打不開以前版本的專案Android
- Android studio 升級到3.1出現的問題Caused by: java.util.NoSuchElementExceptionAndroidJavaException
- 專案升級到.Net8.0 Autofac引發詭異的問題
- 用 Visual Studio 升級 .NET 專案
- Android Studio 升級到3.0 提示 java.lang.NoClassDefFoundErrorAndroidJavaError
- 【Android Studio】解決升級 macOS High Sierra 後 Android Studio 同步專案時 gradle 構AndroidMacGradle
- Android studio gradle升級到4.10.3,以後找不到R檔案AndroidGradle
- 專案 Laravel 框架 5.1 升級到 5.5 過程中的一些問題Laravel框架
- Android 專案編譯過程Android編譯
- Android Studio 編譯工程的時候遇到的問題 Unable to delete directoryAndroid編譯delete
- 使用NDK編譯含JNI的Android專案常見問題解決方案編譯Android
- Visual Studio 編譯專案失敗,提示找不到檔案編譯
- JDK升級專題JDK
- 資料升級到5.1所遇到的問題
- Android Studio 升級3.5後,格式化XML佈局檔案層級順序錯亂問題AndroidXML
- Android Studio升級gradle版本之後編譯出現CreateProcess error=206異常解決AndroidGradle編譯Error
- Android編譯通過,執行編譯錯誤問題總結Android編譯
- 關於.net專案從vs2003升級到2005的若干問題
- Android Studio 編譯錯誤集錦Android編譯
- android studio匯入專案--解決gradle-headache問題AndroidGradle
- studio升級api28和butternife不相容問題(二)API
- Laravel 5.5.* 升級到 5.7.* 問題記錄Laravel
- android studio jdk問題AndroidJDK
- SPI編譯問題編譯
- perl 編譯問題!編譯
- jive編譯問題編譯
- 如何將webpack2專案升級到webpack3Web
- Laravel5.5 升級到 5.7 問題及解決方法Laravel
- Oracle RAC 10.2.0.5升級到11.2.0.4遇到的問題Oracle
- 10g升級到11g密碼問題密碼
- Android Studio打包專案:APKAndroidAPK
- Android 如何編寫基於編譯時註解的專案Android編譯
- Android targetSdkVersion 升級到 26 總結Android
- Linux平滑編譯升級php至5.5.0Linux編譯PHP