Andorid jetpack의 새로운 기능인 compose를 시도하고 있습니다. 아래는 내 코드입니다. 루트 폴더가 아닌 앱의 build.gradle 파일에 buildfeatures를 추가하고 있습니다.
android {
compileSdkVersion compileSDKVer
buildToolsVersion buildToolsVer
defaultConfig {
applicationId "com.sample.slothyhacker.jetpackcompose"
minSdkVersion minSdkVer
targetSdkVersion targetSdkVer
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
buildFeatures {
// Enables Jetpack Compose for this module
//compose true
}
compileOptions {
// Set both the Java and Kotlin compilers to target Java 8.
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = "1.8"
}
}
하지만 내 프로젝트에서 컴파일 오류가 발생합니다. 누군가가 잘못하고있는 일에 대해 밝힐 수 있다면 정말 감사하겠습니다.
Could not find method buildFeatures() for arguments [build_7yf57wk394cperk1t82v120yf$_run_closure1$_closure5@78c292be] on object of type com.android.build.gradle.internal.dsl.BaseAppModuleExtension.
Canary 빌드에서만 사용할 수있는 Android Studio 4.0 이상에서만 추가 할 수 있습니다.
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다