| 프로그래밍 분야/안드로이드
-
💡 [Android/Kotlin] 뷰바인딩(viewBinding) 어떻게 쓰고, 왜 쓰는가? (ft. kotlin-android-extensions)| 프로그래밍 분야/안드로이드 2021. 6. 22. 22:58
💡 사용 방법 1) build.gradle(:app) 세팅 android { ... viewBinding { enabled = true } ... } 2) MainActivity.kt 세팅 (Inflate하려는 리소스파일의 이름 : example_res.xml) class MainActivity : AppCompatActivity() { private lateinit var binding: ExampleResBinding override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) binding = ExampleResBinding.inflate(layoutInflater) setContentView(bindi..
-
💡[문제 상황 - 해결] Task :app:checkDebugDuplicateClasses FAILED| 프로그래밍 분야/안드로이드 2021. 6. 5. 02:44
Receiver 예제를 공부하던 중 빌드 에러가 발생했다. 매우 간단한 예제로서, 따로 사용해준 외부 라이브러리는 'com.github.pedroSG94:AutoPermissions:1.0.3' 뿐이었다. 에러 코멘트는 다음과 같다. > Task :app:checkDebugDuplicateClasses FAILED Execution failed for task ':app:checkDebugDuplicateClasses'. > A failure occurred while executing com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable > Duplicate class android.support.v4.app.INotificationSideC..
-
💡[문제 상황 - 해결] byte[][] cannot be cast to java.util.Objects[]| 프로그래밍 분야/안드로이드 2021. 6. 5. 02:20
Receiver 예제를 공부하던 중, (빌드나 run과정에서는 잡히지 않았지만) 설계한대로 동작하지 않는 상황 발행. Logcat 뒤져보니까 중간에 Fatal Error가 있었다. byte[][] cannot be cast to java.util.Objects[] try - catch 를 썼다면 exception으로 떴겠지. 뭔가 싶어서 코드를 뒤져보니 이런 부분이 있었다. private SmsMessage[] parseSmsMessage(Bundle bundle) { Object[] objs = (Objects[]) bundle.get("pdus"); SmsMessage[] messages = new SmsMessage[objs.length]; 저기에서 Objects[]로 cast하는 부분에서... s..
-
💡[문제 상황 - 해결] This Activity already has an action bar supplied by the window decor.| 프로그래밍 분야/안드로이드 2021. 6. 4. 00:04
This Activity already has an action bar supplied by the window decor. Do not request Window.FEATURE_SUPPORT_ACTION_BAR and set windowActionBar to false in your theme to use a Toolbar instead. 이미 액션바를 사용하고 있으므로 (그 하위 레이아웃인) 툴바를 중복하여 사용할 수 없다는 에러메세지. AndroidManifest의 application 태그의 theme 부분을 NoActionBar로 변경해주면 해결. android:theme="@style/Theme.Design.NoActionBar"
-
💡android와 androidx의 차이점| 프로그래밍 분야/안드로이드 2021. 6. 3. 23:52
그동안 안드로이드는 android 지원 라이브러리에서 기작성된 다양한 클래스 및 메서드들을 제공해왔다. 다만, v4, v7... 등 버전이 혼잡해질수록 호환성 문제가 발생하면서, 다양한 버전을 통합하고 자체적으로 관리하는 새로운 네임스페이스 androidx를 구성하게 되었다. 즉, androidx는 android의 진보형이라고 생각하면 편하겠다. (android developers에 따르면) androidx는 기존의 android를 모두 구현하였고, 호환성 문제를 모두 해결했다고 한다. (사실 bundle이나 기본제공 layout들은 여전히 android 네임스페이스 하에서 지원하고 있다... androidx와 android가 함께 import될시 발생하는 Error로 보아 완벽한 호환은 되지 않는것으로..
-
💡[문제 상황 - 해결] Task :app:processDebugMainManifest FAILED (Gradle Build Failed)| 프로그래밍 분야/안드로이드 2021. 6. 3. 18:29
[개발 환경] - OS : Windows 10 - IDE : Android Studio - JDK : JAVA SE 16.0.1 - Dependencies : 라이브러리 하나 추가 (com.android.support.design 28.0.0) - 상황 : 간단한 Fragment 예제를 연습하던 중 빌드 오류 - Error Output AGPBI: {"kind":"warning","text":"Please remove usages of `jcenter()` Maven repository from your build scripts and migrate your build to other Maven repositories.\nThis repository is deprecated and it will be s..