묻고 답해요
156만명의 커뮤니티!! 함께 토론해봐요.
인프런 TOP Writers
-
미해결[초중급편] 안드로이드 데이팅 앱 만들기(Android Kotlin)
FCM 강의 중간부터 코드 오류가 발생했는지 앱에서 회원가입을 해도 파이어베이스 Authentication에는 회원등록이 해도 화면이 넘어가지 않고 데이터도 저장이 안 되네요.
회원가입창에서 회원가입을 한다.2. '회원가입' 버튼을 눌러도 해당화면에서 메인화면으로 넘어가지 않는다.파이어베이스 Authentication에는 회원등록은 되어 있으나, Realtime Database와 Storage에는 사진등록이 되지 않는다.회원등록 완료데이터베이스에 회원정보(닉네임, 성별, 지역 등)가 등록되어 있지 않다.스토리지에 사진도 등록되지 않아있다.현재 위와 같은 오류가 발생하네요. 어떤 부분을 확인해야할까요?
-
미해결[초급편] 안드로이드 커뮤니티 앱 만들기(Android Kotlin)
안드로이드 스튜디오 게시글 이미지 업로드 유무
게시글을 올릴때 이미지를 업로드 하지 않으면, 안드로이드 스튜디오가 꺼집니다. 혹시 이미지를 업로드 하지 않아도 게시글을 작성하려면 코드를 어떻게 수정해야하나요? package com.example.healthcareapplication.fragments import android.app.Activity.RESULT_OK import android.content.Intent import android.graphics.Bitmap import android.graphics.drawable.BitmapDrawable import android.os.Bundle import android.provider.MediaStore import androidx.fragment.app.Fragment import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import android.widget.Toast import androidx.databinding.DataBindingUtil import androidx.navigation.fragment.findNavController import com.example.healthcareapplication.DATA.ContentData import com.example.healthcareapplication.DATA.ContentModel import com.example.healthcareapplication.R import com.example.healthcareapplication.databinding.FragmentCommunityWriteBinding import com.google.firebase.auth.FirebaseAuth import com.google.firebase.ktx.Firebase import com.google.firebase.storage.ktx.storage import java.io.ByteArrayOutputStream import java.text.SimpleDateFormat import java.util.Calendar import java.util.Locale class CommunityWriteFragment : Fragment() { private lateinit var binding: FragmentCommunityWriteBinding private lateinit var auth: FirebaseAuth override fun onCreateView( inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle? ): View? { binding = DataBindingUtil.inflate(inflater, R.layout.fragment_community_write, container, false) val view = binding.root auth = FirebaseAuth.getInstance() binding.writeBtn.setOnClickListener { val title = binding.title.text.toString() val content = binding.content.text.toString() fetchContent(title, content) findNavController().navigate(R.id.action_communityWriteFragment_to_communityFragment) } binding.ImageBtn.setOnClickListener { val gallery = Intent(Intent.ACTION_PICK, MediaStore.Images.Media.INTERNAL_CONTENT_URI) startActivityForResult(gallery, 100) } return view } private fun fetchContent(title:String, content:String){ val userId = auth.currentUser?.uid ?: return val currentDateTime = Calendar.getInstance().time val dateFormat = SimpleDateFormat("yyyy.MM.dd HH:mm:ss", Locale.KOREA).format(currentDateTime) val key = ContentData.boardRef.push().key.toString() ContentData.boardRef .child(key) .setValue(ContentModel(title, content, userId, dateFormat)) Toast.makeText(requireContext(), "게시글 업로드 성공!", Toast.LENGTH_SHORT).show() ImageUpload(key) } private fun ImageUpload(key:String){ val storage = Firebase.storage val storageRef = storage.reference val mountainsRef = storageRef.child(key + ".png") val imageView = binding.imageArea // Get the data from an ImageView as bytes imageView.isDrawingCacheEnabled = true imageView.buildDrawingCache() val bitmap = (imageView.drawable as BitmapDrawable).bitmap val baos = ByteArrayOutputStream() bitmap.compress(Bitmap.CompressFormat.JPEG, 100, baos) val data = baos.toByteArray() var uploadTask = mountainsRef.putBytes(data) uploadTask.addOnFailureListener { // Handle unsuccessful uploads }.addOnSuccessListener { taskSnapshot -> // taskSnapshot.metadata contains file metadata such as size, content-type, etc. // ... } } override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { super.onActivityResult(requestCode, resultCode, data) if(resultCode == RESULT_OK && requestCode == 100){ val selectedImageUri = data?.data selectedImageUri?.let { uri -> binding.imageArea.setImageURI(uri) val layoutParams = binding.imageArea.layoutParams layoutParams.width = 300 // 원하는 너비 설정 layoutParams.height = 300 // 원하는 높이 설정 binding.imageArea.layoutParams = layoutParams } } } }
-
미해결2시간으로 끝내는 코루틴
자식1, 2와 부모코루틴의 관계
본 강의를 모두 수강하였습니다! 코루틴에서 헷갈렸던 개념들을 알 수 있어서 좋았습니다!본 코루틴 강의에서 자식과 부모 관계의 에러가 발생했을 때 에러 핸들링 하는 경우는 자식이 하나만 존재했을 때의 예시밖에 없어서 직접 2개를 가지고 실험을 해보았습니다! 먼저, 자식1이 취소가 됐을 때에는 취소예외가 발생했기 때문에 부모로 전파되지 않고, 그러므로 다른 자식2도 영향을 받지 않는다 라고 이해를 하고 있습니다!하지만 자식1에서 취소가 아닌 예외가 발생했을 경우 부모로 전파되는 것으로 알고있고, 이 때 적절한 조치가 되지 않는다면 자식2까지 취소되는 것으로 알고있습니다!따라서 다음과 같이 CoroutineExceptionHandler를 적용해보았습니다.fun main() = runBlocking { val handler = CoroutineExceptionHandler { _, exception -> println("Caught exception: $exception") } val parentJob = CoroutineScope(Dispatchers.Default).launch(handler) { val job1 = launch { println("Job 1 is running") throw RuntimeException("Error in Job 1") } val job2 = launch { println("Job 2 is running") delay(1000) println("Job 2 is completed") } job1.join() job2.join() } parentJob.join() println("Parent job is completed") }Job 1 is runningCaught exception: java.lang.RuntimeException: Error in Job 1Parent job is completed결과는 자식1만 실행이되고, 거기서 Exception을 던졌는데, Job2는 취소되는것으로 보입니다..!질문 1 ) 다음과 같이 try catch 로 전환하면 자식2의 취소가 발생하지 않는데, CoroutineExceptionHandler로는 자식2의 취소를 막을수는 없는 것일까요?val job1 = launch { println("Job 1 is running") try { throw RuntimeException("Error in Job 1") } catch (e: RuntimeException) { println("RuntimeException") } }질문 2) 강의내용에서는 SupervisorJob() 을 사용하면 부모 코루틴으로 예외가 전파되지 않는다고 해주셨는데, 다음 결과에서는 부모코루틴에 해당되는 CoroutineExceptionHandler 가 실행되는 것으로 보입니다. 하지만, 질문1에서 걱정하는 자식2의 취소로 이어지지 않고 있습니다. 이는 부모코루틴으로 예외가 전파되는 상황일까요?? 만일 전파되는 상황이라면 왜 질문1과는 다르게 자식2의 취소로 이어지지 않는 것일까요?fun main() = runBlocking { val handler = CoroutineExceptionHandler { _, exception -> println("Caught exception: $exception") } val parentJob = CoroutineScope(Dispatchers.Default).launch(handler) { val job1 = launch(SupervisorJob()) { println("Job 1 is running") throw RuntimeException("Error in Job 1") } val job2 = launch { println("Job 2 is running") delay(1000) println("Job 2 is completed") } job1.join() job2.join() } parentJob.join() println("Parent job is completed") }Job 1 is runningJob 2 is runningCaught exception: java.lang.RuntimeException: Error in Job 1Job 2 is completedParent job is completed자바 -> 코틀린 강의부터 시작해서 코루틴 강의까지 너무 감사하게 잘 보고있습니다! 감사드립니다 🙂
-
미해결[왕초보편] 앱 8개를 만들면서 배우는 안드로이드 코틀린(Android Kotlin)
10 issues were found when checking AAR metadata:
파이어베이스 북마크 만들기 하면서 나오는 에러입니다.1. Dependency 'androidx.credentials:credentials:1.2.0-rc01' requires libraries and applications that depend on it to compile against version 34 or later of the Android APIs. :app is currently compiled against android-33. Also, the maximum recommended compile SDK version for Android Gradle plugin 8.0.0 is 33. Recommended action: Update this project's version of the Android Gradle plugin to one that supports 34, then update this project to use compileSdk of at least 34. Note that updating a library or application's compileSdk (which allows newer APIs to be used) can be done separately from updating targetSdk (which opts the app in to new runtime behavior) and minSdk (which determines which devices the app can be installed on). 2. Dependency 'androidx.credentials:credentials-play-services-auth:1.2.0-rc01' requires libraries and applications that depend on it to compile against version 34 or later of the Android APIs. :app is currently compiled against android-33. Also, the maximum recommended compile SDK version for Android Gradle plugin 8.0.0 is 33. Recommended action: Update this project's version of the Android Gradle plugin to one that supports 34, then update this project to use compileSdk of at least 34. Note that updating a library or application's compileSdk (which allows newer APIs to be used) can be done separately from updating targetSdk (which opts the app in to new runtime behavior) and minSdk (which determines which devices the app can be installed on). 3. Dependency 'androidx.navigation:navigation-common:2.7.5' requires libraries and applications that depend on it to compile against version 34 or later of the Android APIs. :app is currently compiled against android-33. Also, the maximum recommended compile SDK version for Android Gradle plugin 8.0.0 is 33. Recommended action: Update this project's version of the Android Gradle plugin to one that supports 34, then update this project to use compileSdk of at least 34. Note that updating a library or application's compileSdk (which allows newer APIs to be used) can be done separately from updating targetSdk (which opts the app in to new runtime behavior) and minSdk (which determines which devices the app can be installed on). 4. Dependency 'androidx.navigation:navigation-common-ktx:2.7.5' requires libraries and applications that depend on it to compile against version 34 or later of the Android APIs. :app is currently compiled against android-33. Also, the maximum recommended compile SDK version for Android Gradle plugin 8.0.0 is 33. Recommended action: Update this project's version of the Android Gradle plugin to one that supports 34, then update this project to use compileSdk of at least 34. Note that updating a library or application's compileSdk (which allows newer APIs to be used) can be done separately from updating targetSdk (which opts the app in to new runtime behavior) and minSdk (which determines which devices the app can be installed on). 5. Dependency 'androidx.navigation:navigation-runtime:2.7.5' requires libraries and applications that depend on it to compile against version 34 or later of the Android APIs. :app is currently compiled against android-33. Also, the maximum recommended compile SDK version for Android Gradle plugin 8.0.0 is 33. Recommended action: Update this project's version of the Android Gradle plugin to one that supports 34, then update this project to use compileSdk of at least 34. Note that updating a library or application's compileSdk (which allows newer APIs to be used) can be done separately from updating targetSdk (which opts the app in to new runtime behavior) and minSdk (which determines which devices the app can be installed on). 6. Dependency 'androidx.navigation:navigation-ui:2.7.5' requires libraries and applications that depend on it to compile against version 34 or later of the Android APIs. :app is currently compiled against android-33. Also, the maximum recommended compile SDK version for Android Gradle plugin 8.0.0 is 33. Recommended action: Update this project's version of the Android Gradle plugin to one that supports 34, then update this project to use compileSdk of at least 34. Note that updating a library or application's compileSdk (which allows newer APIs to be used) can be done separately from updating targetSdk (which opts the app in to new runtime behavior) and minSdk (which determines which devices the app can be installed on). 7. Dependency 'androidx.navigation:navigation-runtime-ktx:2.7.5' requires libraries and applications that depend on it to compile against version 34 or later of the Android APIs. :app is currently compiled against android-33. Also, the maximum recommended compile SDK version for Android Gradle plugin 8.0.0 is 33. Recommended action: Update this project's version of the Android Gradle plugin to one that supports 34, then update this project to use compileSdk of at least 34. Note that updating a library or application's compileSdk (which allows newer APIs to be used) can be done separately from updating targetSdk (which opts the app in to new runtime behavior) and minSdk (which determines which devices the app can be installed on). 8. Dependency 'androidx.navigation:navigation-ui-ktx:2.7.5' requires libraries and applications that depend on it to compile against version 34 or later of the Android APIs. :app is currently compiled against android-33. Also, the maximum recommended compile SDK version for Android Gradle plugin 8.0.0 is 33. Recommended action: Update this project's version of the Android Gradle plugin to one that supports 34, then update this project to use compileSdk of at least 34. Note that updating a library or application's compileSdk (which allows newer APIs to be used) can be done separately from updating targetSdk (which opts the app in to new runtime behavior) and minSdk (which determines which devices the app can be installed on). 9. Dependency 'androidx.navigation:navigation-fragment-ktx:2.7.5' requires libraries and applications that depend on it to compile against version 34 or later of the Android APIs. :app is currently compiled against android-33. Also, the maximum recommended compile SDK version for Android Gradle plugin 8.0.0 is 33. Recommended action: Update this project's version of the Android Gradle plugin to one that supports 34, then update this project to use compileSdk of at least 34. Note that updating a library or application's compileSdk (which allows newer APIs to be used) can be done separately from updating targetSdk (which opts the app in to new runtime behavior) and minSdk (which determines which devices the app can be installed on). 10. Dependency 'androidx.navigation:navigation-fragment:2.7.5' requires libraries and applications that depend on it to compile against version 34 or later of the Android APIs. :app is currently compiled against android-33. Also, the maximum recommended compile SDK version for Android Gradle plugin 8.0.0 is 33. Recommended action: Update this project's version of the Android Gradle plugin to one that supports 34, then update this project to use compileSdk of at least 34. Note that updating a library or application's compileSdk (which allows newer APIs to be used) can be done separately from updating targetSdk (which opts the app in to new runtime behavior) and minSdk (which determines which devices the app can be installed on). 대체 어떤 부분을 봐야 할까요...
-
미해결[초중급편] 안드로이드 데이팅 앱 만들기(Android Kotlin)
섹션 1 CardStackView의 Implement members 질문있습니다.
7:16Implement members를 하려고 하는데 어떻게 해야되나요? 여담으로 아직 섹션 1 끝내지도 않았는데 옛날 버전이라 그런지 진도 나가기가 너무 힘들어요... 강의 최신 버전으로 업데이트는 안되나요? 프로젝트 생성부터 Gradle 추가까지 지금 7분밖에 못 들었는데 두시간을 넘게 찾고있는거 같습니다.
-
해결됨입문자를 위한 Spring Boot with Kotlin - 나만의 포트폴리오 사이트 만들기
소스코드 컴파일 오류
컴파일시 오류가 발생합니다.포트가 사용되고 있다고 하면서 웹서버 구동이 안되는데 포트를 바꿔봐도 오류가 발생합니다.깃허브에서 소스코드는 받았습니다.해결방법 좀 부탁드립니다. AI 답변이 달렸길래 추가 내용을 적습니다. 포트도 변경해봤고, 사용중인 포트가 없는것도 확인했습니다. 오류 코드는 다음과 같습니다.***************************APPLICATION FAILED TO START***************************Description:Web server failed to start. Port 8080 was already in use.Action:Identify and stop the process that's listening on port 8080 or configure this application to listen on another port.Process finished with exit code 1
-
미해결[초중급편] 안드로이드 데이팅 앱 만들기(Android Kotlin)
수업자료 다운로드 후 알집풀기에서 오류가 발생합니다.
윈도우 사용중이고, 위와 같이 오류가 납니다.파일이 없는 것 같아요.
-
미해결[왕초보편] 앱 8개를 만들면서 배우는 안드로이드 코틀린(Android Kotlin)
Glide gradle implementation 관련 질문
안녕하세요.Glide를 사용하려다 gradle 문법이 달라서 질문 드립니다. 제가 쓰는 안드로이드 스튜디오는 Iguana 2023.2.1 입니다저의 소스는 implementation(libs....) 이런 식인데,가이드는 implementation 'com.github.bumptech.glide:glide:4.16.0'이렇습니다.어떻게 하면 될까요?관련 내용을 알려면 어떻게 어디를 찾아 보면 될까요?
-
미해결실전! 코틀린과 스프링 부트로 도서관리 애플리케이션 개발하기 (Java 프로젝트 리팩토링)
intelliJ 최신버전과 kotlin 1.6버전 충돌. 빌드 오류
안녕하세요! 혹시 사용하고 계시는 intelliJ의 버전 알수 있을까요? 저는 최신버전 2024.1을 사용중이었는데요 해당 버전으로 강사님의 build.gradle 스펙과 동일하게 하여 빌드를 하니Downloading kotlinc-dist?라는 말이 뜨면서 무한 로딩이 걸리며 빌드가 5분이 지나도 끝나지 않습니다 ㅜㅜ 테스트도 실행이 안되구요kotlin버전 1.6이 최신 intelliJ 버전에서 지원하지 않는다는?? 답변을 보고 kotlin을 1.7버전으로 업그레이드 해봐도 되지 않았고, 사용중인 intelliJ 버전을 2023.1 로 다운그레이드 하여 실행하니 정상적으로 동작하긴 합니다... IDE 버전에 따라 언어 버전 호환성 문제가 있는거 같습니다 ㅜㅜ 참고로 최신 intelliJ를 사용했을땐 "org.jetbrains.kotlin.plugin.jpa" 플러그인슬 설치하지 않아도 12강에 말씀하신것 처럼 Book.kt 에서 오류가 나지 않았습니다! 2023.1로 다운그레이드 하니 오류가 나네요 ㅎㅎ
-
해결됨입문자를 위한 Spring Boot with Kotlin - 나만의 포트폴리오 사이트 만들기
@Component
안녕하세요 또 이렇게 질문을 드리네요공통 개발 - 인터셉터에서 AdminInterceptor은 @Component을 사용합니다. 제가 자료를 찾아봤는데 개념 이해가 어렵더라구요개발자가 직접 작성한 class를 Bean으로 등록하기 위한 어노테이션이라고 정의 되어 있던데 그럼 Bean은 또 뭔지 찾아봤어요자바 객체를 스프링에서는 Bean이라고 한다. 라고 정의 되었더라구요. 객체는 뭐 재료를 합쳐서 사용자가 사용할 수 있겠끔 만들어진 거가 객체인건 알고 있고 ....다시 정리하면 직접 작성한 class를 객체화 시키려는건가라고 좀 애매하게 이해했는데 이건 또 아닌거 같고.. 예제를 본다면 class InlineExamConsole{ @Autowired public void setExam(Exam exam) { this.exam = exam; }}이 클레스면 xml은<context:annotation-config/><bean id = "exam" class="entity.NewlecExam" /><bean id = "console" class="ui.InlineExamConsole"></bean>로 되어야 하고...IoC 컨테이너의 상황은exam: Exam<---- console:InlineExamCode처럼 플로우가 될꺼구...그런데 <context:annotation-config/><bean id = "exam" class="entity.NewlecExam" /><!-- <bean id = "console" class="ui.InlineExamConsole"> </bean>->를 해서 삭제.... bean을 삭제 하면 IoC 컨테이너의 상황은 아래처럼 될듯 한데 exam: Exam<---- console:InlineExamCodeconsole는 또 사용해야겠으니 아래처럼 @Componet를 등장시키고, @Componetclass InlineExamConsole{ @Autowired public void setExam(Exam exam) { this.exam = exam; }}IoC 컨테이너에서 console:InlineExamCode를 부활exam: Exam<---- console:InlineExamCode그런데 부활만 했지 그냥 좀비 상태가 되어 버린 console:InlineExamCode... console:InlineExamCode은 어떻게 찾는건지..그럼 xml를 변경<context:component-scan base-package = "spring.di.ui"/><context:annotation-config/><bean id = "exam" class="entity.NewlecExam" />위 테그로 spring.di.ui에 컴포넌트가 있으니 다른곳에 찾지 말고 위 테그에서 컴포넌트 찾고 그 컴포넌트를 Bean에 등록해서 객채화 해~~~ 라는거같은데 코드상으로는 이렇게 이해를 했어요하지만 강의에서는 context:component-scan base-package 를 못본거 같은데 ....(뭐 제가 바빠서 꼼꼼하게 못본것일 수도 있고 ) 저 컴포넌트의 이해를 좀 도와주시면 안될까요??컴포넌트 활용이나 @Component를 사용안하면 얼마나 불편해지길래 저 이노테이션을 사용한건지 ...(사실 저 이노테이션을 안써도 잘 활용할 수 있을거 같은데 ...)
-
해결됨입문자를 위한 Spring Boot with Kotlin - 나만의 포트폴리오 사이트 만들기
[실습]Thymeleaf- 부트스트랩 템플릿 - 자료가 달라요 ...
안녕하세요 틈틈히 공부 하고 있는데 여기까지 왔네요..이해를 못하는 부분이 좀있어서 첨 부터 다시 보고 여기 까지 왔는데 모르는부분은 인터넷에서 확인하고 알아갔는데 강의 내용에서 알려주신 자료와 강의 하신 자료가 다른거 같아서 이렇게 글 남기네요 Personal - Free Bootstrap Template - Start Bootstrap에서 받은 자료을 받아서 압축 풀면 ======================================== 위처럼 나타납니다. 강의 내용에서 자료를 받은 내용은 이렇더라구요=============================제자료는 강사님의 자료 처럼 Vendor이 없어요...강의 노트를 확인하면 [링크에서 템플릿 파일 다운로드 후 압축을 해제하고, 파일과 폴더를 각각 아래 경로에 추가합니다. 디렉토리가 없다면 만듭니다]라고 적혀 있어서 위 처럼 폴더를 만들긴 했지만 vendor폴더가 없어요 강사님의 git에 있는 벤드를 가져와서 붙여도 되나요?? 그러면 강의 내용을 앞서 가는거 같아서 하다가 말았어요...Vendor 폴더 그냥 폴더만 만들고 계속 강의 들어도 되나요?
-
해결됨실전! 코틀린과 스프링 부트로 도서관리 애플리케이션 개발하기 (Java 프로젝트 리팩토링)
Open 키워드를 사용해야 하는 이유
안녕하세요 강사님 덕분에 편히 배우고 있습니다.다름이 아니라 이번 강의 초반에 @Transactional 어노테이션을 사용할 시 open 키워드를 클래스와 매서드에 다 사용해주어야 하고, 만약 이게 싫다면 플러그인을 적용해야 한다고 말씀하셨는데요,찾아보니 코틀린에서는 기본적으로 모든 클래스가 최종 클래스고, 그렇기 때문에 상속이 되지 않아 open 키워드를 사용해 상속 가능성을 열어두어야 한다는 것 같더라구요.그런데 왜 이게 @Transactional 어노테이션을 사용할 때도 해당되는 내용인지 잘 모르겠습니다. 프록시 객체가 생성되기 때문인 걸까요?제가 코틀린 기본 강의를 들었음에도 잘 기억이 나질 않아 질문드립니다. 항상 감사드립니다.
-
해결됨
spring에서 Entity작성 후 [Table ' ' doesn't exist] 오류
영화 예매 관련 Entity를 작성 후 DB확인차 실행했는데 다른 Entity는 테이블이 잘 만들어진 것을 확인할 수 있었지만 이상하게 Seat Entity만 테이블이 만들어지지 않았습니다. WARN 3508 --- [Movie Ticketing] [ restartedMain] o.m.jdbc.message.server.ErrorPacket : Error: 1146-42S02: Table 'ticketing.seat' doesn't exist WARN 3508 --- [Movie Ticketing] [ restartedMain] o.h.t.s.i.ExceptionHandlerLoggedImpl : GenerationTarget encountered exception accepting command : Error executing DDL " alter table seat add constraint FKgik5885qsff01sxe7v3kqjrhx foreign key (theater_id) references theater (theater_id)" via JDBC [(conn=216) Table 'ticketing.seat' doesn't exist] org.hibernate.tool.schema.spi.CommandAcceptanceException: Error executing DDL " alter table seat add constraint FKgik5885qsff01sxe7v3kqjrhx foreign key (theater_id) references theater (theater_id)" via JDBC [(conn=216) Table 'ticketing.seat' doesn't exist]at org.hibernate.tool.schema.internal.exec.GenerationTargetToDatabase.accept(GenerationTargetToDatabase.java:94) ~[hibernate-core-6.4.4.Final.jar:6.4.4.Final] at org.hibernate.tool.schema.internal.Helper.applySqlString(Helper.java:233) ~[hibernate-core-6.4.4.Final.jar:6.4.4.Final] at org.hibernate.tool.schema.internal.Helper.applySqlStrings(Helper.java:217) ~[hibernate-core-6.4.4.Final.jar:6.4.4.Final] at org.hibernate.tool.schema.internal.SchemaCreatorImpl.createForeignKeys(SchemaCreatorImpl.java:303) ~[hibernate-core-6.4.4.Final.jar:6.4.4.Final] at org.hibernate.tool.schema.internal.SchemaCreatorImpl.createFromMetadata(SchemaCreatorImpl.java:250) ~[hibernate-core-6.4.4.Final.jar:6.4.4.Final] at org.hibernate.tool.schema.internal.SchemaCreatorImpl.performCreation(SchemaCreatorImpl.java:172) ~[hibernate-core-6.4.4.Final.jar:6.4.4.Final] at org.hibernate.tool.schema.internal.SchemaCreatorImpl.doCreation(SchemaCreatorImpl.java:142) ~[hibernate-core-6.4.4.Final.jar:6.4.4.Final] at org.hibernate.tool.schema.internal.SchemaCreatorImpl.doCreation(SchemaCreatorImpl.java:118) ~[hibernate-core-6.4.4.Final.jar:6.4.4.Final] at org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.performDatabaseAction(SchemaManagementToolCoordinator.java:256) ~[hibernate-core-6.4.4.Final.jar:6.4.4.Final] at org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.lambda$process$5(SchemaManagementToolCoordinator.java:145) ~[hibernate-core-6.4.4.Final.jar:6.4.4.Final]application.yml은ddl-auto.create입니다. 대소문자 구분이 문제인가 싶어 @Table(name = "seat")도 추가하고 lower_case_table_names = 1인 것도 확인했는데 똑같이 에러가 발생하더라구요하루종일 찾아봐도 이유를 잘 모르겠습니다 왜그런걸까요 ㅠㅠㅠSeat Entity 코드는 아래와 같습니다.@Entity @Table(name = "seat") class Seat { val row : String? = null val column : Int? = null //좌석 선택 @Enumerated(EnumType.STRING) val selectStatus : SelectStatus? = null // POSSIBLE, IMPOSSIBLE @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "theater_id") val theater : Theater? = null @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name = "seat_id") val id : Long = 0L }
-
해결됨입문자를 위한 Spring Boot with Kotlin - 나만의 포트폴리오 사이트 만들기
실습리포지토리 테스트 코드 작성 강의 오류
안녕하세요 또 이렇게 질문하게 되네요 먼저 코드는 틀린거 없이 Git 내용과 강의 내용코드 그대로 작성하였습니다. 하지만 왜 일까요?? 에러가 나네요 이부분이 에러 납니다. al experience = experienceRepository.findAll()======================@Test fun testFindAll() { println("---- findAll 테스트 시작 ----") val experience = experienceRepository.findAll() assertThat(experience).hasSize(DATA_SIZE) println("experiences.size: ${experience.size}") for (experience in experience) { assertThat(experience.details).hasSize(experience.title.toInt()) println("experience.details.size: ${experience.details.size}") } println("---- findAll 테스트 종료 ----") }==================================== 이부분도요 findAllByIsActive(true) @Test fun testFindAllByIsActive() { println("----- findAllByIsActive 테스트 시작 -----") val experiences = experienceRepository.findAllByIsActive(true) assertThat(experiences).hasSize(DATA_SIZE) println("experiences.size: ${experiences.size}") for (experience in experiences) { assertThat(experience.details).hasSize(experience.title.toInt()) println("experience.details.size: ${experience.details.size}") } println("----- findAllByIsActive 테스트 종료 -----") } 에러 코드는 기니깐 핵심 부분만 올려 드리면 Hibernate: select e1_0.experience_id,e1_0.created_date_time,e1_0.description,d1_0.experience_id,d1_0.experience_detail_id,d1_0.content,d1_0.created_date_time,d1_0.is_active,d1_0.update_date_time,e1_0.end_month,e1_0.end_year,e1_0.is_active,e1_0.start_month,e1_0.start_year,e1_0.title,e1_0.update_date_time from experience e1_0 left join experience_detail d1_0 on e1_0.experience_id=d1_0.experience_id where e1_0.is_active=?org.springframework.orm.jpa.JpaSystemException: No default constructor for entity 'com.justkim.portfolio.domain.entity.ExperienceDetail' at org.springframework.orm.jpa.vendor.HibernateJpaDialect.convertHibernateAccessException(HibernateJpaDialect.java:341) 이이쿠 한줄만 적는데도 기네요 ExperienceDetail.kt 코드는@Entity class ExperienceDetail(content: String, isActive: Boolean) : BaseEntity() { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name = "experience_detail_id") var id:Long? = null var content: String = content var isActive: Boolean = isActive fun update(content: String, isActive: Boolean) { this.content = content this.isActive = isActive } }이런데 ExperienceDetail( 가 계속 경고를 때리네요Class 'ExperienceDetail' should have [public, protected] no-arg constructor https://github.com/justkjy/portfolio-justkim 깃 주소입니다 구글에서 위 에러를 검색하니깐 인프런 오류 질문이 올라 와 있던데 봐도 모르겠네요 https://www.inflearn.com/questions/931371/test-%EC%98%A4%EB%A5%98 감사합니다.
-
미해결코틀린 고급편
Sequence vs Stream
안녕하세요 Sequence와 Stream의 차이점에 대해서 질문드립니다.Sequence가 지연연산의 이점을 통해서 대용량 처리를 해야할 때 이점을 줄 수 있다고 이해를 했고,Java의Stream과 유사하다는 생각이 들었습니다. 찾아보니, java8 이전의 Kotlin의 경우 Stream을 사용할 수 없으니, Sequence를 사용했었다 라는 글을 발견했습니다.위 설명이 맞을까요?혹시 맞다면 어떠한 기준으로 둘중에서 선택을 하는게 좋을까요?
-
미해결[2023 코틀린 강의 무료제공] 기초에서 수익 창출까지, 안드로이드 프로그래밍 A-Z
안드로이드 스튜디오 스크래치 파일
import kotlin.system.exitProcess val mutableMap = mutableMapOf("name" to "Joyce", "age" to 100, "height" to 180) println(mutableMap) mutableMap.put("hobby", "coding") 코드마지막 "coding" 부분에 빨간줄 쳐지면서 Type mismatch: inferred type is String but Nothing was expected 라고 합니다 똑같이 했는데 왜안될까요
-
미해결[입문편] 안드로이드를 위한 코틀린(Kotlin) 문법
인터페이스에 대한 질문입니다
인터페이스가 이해가 잘 되지않습니다 추상클래스를 이용해서도 상속을 하는데 왜 더 작게 상속을 해야하나요? 아니면 여러개 상속할 것을 인터페이스를 이용하여 하나로 묶어 다중상속 하는건가요? 일반적으로 추상클래스를 이용하거나 open을 이용해도 상속이 되는데 꼭 interface를 사용해야하나요??
-
미해결[초급편] 안드로이드 커뮤니티 앱 만들기(Android Kotlin)
xml 파일 디자인 부분
안녕하세요 선생님섹션 4 - 팁 페이지 만들기 - 첫번째 강의(레이아웃 설정 및 아이콘 넣기)를 수강중입니다.제가 중간에 어디 부분을 놓쳐서 이해를 못하고 있는지 잘 모르겠습니다. 4:04 부분에 보이는 꿀팁화면(fragment_tip.xml) 디자인 (안드로이드 스튜디오 우측 그림)에는 상단에 내용 부분(사진 3개)만 있고 지붕 디자인이 없는데애뮬레이터를 실행하는 부분(4:17) 에서는 지붕 디자인(자취생으로 살아남기 글자랑 그림, 우측에 막대기 3개 표시)이 나오는데 윗부분 디자인은 어디서 가지고 오는 건가요?main xml에서 지붕부분을 만든 것은 알겠는데 꿀팁 tip xml 에서는 지붕에 대한 코드가 없습니다 코드상으로는 지붕에 대한 코드가 없는데 애뮬레이터를 실행하면 지붕이 나오게 되는데 왜 그런 것인지 모르겠습니다.아래는 애뮬레이터 실행한 부분입니다.
-
미해결
참고할 프로젝트 찾는 방법(kotlin, spring)
안녕하세요!go언어를 하다가 현재 kotlin, spring 을 공부하는 중입니다좋은 프로젝트 샘플을 보면서 어떤 구조로 어떻게 구현되어 있는지전체적인 코드를 보고싶은데,다들 샘플 프로젝트는 어떻게 찾으시나요?기본 CRUD프로젝트라도 좋아요 Github에서 검색해서 찾으시는지, 오픈소스를 찾아보시는지 궁금합니다꿀팁 알려주세요!혹시 괜찮은 코프링 프로젝트를 아신다면 알려주시면 더 감사하겠습니다!
-
미해결[왕초보편] 앱 8개를 만들면서 배우는 안드로이드 코틀린(Android Kotlin)
에뮬레이터 실행 에러
안녕하세요. 강의를 듣다가 에뮬레이터를 실행하려는데 실행이 되지 않습니다.해결방안을 찾아보다 SDK Tools를 보는데 필수 도구들 중에 intel x86 Emulator (HAXM installer)가 없는 것을 알게 되었습니다. 이게 없어서 에뮬레이터 실행이 안 되는 것일까요? 해결방안을 아무리 찾아도 모르겠습니다...위의 사진이 계속해서 뜨는 에러입니다. 기존에 이미 있는 에뮬레이터 말고 다른 것을 실행시켜도 같은 에러가 뜹니다.