분명히 activity_main.xml코드도 똑같고 MainActivity.kt 코드도 똑같은데 nav_host_fragment가 Unresolved Reference라고 뜨네요... 혹시 같은 오류 뜨셔서 해결하신 분 있으실까요? 아니면 제 컴퓨터 환경 문제일까요? ㅠㅠ
실전! 코틀린과 스프링 부트로 도서관리 애플리케이션 개발하기 (Java 프로젝트 리팩토링)
안녕하세요. 강의 들으며 재밌고 공부하고 있습니다. 감사합니다. 예외 처리를 util패지키에 모아서 처리하는 것은 이해했습니다. 약간 궁금증 생겨서 문의 남겨봅니다! BookService의 코드 일부분 입니다. 여기서 보면 UserRepository 와 BookRepository 의 findByName 에서 모두 fail()로 예외 처리를 하는데요, 이걸 그냥 리포지토리 계층의 메서드 자체에서 예외를 처리해주면 더 깔끔하지 않을까 하는 궁금증이 생겼습니다. 제가 지금까지 공부하면서는 리포지토리 계층에서 디폴트 메서드를 통해서 처리하는 코드도 봤고, 서비스 계층에서 처리하는 코드도 봐서 어떤 방식을 선호하시는지, 권장 하시는지 궁금합니다! 좋은 강의 감사합니다!
실전! 코틀린과 스프링 부트로 도서관리 애플리케이션 개발하기 (Java 프로젝트 리팩토링)
- 학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요! - 먼저 유사한 질문이 있었는지 검색해보세요. - 서로 예의를 지키며 존중하는 문화를 만들어가요. - 잠깐! 인프런 서비스 운영 관련 문의는 1:1 문의하기를 이용해주세요. 자바 스프링에서는 테스트용 생성자 메서드가 있어도, 매번 일일히 null을 넣어준다거나 하는 문제점들이 있어서 결국 Builder를 사용했었는데 코틀린에서는 롬복 Builder가 지원되지 않는다고 해서 엄청 고민 중이였습니다 근데 이번 강의 보니까 그냥 온전한 객체 만들어주는 팩터리 메서드 하나 만들어놓고 테스트용으로 필요한 인자 값들만 설정해주면 되는 거였군요 진짜 미쳤다.. 갓틀린.. 잘 배워갑니다..
package deepboot.deep.config.autoconfig import deepboot.deep.annotation.ConditionalMyOnClass import deepboot.deep.annotation.MyAutoConfiguration import org.springframework.beans.factory.annotation.Value import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory import org.springframework.boot.web.servlet.server.ServletWebServerFactory import org.springframework.context.annotation.Bean import org.springframework.core.env.Environment @MyAutoConfiguration @ConditionalMyOnClass("org.apache.catalina.startup.Tomcat") class TomcatWebServerConfig() { @Value(value = "\${context.path}") lateinit var contextPath: String @Bean("tomcatWebServerFactory") @ConditionalOnMissingBean fun servletWebServerFactory(env: Environment): ServletWebServerFactory { val factory = TomcatServletWebServerFactory() println("contextPath: $contextPath") factory.contextPath = this.contextPath return factory } } 현재 제 TomcatWebServerConfig() 전체 코드입니다. contextPath 를 출력했을 때 결과가 contextPath: ${context.path} 위 처럼 나오고, IllegalArgumentException 이 발생합니다. ContextPath must start with '/' and not end with '/' 제가 생각했을 때 이 @Value 를 제대로 못 읽어오는 것 같은데, 코틀린 클래스 생성자 파라미터로 contextPath 를 주입해도, lateinit var 로 선언해도 여전히 properties 에서 값을 못 읽어오네요. 이런 동일 증상 겪으신 분 어떻게 해결했는지 궁금합니다. 아래는 전체 코드 깃허브 주소입니다. https://github.com/dailyzett/deep 도와주시면 정말 감사하겠습니다. chatGPT 로도 계속 물어보고 있는데 제자리만 돌고 있는 느낌이네요.
안녕하세요. 먼저 질좋은 강의 만들어주시고 제공해주셔서 감사드려요! 강의중 Closure가 자바와 다르게 final이 아닌 var변수를 람다안에서 값을 변경가능한것까지 이해하였습니다. 다른 궁금증이 하나 생겨서요. Closure가 람다를 진입하기전 변수를 포획해서 진행한다고 하셨는데, 이는 동시성 문제로부터 자유롭나요?
bts 어플 만들기에서 bts_1 파일까지는 잘 됐는데 액티비티 화면 전환을 시도할려고 코드를 짜다보니 다른 이미지를 선택했을때 자꾸 바탕화면으로 튕기고 계속 시도하니 오류가 납니다 나머지 이미지 파일이나 레이아웃 코드는 모두 복붙했고 메인 액티비티도 코드는 강의내용 그대로 옮겨 적었습니다
안녕하세요. 이미지 세팅하고 시작 누르는데 맨 밑과 같은 에러가 나오는데요. 아래 2가지 방법을 시도해도 작동이 안되는데 혹시 어떻게 해야 하나요? } https://devshin93.tistory.com/116 참조: -> 첫 번재 해결책 : compileSdk 와 targetSdk 가 31이 아닌 경우, implementation 'androidx.appcompat:appcompat:1.3.0' > 두 번째 해결책 : compileSdk 과 targetSdk 가 31인 경우 걍 해결 됨! AAR 메타데이터를 확인하는 동안 6가지 문제가 발견되었습니다:
auth 부분에서도 import가 되지 않는 오류가 발생했는데 이전에는 방법을 찾아서 무시하고 일단 넘어갔는데 realtime database에서도 여전히 문제가 발생합니다. 다음과 같이 Firebase를 import하려고 하면 Unresolved reference:Firebase라고 뜹니다. import 선택지는 뜨지도 않고요.. 이전에 auth에서도 동일한 문제가 발생했는데 어떻게 고치고 왜 그런지 아시나요? implementation도 추가했습니다
AnnotationConfigWebApplicationContext 익명함수가 잘 만들어지시나요? 저 같은 경우에 어떤 문제인지 모르겠는데 익명함수를 만들면 setClassLoader() 메소드를 오버라이딩하라는 컴파일 에러를 만나게 됩니다. 찾아본 결과 부모 클래스인 DefaultResourceLoader 에서 해당 메소드를 이미 구현하고 있는데 왜 다시 구현하라는지 모르겠습니다. 심지어 아래와 같이 overriding 해도 에러가 발생합니다. fun main(args: Array<String>) { val applicationContext = object : AnnotationConfigWebApplicationContext() { @Override override fun onRefresh() { super.onRefresh() val tomcatWebServerFactory = TomcatServletWebServerFactory() val webServer = tomcatWebServerFactory.getWebServer({ servletContext -> servletContext.addServlet("dispatcherServlet", object : DispatcherServlet(this) { }).addMapping("/*") }) webServer.start() } @Override override fun setClassLoader(classLoader: ClassLoader) { super.setClassLoader(classLoader) } } applicationContext.apply { refresh() } } 이런 에러가 발생합니다. fun setClassLoader(classLoader: ClassLoader): Unit defined in tobyspring.helloboot.main.<no name provided> fun setClassLoader(classLoader: ClassLoader?): Unit defined in tobyspring.helloboot.main.<no name provided> 해결하신분이 계시다면 꼭 부탁 드리겠습니다..!
E/RecyclerView: No adapter attached; skipping layout E/RecyclerView: No adapter attached; skipping layout coinListFragment 에서 생성되는 오류라고 생해서 관련된 부분을 수정해보았으나 계속해서 오류가 생성되서 왜 생기는걸까? 궁금해서 질문드립니다. 오류와 관계없이 화면에 리사이클러뷰는 잘 나오기때문에 넘어가도 상관없겠다 싶지만서도 왜 저런 오류가 생기는지 궁금해서 질문 합니다. 처음에는 XML 상에서도 layoutManager 를 지정해줘야 하나 싶어서 했으나 나타났고, 다음으로는 context 관련 문제인가 싶어서 해당하는 부분을 수정하다가 오히려 더 오류가 발생하였습니다...ㅋㅋㅋ 기능에는 문제가 없기 때문에 넘어가도 괜찮지만 순수하게 궁금해서 질문합니다. 아니면 혹시, coinListFragment 쪽의 RecyclerView 가 아닌, Intro 에서 좋아하는 코인을 만들때 의 오류메시지 일까요?
Run 돌리면 자꾸 에러가 떠서 그냥 아무 코드 입력없이 새 프로젝트를 만들어 돌려도 다음과 같은 에러코드가 뜹니다. 원인이 무엇일까요?? 6 issues were found when checking AAR metadata: 1. Dependency 'androidx.appcompat:appcompat-resources:1.6.1' requires libraries and applications that depend on it to compile against version 33 or later of the Android APIs. :app is currently compiled against android-32. Recommended action: Update this project to use a newer compileSdkVersion of at least 33, for example 33. Note that updating a library or application's compileSdkVersion (which allows newer APIs to be used) can be done separately from updating targetSdkVersion (which opts the app in to new runtime behavior) and minSdkVersion (which determines which devices the app can be installed on). 2. Dependency 'androidx.appcompat:appcompat:1.6.1' requires libraries and applications that depend on it to compile against version 33 or later of the Android APIs. :app is currently compiled against android-32. Recommended action: Update this project to use a newer compileSdkVersion of at least 33, for example 33. Note that updating a library or application's compileSdkVersion (which allows newer APIs to be used) can be done separately from updating targetSdkVersion (which opts the app in to new runtime behavior) and minSdkVersion (which determines which devices the app can be installed on). 3. Dependency 'androidx.activity:activity:1.6.0' requires libraries and applications that depend on it to compile against version 33 or later of the Android APIs. :app is currently compiled against android-32. Recommended action: Update this project to use a newer compileSdkVersion of at least 33, for example 33. Note that updating a library or application's compileSdkVersion (which allows newer APIs to be used) can be done separately from updating targetSdkVersion (which opts the app in to new runtime behavior) and minSdkVersion (which determines which devices the app can be installed on). 4. Dependency 'androidx.core:core:1.9.0' requires libraries and applications that depend on it to compile against version 33 or later of the Android APIs. :app is currently compiled against android-32. Recommended action: Update this project to use a newer compileSdkVersion of at least 33, for example 33. Note that updating a library or application's compileSdkVersion (which allows newer APIs to be used) can be done separately from updating targetSdkVersion (which opts the app in to new runtime behavior) and minSdkVersion (which determines which devices the app can be installed on). 5. Dependency 'androidx.core:core-ktx:1.9.0' requires libraries and applications that depend on it to compile against version 33 or later of the Android APIs. :app is currently compiled against android-32. Recommended action: Update this project to use a newer compileSdkVersion of at least 33, for example 33. Note that updating a library or application's compileSdkVersion (which allows newer APIs to be used) can be done separately from updating targetSdkVersion (which opts the app in to new runtime behavior) and minSdkVersion (which determines which devices the app can be installed on). 6. Dependency 'androidx.annotation:annotation-experimental:1.3.0' requires libraries and applications that depend on it to compile against version 33 or later of the Android APIs. :app is currently compiled against android-32. Recommended action: Update this project to use a newer compileSdkVersion of at least 33, for example 33. Note that updating a library or application's compileSdkVersion (which allows newer APIs to be used) can be done separately from updating targetSdkVersion (which opts the app in to new runtime behavior) and minSdkVersion (which determines which devices the app can be installed on).
안녕하세요. 강의 잘듣고 있습니다. 다만, 제가 이 강의부터 시작해서 그런지 용어에 대한 개념이 헷갈립니다. util 디렉토리와 source.kt 파일의 역할은 정확히 무엇인가요? util 디렉토리에 들어가는 파일들의 내용은 무엇이고, DataSource의 역할이 무엇인지 궁금합니다 ! 감사합니다..
안녕하세요 강의 막바지를 향해 달려가고 있던 중 궁금한 점이 있습니다. SelectActivity에서 다음 MainActivity로 넘어가기 위해 onClick 이벤트를 TextView를 통해 처리하는 것을 보았습니다. 그런데 SettingActivity에서는 Button을 생성하는 것을 보고 TextView를 통해 클릭 이벤트를 처리하는 것과 Button을 통해 이벤트를 처리하는 것에 대한 차이가 있는지 궁금합니다. 혹은 개발자님만의 상황에 따른 사용 기준이 따로 있나요?? 유익한 강의 너무 잘 듣고 있습니다. 감사합니다
강사님 24강 자료 그대로 복사해서 가져온 것입니다! button.setOnClickListener { if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.P){ val builder1 = getNotificationBuilder("message", "message style") builder1.setContentTitle("Message Style") builder1.setContentText("Message Style Notification") builder1.setSmallIcon(android.R.drawable.ic_input_delete) val personBuilder1 = Person.Builder() val icon1 = IconCompat.createWithResource(this, android.R.drawable.ic_media_next) personBuilder1.setIcon(icon1) personBuilder1.setName("홍길동") val person1 = personBuilder1.build() val personBuilder2 = Person.Builder() val icon2 = IconCompat.createWithResource(this, R.mipmap.ic_launcher) personBuilder2.setIcon(icon2) personBuilder2.setName("최길동") val person2 = personBuilder2.build() val messageStyle = NotificationCompat.MessagingStyle(person1) messageStyle.addMessage("첫 번째 메시지", System.currentTimeMillis(), person1) messageStyle.addMessage("두 번째 메시지", System.currentTimeMillis(), person2) messageStyle.addMessage("셋 번째 메시지", System.currentTimeMillis(), person1) messageStyle.addMessage("네 번째 메시지", System.currentTimeMillis(), person2) builder1.setStyle(messageStyle) val notification = builder1.build() val manager = getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager manager.notify(10, notification) } } 에서 personBuilder1.setIcon(icon1) personBuilder2.setIcon(icon2) 부분에서 icon1,icon2 부분에서 Type mismatch: inferred type is IconCompat! but Icon? was expected 오류가 나오고 val messageStyle = NotificationCompat.MessagingStyle(person1) 부분에서는 None of the following functions can be called with the arguments supplied가 나옵니다 ㅠㅠ 어떤 부분이 문제인지 알 수 있을까요 ㅠㅠ
실전! 코틀린과 스프링 부트로 도서관리 애플리케이션 개발하기 (Java 프로젝트 리팩토링)
안녕하세요 코틀린강의부터 코프링까지 잘 듣고 있습니다. 바로 질문 드리자면,! 1.saveUserTest2라는 테스트케이스를 한 개 더 만들어서 모든 테스트를 진행 시킨다면, saveUserTest는 통과하지만 saveUserTest2는 DB데이터가 2개 가 있어서 통과되지 못 합니다. 이럴 때는 어떻게 해야 독립적으로 DB값을 가지게 할 수 있나요? @Transactional 쓰는 rollback된다고 얼핏 들은 거 같은데 잘 모르겠네요.. 2.실제 h2 DB에는 유저가 2명이 저장이 되어 있는데 테스트환경에서는 0명인 이유는 @SpringBootTest 어노테이션이 실제 실행환경과 완전히 독립된 환경을 만들어 주어서 그런 건가요? 감사드립니다.