인프런 커뮤니티 질문&답변

qdial214님의 프로필 이미지
qdial214

작성한 질문수

배달앱 클론코딩 [with React Native]

앱 빌드 오류 질문 드립니다!

작성

·

419

0

- 학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요!
- 먼저 유사한 질문이 있었는지 검색해보세요.
- 서로 예의를 지키며 존중하는 문화를 만들어가요.
- 잠깐! 인프런 서비스 운영 관련 문의는 1:1 문의하기를 이용해주세요.
 
안녕하세요! 강의를 따라하던 중 앱빌드도 잘되었고, 섹션1에 들어와서 src 디렉토리 등등을 만들면서 코드를 추가하였습니다.
계속 잘 되던 앱빌드가 갑자기 이러한 오류가 나고 있습니다. android 폴더 안에 있는 코드를 아무것도 바꾸지 않았는데 왜 이러한 오류가 나는건지 모르겠습니다 ㅜㅜ 에뮬레이터 오류인가 싶어 안드로이드 스튜디오 에뮬레이터 설정하는 곳에서 캐시 삭제도 하고 해보았는데 해결이 되지 않습니다..!
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag. Jetifier found 1062 file(s) to forward-jetify. Using 8 workers... info Starting JS server... info Launching emulator... info Successfully launched emulator. info Installing the app... > Task :app:compileDebugJavaWithJavac FAILED Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0. You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins. See https://docs.gradle.org/7.3.3/userguide/command_line_interface.html#sec:command_line_warnings 51 actionable tasks: 2 executed, 49 up-to-date C:\Users\82102\Delivery\android\app\src\main\java\com\delivery\MainActivity.java:7: error: class, interface, or enum expected ... ^ C:\Users\82102\Delivery\android\app\src\main\java\com\delivery\MainActivity.java:9: error: class, interface, or enum expected protected void onCreate(Bundle savedInstanceState) { ^ C:\Users\82102\Delivery\android\app\src\main\java\com\delivery\MainActivity.java:11: error: class, interface, or enum expected } ^ 3 errors FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':app:compileDebugJavaWithJavac'. > Compilation failed; see the compiler error output for details. * 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 10s 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 C:\Users\82102\Delivery\android\app\src\main\java\com\delivery\MainActivity.java:7: error: class, interface, or enum expected ... ^ C:\Users\82102\Delivery\android\app\src\main\java\com\delivery\MainActivity.java:9: error: class, interface, or enum expected protected void onCreate(Bundle savedInstanceState) { ^ C:\Users\82102\Delivery\android\app\src\main\java\com\delivery\MainActivity.java:11: error: class, interface, or enum expected } ^ 3 errors FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':app:compileDebugJavaWithJavac'. > Compilation failed; see the compiler error output for details. * 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 10s at makeError (C:\Users\82102\Delivery\node_modules\@react-native-community\cli-platform-android\node_modules\execa\index.js:174:9) at C:\Users\82102\Delivery\node_modules\@react-native-community\cli-platform-android\node_modules\execa\index.js:278:16 at processTicksAndRejections (node:internal/process/task_queues:96:5) at async runOnAllDevices (C:\Users\82102\Delivery\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:109:5) at async Command.handleAction (C:\Users\82102\Delivery\node_modules\@react-native-community\cli\build\index.js:192:9) info Run CLI with --verbose flag for more details.

답변 1

0

제로초(조현영)님의 프로필 이미지
제로초(조현영)
지식공유자

MainActivity.java 소스코드 수정 안 햐셨나요? 소스코드 문법에 뭔가 문제가 생긴 것 같습니다. 7번째 줄 뭔가요?

qdial214님의 프로필 이미지
qdial214

작성한 질문수

질문하기