추상클래스 강의에서 클래스 생성 시 open class Car{ open fun wheel(){ println("굴러갑니다.") } open fun engine(){ println("시동이 켜집니다.") } } Car 클래스는 옆에 () 괄호가 없고 Bike 클래스는 괄호가 있습니다. Bike 클래스에서도 괄호를 빼고 실행 시켰는데 잘 출력이 됐습니다. 괄호가 있는 것과 없는 것의 차이는 무엇인가요?
C:\Users\user\Food-Delivery-App>npm run android > FoodDeliveryApp@0.0.1 android > react-native run-android info Starting JS server... info Installing the app... Starting a Gradle Daemon, 1 incompatible and 1 stopped Daemons could not be reused, use --status for details > Configure project :app Reading env from: .env 5 actionable tasks: 2 executed, 3 up-to-date FAILURE: Build completed with 2 failures. 1: Task failed with an exception. ----------- * Where: Build file 'C:\Users\user\Food-Delivery-App\android\app\build.gradle' line: 10 * What went wrong: A problem occurred evaluating project ':app'. > Could not find method react() for arguments [build_5l1ot47ojj8km5ma6mc1eopey$_run_closure1@4d477756] on project ':app' of type org.gradle.api.Project. * Try: > Run with --stacktrace option to get the stack trace. > Run with --info or --debug option to get more log output. > Run with --scan to get full insights. ============================================================================== 2: Task failed with an exception. ----------- * What went wrong: A problem occurred configuring project ':app'. > compileSdkVersion is not specified. Please add it to build.gradle * Try: > Run with --stacktrace option to get the stack trace. > Run with --info or --debug option to get more log output. > Run with --scan to get full insights. ============================================================================== * Get more help at https://help.gradle.org BUILD FAILED in 1m 15s error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup. Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081 FAILURE: Build completed with 2 failures. 1: Task failed with an exception. ----------- * Where: Build file 'C:\Users\user\Food-Delivery-App\android\app\build.gradle' line: 10 * What went wrong: A problem occurred evaluating project ':app'. > Could not find method react() for arguments [build_5l1ot47ojj8km5ma6mc1eopey$_run_closure1@4d477756] on project ':app' of type org.gradle.api.Project. * Try: > Run with --stacktrace option to get the stack trace. > Run with --info or --debug option to get more log output. > Run with --scan to get full insights. ============================================================================== 2: Task failed with an exception. ----------- * What went wrong: A problem occurred configuring project ':app'. > compileSdkVersion is not specified. Please add it to build.gradle * Try: > Run with --stacktrace option to get the stack trace. > Run with --info or --debug option to get more log output. > Run with --scan to get full insights. ============================================================================== * Get more help at https://help.gradle.org BUILD FAILED in 1m 15s at makeError (C:\Users\user\Food-Delivery-App\node_modules\execa\index.js:174:9) at C:\Users\user\Food-Delivery-App\node_modules\execa\index.js:278:16 at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async runOnAllDevices (C:\Users\user\Food-Delivery-App\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:85:5) at async Command.handleAction (C:\Users\user\Food-Delivery-App\node_modules\@react-native-community\cli\build\index.js:108:9) info Run CLI with --verbose flag for more details. 에러코드입니다 android/app/build.gradle apply plugin: "com.android.application" apply from: project(':react-native-config').projectDir.getPath() + "/dotenv.gradle" import com.android.build.OutputFile /** * This is the configuration block to customize your React Native Android app. * By default you don't need to apply any configuration, just uncomment the lines you need. */ react { /* Folders */ // The root of your project, i.e. where "package.json" lives. Default is '..' // root = file("../") // The folder where the react-native NPM package is. Default is ../node_modules/react-native // reactNativeDir = file("../node-modules/react-native") // The folder where the react-native Codegen package is. Default is ../node_modules/react-native-codegen // codegenDir = file("../node-modules/react-native-codegen") // The cli.js file which is the React Native CLI entrypoint. Default is ../node_modules/react-native/cli.js // cliFile = file("../node_modules/react-native/cli.js") /* Variants */ // The list of variants to that are debuggable. For those we're going to // skip the bundling of the JS bundle and the assets. By default is just 'debug'. // If you add flavors like lite, prod, etc. you'll have to list your debuggableVariants. // debuggableVariants = ["liteDebug", "prodDebug"] /* Bundling */ // A list containing the node command and its flags. Default is just 'node'. // nodeExecutableAndArgs = ["node"] // // The command to run when bundling. By default is 'bundle' // bundleCommand = "ram-bundle" // // The path to the CLI configuration file. Default is empty. // bundleConfig = file(../rn-cli.config.js) // // The name of the generated asset file containing your JS bundle // bundleAssetName = "MyApplication.android.bundle" // // The entry file for bundle generation. Default is 'index.android.js' or 'index.js' // entryFile = file("../js/MyApplication.android.js") // // A list of extra flags to pass to the 'bundle' commands. // See https://github.com/react-native-community/cli/blob/main/docs/commands.md#bundle // extraPackagerArgs = [] /* Hermes Commands */ // The hermes compiler command to run. By default it is 'hermesc' // hermesCommand = "$rootDir/my-custom-hermesc/bin/hermesc" // // The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map" // hermesFlags = ["-O", "-output-source-map"] } /** * Set this to true to create four separate APKs instead of one, * one for each native architecture. This is useful if you don't * use App Bundles (https://developer.android.com/guide/app-bundle/) * and want to have separate APKs to upload to the Play Store. */ def enableSeparateBuildPerCPUArchitecture = false /** * Set this to true to Run Proguard on Release builds to minify the Java bytecode. */ def enableProguardInReleaseBuilds = false /** * The preferred build flavor of JavaScriptCore (JSC) * * For example, to use the international variant, you can use: * `def jscFlavor = 'org.webkit:android-jsc-intl:+'` * * The international variant includes ICU i18n library and necessary data * allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that * give correct results when using with locales other than en-US. Note that * this variant is about 6MiB larger per architecture than default. */ def jscFlavor = 'org.webkit:android-jsc:+' /** * Private function to get the list of Native Architectures you want to build. * This reads the value from reactNativeArchitectures in your gradle.properties * file and works together with the --active-arch-only flag of react-native run-android. */ def reactNativeArchitectures() { def value = project.getProperties().get("reactNativeArchitectures") return value ? value.split(",") : ["armeabi-v7a", "x86", "x86_64", "arm64-v8a"] } android { ndkVersion rootProject.ext.ndkVersion compileSdkVersion rootProject.ext.compileSdkVersion namespace "com.fooddeliveryapp" defaultConfig { applicationId "com.fooddeliveryapp" minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion versionCode 1 versionName "1.0" resValue "string", "build_config_package", "com.fooddeliveryapp" } splits { abi { reset() enable enableSeparateBuildPerCPUArchitecture universalApk false // If true, also generate a universal APK include (*reactNativeArchitectures()) } } signingConfigs { debug { storeFile file('debug.keystore') storePassword 'android' keyAlias 'androiddebugkey' keyPassword 'android' } } buildTypes { debug { signingConfig signingConfigs.debug } release { // Caution! In production, you need to generate your own keystore file. // see https://reactnative.dev/docs/signed-apk-android. signingConfig signingConfigs.debug minifyEnabled enableProguardInReleaseBuilds proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" } } // applicationVariants are e.g. debug, release applicationVariants.all { variant -> variant.outputs.each { output -> // For each separate APK per architecture, set a unique version code as described here: // https://developer.android.com/studio/build/configure-apk-splits.html // Example: versionCode 1 will generate 1001 for armeabi-v7a, 1002 for x86, etc. def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4] def abi = output.getFilter(OutputFile.ABI) if (abi != null) { // null for the universal-debug, universal-release variants output.versionCodeOverride = defaultConfig.versionCode * 1000 + versionCodes.get(abi) } } } } dependencies { // The version of react-native is set by the React Native Gradle Plugin implementation("com.facebook.react:react-android") implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.0.0") debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") { exclude group:'com.squareup.okhttp3', module:'okhttp' } debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") if (hermesEnabled.toBoolean()) { implementation("com.facebook.react:hermes-android") } else { implementation jscFlavor } } apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project) 여기서 에러가 났다고 적혀져 있는거 같은데 apply plugin: "com.android.application" apply from: project(':react-native-config').projectDir.getPath() + "/dotenv.gradle" 저는 제일 앞에 이 두 줄만 추가해줬습니다. 근데 계속 빌드하는 데 에러가 납니다. 두 부분이 실패했다고 하는데 어딘지 잘 모르겠어요.... android/app/src/main/AndroidManifest.xml <manifest xmlns:android="http://schemas.android.com/apk/res/android"> <uses-permission android:name="android.permission.INTERNET" /> <application android:userCLeartextTraffic="true" android:name=".MainApplication" android:label="@string/app_name" android:icon="@mipmap/ic_launcher" android:roundIcon="@mipmap/ic_launcher_round" android:allowBackup="false" android:theme="@style/AppTheme"> <activity android:name=".MainActivity" android:label="@string/app_name" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|uiMode" android:launchMode="singleTask" android:windowSoftInputMode="adjustResize" android:exported="true"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application> </manifest> android/app/proguard-rules.pro pecific ProGuard rules here. # By default, the flags in this file are appended to flags specified # in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt # You can edit the include path and order by changing the proguardFiles # directive in build.gradle. # # For more details, see # http://developer.android.com/guide/developing/tools/proguard.html # Add any project specific keep options here: -keep class com.fooddeliveryapp.BuildConfig { *; }
안녕하세요 선생님..그냥 단순히 인풋박스 만들어서 이미지 업로드를 해도 되지만 antd의 upload가 예뻐보여서 이걸 써서 이미지를 업로드 하고 싶은데 아무리 해도 되질 않아서 질문 드립니다ㅠㅠ 보니까 보통 인풋박스를 통해 이미지 파일을 업로드할 때 양식이 FileList형식(배열처럼 보이는 객체...?)이던데 antd upload에서 제공하는 props의 filelist는 양식이 좀 다르더라구요.. 일단 백은 기존의 이미지 업로드 방식에서 바뀐 부분이 없고, 제가 antd의 Upload를 사용한 방식은 아래와 같습니다. <Upload name='image' listType="picture-card" multiple fileList={fileList} onChange={onChangeImages} onPreview={onPreview} onRemove={onRemoveImage} > {fileList.length < 2 && 'Drag images or click'} </Upload> 업로드 props는 위와 같이 설정하고 onChange함수는 const onChangeImages = useCallback(({ fileList: newFileList }) => { setFileList(newFileList); console.log('images', fileList); const imageFormData = new FormData(); for(let i = 0; i< fileList.length; i++){ imageFormData.append('key',fileList[i]); } return dispatch({ type: UPLOAD_IMAGES_REQUEST, data: imageFormData }); }); 위와 같이 작성하면 업로드 되지 않을까 했는데, 이미지 업로드가 성공했다고 쓰지만 콘솔 창에 나온 메세지를 보면 {type: 'UPLOAD_IMAGES_SUCCESS', data: Array(0), @@redux-saga/SAGA_ACTION: true} 이런 식으로 빈 배열만 자꾸 들어가고, 콘솔로 찍어본 fileList는 아래와 같이 뜨던데 images [{…}] 0: lastModified: 1669296034457 lastModifiedDate: Thu Nov 24 2022 22:20:34 GMT+0900 (한국 표준시) {} name: "icons8-team-URoyGsQdLwg-unsplash.jpg" originFileObj: File {uid: 'rc-upload-1675523328622-3', name: 'icons8-team-URoyGsQdLwg-unsplash.jpg', lastModified: 1669296034457, lastModifiedDate: Thu Nov 24 2022 22:20:34 GMT+0900 (한국 표준시), webkitRelativePath: '', …} percent: 0 size: 674143 status: "uploading" thumbUrl: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMg type: "image/jpeg" uid: "rc-upload-1675523328622-3" [[Prototype]]: Object length: 1 [[Prototype]]: Array(0) 노드버드에서는 업로드할 파일을 콘솔에 찍어보았을 때 FileList {0: File, length: 1} 0 : File lastModified: 1669296034457 lastModifiedDate: Thu Nov 24 2022 22:20:34 GMT+0900 (한국 표준시) {} name: "icons8-team-URoyGsQdLwg-unsplash.jpg" size: 674143 type: "image/jpeg" webkitRelativePath: "" [[Prototype]]: File length: 1 [[Prototype]]: FileList 이렇게 나오는걸 보면 데이터 구조상의 차이가 있어서 업로드가 안되는 것인가요? antd upload를 이용한 파일 업로드를 할 때 제가 놓친 부분이 어디인지 알 수 있을까요..? 조언 부탁드립니다 선생님ㅠ
좋은 강의 감사드립니다 :) 강의를 듣다가 생긴 궁금증이 있어서 질문드립니다 Full Cone 방식에서 랑데뷰 서버 얘기 하시면서 PtoP 통신을 할 때 랑데뷰 서버가 한 PC한테 상대 PC의 포트 번호를 알려주면 알려준 포트 번호로 접속한다고 이해했는데 여기서 궁금한 점은 PtoP 통신은 A PC가 포트 번호로 B PC에 접속하면 두 컴퓨터는 연결된 상태가 되는 건가요 ? B PC는 A PC의 포트 번호를 알 필요 없는 건가요 ?
안녕하세요. 처음부터 열심히 강의를 듣고 있는 수강생입니다. 다름이 아니라 저는 STS, Gradle-Groovy로 진행을 하고 있는데요. 해당 강의에서 logback을 설정하니 엄청나게 많은 로그가 나와서 쿼리로그만 나올 수 있게 할 수 있는지에 대해 문의드립니다. <일부분 로그만 복사> WebSocketServletAutoConfiguration.UndertowWebSocketConfiguration: Did not match: - @ConditionalOnClass did not find required class 'io.undertow.websockets.jsr.Bootstrap' (OnClassCondition) XADataSourceAutoConfiguration: Did not match: - @ConditionalOnClass did not find required class 'javax.transaction.TransactionManager' (OnClassCondition) Exclusions: ----------- None Unconditional classes: ---------------------- org.springframework.boot.autoconfigure.context.ConfigurationPropertiesAutoConfiguration org.springframework.boot.autoconfigure.context.LifecycleAutoConfiguration org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration org.springframework.boot.autoconfigure.availability.ApplicationAvailabilityAutoConfiguration org.springframework.boot.autoconfigure.info .ProjectInfoAutoConfiguration /Sailing/src/main/resources/logback-spring.xml <?xml version="1.0" encoding="UTF-8"?> <configuration> <appender name="console" class="ch.qos.logback.core.ConsoleAppender"> <encoder> <Pattern>[%d{yyyy-MM-dd HH:mm:ss}:%-3relative] [%thread] %-5level %logger{36} - %msg%n</Pattern> </encoder> </appender> <!-- Logback 은 5단계의 로그 레벨을 가진다. 심각도 수준은 off > Error > Warn > Info > Debug > Trace 이다. --> <!-- name은 package 이름 --> <logger name="com.boot.sailing" level="Info"/> <root level="Debug"> <appender-ref ref="console"/> </root> </configuration> 감사합니다.
안녕하세요. 비밀노트 덕분에 방대하게 느껴졌던 이직관련 공부 + 걱정들이 많이 해소됐습니다. 😃 정말 감사합니다! 비밀노트 읽으면서 궁금했던 부분이 하나 생겼는데, 저는 스타트업에서 스프링 + 코틀린 백엔드 개발자로 일한지 이제 막 만 1년이 지난 2년차 개발자입니다. 업무를 하는 동안에 따로 토이프로젝트나 개인 프로젝트한게 없어서 포트폴리오라고할게 따로 없는데 이런 경우에는 예전에 취준생 때, 사용했던 프로젝트를 기재해야할지, 아니면 차라리 포트폴리오를 따로 제출하지 않는 것이 나을지 고민입니다.(이런 경우에는 어떻게하는게 좋을까요? 🤔) 퇴근 후에 딱히 놀았던건 아니지만 1년이 지나는 시간동안 토이 프로젝트 하나 안했다니... 후회가 되네요. 😂
학습하는 분들께 도움이 되고, 더 좋은 답변을 드릴 수 있도록 질문전에 다음을 꼭 확인해주세요. 1. 강의 내용과 관련된 질문을 남겨주세요. 2. 인프런의 질문 게시판과 자주 하는 질문(링크)을 먼저 확인해주세요. (자주 하는 질문 링크: https://bit.ly/3fX6ygx) 3. 질문 잘하기 메뉴얼(링크)을 먼저 읽어주세요. (질문 잘하기 메뉴얼 링크: https://bit.ly/2UfeqCG) 질문 시에는 위 내용은 삭제하고 다음 내용을 남겨주세요. ========================================= [질문 템플릿] 1. 강의 내용과 관련된 질문인가요? (예/아니오) 네 2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? (예/아니오) 네 3. 질문 잘하기 메뉴얼을 읽어보셨나요? (예/아니오) 네 [질문 내용] 여기에 질문 내용을 남겨주세요. 해당 강의에서는 Item 내부에 createdDate 필드를 만들고 implements Persistable을 할 때 isNew 함수가 createdDate == null 을 하더라도 문제없이 동작할 수 있음을 확인했습니다. 그런데 Item 자체가 public class Item extends BaseEntity implements Persistable<String> 이런식이라면 즉, createdDate가 Item class 내부가 아닌, 외부에 존재한다면 isNew 함수를 만들때 createdDate를 참조해올 수 없는데 어떻게 해결해야하는지 궁금합니다. 제 개인적으로 해결방안이라고 생각한 것은 BaseTimeEntity의 createdDate를 public으로 오픈한다. BaseTimeEntity에서 implements Persistable 을 받고 isNew함수를 정의한다. 이렇게 할 경우에 추가적으로 생기는 문제점은 getId() 함수를 Override해야하는데, BaseTimeEntity class 내부에 id 값이 따로 없어서 곤란하다고 여겨집니다. getId() 함수를 만들어도 엔티티마다 id의 타입이 다를 수도 있다고 생각되는데 타입 문제는 어떻게 해결해야하는지 모르겠습니다. 이정도 두 가지가 떠오르긴 했는데, 효과적인 방법은 아니라고 생각되어 프로젝트 개발시에 엔티티들이 공통적으로 BaseEntity, BaseTimeEntity를 상속받고 있는 상황일때는 isNew함수를 어떻게 정의해야하는지 알려주시면 감사하겠습니다.
에는 위 내용은 삭제하고 다음 내용을 남겨주세요. ========================================= [질문 템플릿] 1. 강의 내용과 관련된 질문인가요? (예/) 2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? (예/) 3. 질문 잘하기 메뉴얼을 읽어보셨나요? (예/) [질문 내용] 아이디에 @NotNull 어노테이션을 붙여주셨는데 @NotNull 은 공백이 포함되도 된는걸로 알고있습니다. @NotBlank여야 할거같은데 @NotNull 로해주신 이유가 궁금합니다!
안녕하세요, 강사님! 강의 열심히 잘 듣고 있습니다!ㅎㅎ 끝말잇기 게임으로 처음 뭔가 따라서 만들어보고 있는데, 강의에서 말씀하시는대로 아래처럼 썼는데, input에 쓴 단어가 제시어 옆에 나타나지도 않고, 버튼이 영 안 먹히는 것 같습니다. 콘솔창 켜봐도 아무 에러 메시지 뜨는 것도 없고, 혹시나 다른 질문 글에서처럼 오타 생긴 건 아닌지 보고 또 봐도 이상 없는데.. 어떤 부분이 문제인지 모르겠습니다ㅠㅠ 어디서 문제가 생긴 건지 봐주실 수 있나요? 감사합니다!ㅠㅠㅠ //<script>에서 제시어와 새로 입력한 단어 관련 코드만 발췌. const $word = document.querySelector('#word'); let word; //제시어 let newWord; //새로 입력한 단어 const onClickButton = () => { if (!word) { // 제시어가 비어있는가? //비어있다면 word = newWord; //입력한 단어가 제시어가 된다. $word.textContent = word; //제시어 옆에 단어가 나타나도록 화면 바꿈. } else { // 제시어가 비어있지 않다. } }