[안드로이드 공부] 204

Android Studio build error - compileDebugJavaWithJavac task (current target it 1.8) and kaptGenerateStubsDebugKotlin task (current target is 17)

Before compileOptions { sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 } kotlinOptions { jvmTarget = "1.8" freeCompilerArgs = listOf("-Xjvm-default=enable") } After >>> JavaVersion.VERSION_1_8.toString() compileOptions { sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 } kotlinOptions { jvmTarget = JavaVersio..

The style on this component requires your app theme to be Theme.MaterialComponents (or a descendant)

com.google.android.material.bottomappbar.BottomAppBar material 을 사용 할 때, material 테마를 적용 해주시 않으면 아래와 같은 에러가 나온다. The style on this component requires your app theme to be Theme.MaterialComponents (or a descendant) layout.xml 과 style.xml에 아래와 같이 수정 해준다. 1. layout android:theme="@style/MaterialTheme" 2. style

Inheritance from an interface with '@JvmDefault' members is only allowed with -Xjvm-default option

Inheritance from an interface with '@JvmDefault' members is only allowed with -Xjvm-default option viewModel 에 param을 추가하였더니 viewModel Factory가 필요하고, 추가 하니 위와 같은 에러가 나왔다~ 버전 충돌 문제인데~ build.gradle.app 에 kotlinOptions { jvmTarget = '1.8' freeCompilerArgs += [ '-Xjvm-default=enable' ] } 또는 tasks.withType(KotlinCompile).configureEach { kotlinOptions { freeCompilerArgs += [ "-Xjvm-default=all", ] } }..

Resource IDs will be non-final by default in Android Gradle Plugin version 8.0, avoid using them in switch case statements

switch 문에서 case R.id.xxxx 를 더 이상 제공 하지 않는다고 한다. 간단하게 if else 문으로 대체 하면 되는데 case 문이 많을 경우 난감하고 귀찮다. 이럴 때는 간단히 Refactoring 을 하면 된다. switch 에 커서를 올리고 Option(Windows Alt) + enter 를 치고 Replace switch with if 를 선택하면 한 방에 해결 된다.

bitbucket 계정 비밀번호(github 토큰) 설정 방법

Update failed Invocation failed Unexpected end of file from server java.lang.RuntimeException: Invocation failed Unexpected end of file from server Git 사용 시 이런 에러가 나타나면 앱 비밀번호를 생성 해주어야 한다 Github 에서는 토큰 생성하고, 메뉴에서 직접 입력 하면 되지만 Bitbucket에서는 안드로이드스튜디오 > Git > Manage Remote 주소 입력에 비밀번호를 넣어줘야 한다. https://계정:비밀번호@bitbucket.org/project 끝.

Gradle 7로 업그레이드 시 발생하는 에러 com.github.dcendents.android-maven

에러 문구 A problem occurred evaluating project Failed to apply plugin 'com.github.dcendents.android-maven'. Unable to load class 'org.gradle.api.publication.maven.internal.MavenPomMetaInfoProvider'. 주로, 오래된 오픈 소스를 사용하다 보면 발생하는 문제. 오픈소스의 그래들이 업데이트 되지 않기 때문데 아래와 같이 직접 수정 해주어야 한다. 모듈 gradle 수정 사항 아래와 같이 순서대로 수정 하면 된다. 1. 아래 줄 삭제 apply plugin: 'com.github.dcendents.android-maven' 하고 apply plugin: 'mave..

안드로이드 스튜디오 빌드 10% 향상 시키기

Build Analyzer 를 실행 하면 아래와 같이 팁이 나타나는데, 따라 해주면 10%의 성능 향상이 기대된다고 한다. gradle.properties 에 org.gradle.jvmargs=-Xmx2048m org.gradle.parallel=true 에서 아래 라인을 추가 -XX:+UseParallelGC 하면 org.gradle.jvmargs=-Xmx2048m -XX:+UseParallelGC org.gradle.parallel=true 요렇게 되고, Build Analyzer를 다시 실행하면 위 팁이 사라진다.