文章目錄
- Android studio匯入eclipse專案
- 1,Import Project
- 2,在下面兩個檔案編輯(根據已有Android Studio專案對應檔案編輯)
- 我的Android Studio專案對應檔案
- 更改后的Eclipse檔案
- 更改另個檔案
- 更改Main檔案
- 最后調整注釋亂碼問題
Android studio匯入eclipse專案
方法如下(21/3/7)這里前提是已有Android Studio專案可以運行
1,Import Project


2,在下面兩個檔案編輯(根據已有Android Studio專案對應檔案編輯)

我的Android Studio專案對應檔案
plugins {
id 'com.android.application'
}
android {
compileSdkVersion 30
buildToolsVersion "30.0.3"
defaultConfig {
applicationId "com.example.viewmodeltest"
minSdkVersion 16
targetSdkVersion 30
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'com.google.android.material:material:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
}
更改后的Eclipse檔案
apply plugin: 'com.android.application'
android {
//compileSdkVersion 17
compileSdkVersion 30
buildToolsVersion "30.0.3"
defaultConfig {
applicationId "sziit.lihz.ch01_1"
//minSdkVersion 17
//targetSdkVersion 17
minSdkVersion 16
targetSdkVersion 30
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
//dependencies {
// //noinspection GradleCompatible
// implementation 'com.android.support:support-v4:'
//}
dependencies {
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'com.google.android.material:material:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
}
更改另個檔案

更改Main檔案

最后調整注釋亂碼問題

轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/267516.html
標籤:其他
上一篇:PHP判斷是否是手機端
