๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
์นดํ…Œ๊ณ ๋ฆฌ ์—†์Œ

์•ˆ๋“œ๋กœ์ด๋“œ ์ŠคํŠœ๋””์˜ค ์˜ค๋ฅ˜ ํ•ด๊ฒฐ ๋ฐฉ๋ฒ• – ์ž์ฃผ ๋ฐœ์ƒํ•˜๋Š” ๋ฌธ์ œ์™€ ํ•ด๊ฒฐ์ฑ…

by โœ”๐Ÿ‘‰1๏ธโƒฃ 2025. 3. 8.

์•ˆ๋“œ๋กœ์ด๋“œ ์•ฑ ๊ฐœ๋ฐœ์„ ํ•  ๋•Œ ์•ˆ๋“œ๋กœ์ด๋“œ ์ŠคํŠœ๋””์˜ค(Android Studio)์—์„œ ๋‹ค์–‘ํ•œ ์˜ค๋ฅ˜๊ฐ€ ๋ฐœ์ƒํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ํŠนํžˆ ๋นŒ๋“œ(Build) ์˜ค๋ฅ˜, ์—๋ฎฌ๋ ˆ์ดํ„ฐ ์‹คํ–‰ ๋ฌธ์ œ, Gradle ๊ด€๋ จ ์˜ค๋ฅ˜ ๋“ฑ์€ ๋งŽ์€ ๊ฐœ๋ฐœ์ž๊ฐ€ ๊ฒช๋Š” ๋ฌธ์ œ ์ค‘ ํ•˜๋‚˜์ž…๋‹ˆ๋‹ค. ์ด๋ฒˆ ํฌ์ŠคํŒ…์—์„œ๋Š” ์•ˆ๋“œ๋กœ์ด๋“œ ์ŠคํŠœ๋””์˜ค์—์„œ ์ž์ฃผ ๋ฐœ์ƒํ•˜๋Š” ์˜ค๋ฅ˜์™€ ํ•ด๊ฒฐ ๋ฐฉ๋ฒ•์„ ์ •๋ฆฌํ•ด๋ณด๊ฒ ์Šต๋‹ˆ๋‹ค.


๐Ÿ“Œ 1. ์•ˆ๋“œ๋กœ์ด๋“œ ์ŠคํŠœ๋””์˜ค ์‹คํ–‰ ์˜ค๋ฅ˜ (ํ”„๋กœ์ ํŠธ ๋กœ๋”ฉ ์‹คํŒจ)

๐Ÿšจ ์ฆ์ƒ:

  • ์•ˆ๋“œ๋กœ์ด๋“œ ์ŠคํŠœ๋””์˜ค๋ฅผ ์‹คํ–‰ํ–ˆ๋Š”๋ฐ ํ”„๋กœ์ ํŠธ๊ฐ€ ์ •์ƒ์ ์œผ๋กœ ๋กœ๋”ฉ๋˜์ง€ ์•Š์Œ
  • Gradle sync failed, Failed to open project ๊ฐ™์€ ์˜ค๋ฅ˜ ๋ฉ”์‹œ์ง€๊ฐ€ ํ‘œ์‹œ๋จ

โœ” ํ•ด๊ฒฐ ๋ฐฉ๋ฒ•

  1. ์•ˆ๋“œ๋กœ์ด๋“œ ์ŠคํŠœ๋””์˜ค ์บ์‹œ ์‚ญ์ œ ํ›„ ์žฌ์‹œ์ž‘
    • File → Invalidate Caches & Restart ํด๋ฆญ
    • ๋‹ค์‹œ ์‹คํ–‰ ํ›„ ํ”„๋กœ์ ํŠธ๋ฅผ ๋กœ๋“œ
  2. Gradle ์žฌ์„ค์ • ํ›„ ๋™๊ธฐํ™”
    • File → Sync Project with Gradle Files ํด๋ฆญ
  3. JDK ์„ค์ • ํ™•์ธ
    • File → Project Structure → JDK location์—์„œ ์˜ฌ๋ฐ”๋ฅธ ๊ฒฝ๋กœ์ธ์ง€ ํ™•์ธ

๐Ÿ“Œ ์œ„ ๋ฐฉ๋ฒ•์œผ๋กœ ํ•ด๊ฒฐ๋˜์ง€ ์•Š์œผ๋ฉด, ํ”„๋กœ์ ํŠธ๋ฅผ ์ƒˆ๋กœ ๋ถˆ๋Ÿฌ์˜ค๊ฑฐ๋‚˜ Gradle ํŒŒ์ผ์„ ์—…๋ฐ์ดํŠธํ•ด๋ณด์„ธ์š”.


๐Ÿ“Œ 2. Gradle ๋นŒ๋“œ ์˜ค๋ฅ˜ (๋นŒ๋“œ ์‹คํŒจ ๋ฌธ์ œ)

๐Ÿšจ ์ฆ์ƒ:

  • Gradle build failed, Could not resolve dependency ๋“ฑ์˜ ์˜ค๋ฅ˜ ๋ฐœ์ƒ
  • ์•ฑ์„ ์‹คํ–‰ํ•˜๋ ค๊ณ  ํ•˜๋ฉด ๋นŒ๋“œ๊ฐ€ ์‹คํŒจํ•จ

โœ” ํ•ด๊ฒฐ ๋ฐฉ๋ฒ•

  1. Gradle ๋ฒ„์ „ ํ™•์ธ ํ›„ ์ตœ์‹  ๋ฒ„์ „์œผ๋กœ ์—…๋ฐ์ดํŠธ
    • gradle-wrapper.properties ํŒŒ์ผ์—์„œ ์ตœ์‹  ๋ฒ„์ „์œผ๋กœ ๋ณ€๊ฒฝ
    • ์˜ˆ:
      distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip
  2. Gradle ์บ์‹œ ์‚ญ์ œ ํ›„ ๋‹ค์‹œ ๋นŒ๋“œ
    • File → Invalidate Caches & Restart ์‹คํ–‰
    • ./gradlew clean ๋ช…๋ น์–ด ์‹คํ–‰
  3. ์ธํ„ฐ๋„ท ์—ฐ๊ฒฐ ํ™•์ธ ํ›„ ์ข…์†์„ฑ(Dependency) ๋‹ค์‹œ ๋‹ค์šด๋กœ๋“œ
    • File → Sync Project with Gradle Files ์‹คํ–‰

๐Ÿ“Œ ํŠน์ • ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๊ฐ€ ๋‹ค์šด๋กœ๋“œ๋˜์ง€ ์•Š๋Š”๋‹ค๋ฉด, VPN์„ ์‚ฌ์šฉํ•ด ๋ณด๊ฑฐ๋‚˜ ๋‹ค๋ฅธ ๋„คํŠธ์›Œํฌ์—์„œ ์‹œ๋„ํ•ด๋ณด์„ธ์š”.


๐Ÿ“Œ 3. ์—๋ฎฌ๋ ˆ์ดํ„ฐ ์‹คํ–‰ ์˜ค๋ฅ˜ (AVD ์‹คํ–‰ ๋ถˆ๊ฐ€)

๐Ÿšจ ์ฆ์ƒ:

  • ์—๋ฎฌ๋ ˆ์ดํ„ฐ(AVD)๊ฐ€ ์‹คํ–‰๋˜์ง€ ์•Š๊ฑฐ๋‚˜ ๊ฐ•์ œ ์ข…๋ฃŒ๋จ
  • emulator: ERROR: x86 emulation currently requires hardware acceleration! ์˜ค๋ฅ˜ ๋ฐœ์ƒ

โœ” ํ•ด๊ฒฐ ๋ฐฉ๋ฒ•

  1. HAXM(ํ•˜๋“œ์›จ์–ด ๊ฐ€์†) ํ™œ์„ฑํ™”
    • Windows:
      • Intel HAXM์ด ์„ค์น˜๋˜์–ด ์žˆ๋Š”์ง€ ํ™•์ธ (SDK Manager → SDK Tools)
      • ์„ค์น˜๋˜์–ด ์žˆ์ง€ ์•Š๋‹ค๋ฉด ๋‹ค์šด๋กœ๋“œ ํ›„ ์„ค์น˜
    • Mac:
      • System Preferences → Security & Privacy → Virtualization ํ™œ์„ฑํ™”
  2. ์—๋ฎฌ๋ ˆ์ดํ„ฐ ๋ฐ์ดํ„ฐ ์‚ญ์ œ ํ›„ ๋‹ค์‹œ ์‹คํ–‰
    • Tools → AVD Manager์—์„œ ์‚ฌ์šฉ ์ค‘์ธ ๊ฐ€์ƒ ์žฅ์น˜๋ฅผ ์‚ญ์ œ ํ›„ ๋‹ค์‹œ ์ƒ์„ฑ
  3. PC ์‚ฌ์–‘์ด ๋‚ฎ๋‹ค๋ฉด ์‹ค๊ธฐ๊ธฐ ๋””๋ฒ„๊น… ์ถ”์ฒœ
    • ์—๋ฎฌ๋ ˆ์ดํ„ฐ๊ฐ€ ๋Š๋ฆฌ๊ฑฐ๋‚˜ ์‹คํ–‰๋˜์ง€ ์•Š๋Š”๋‹ค๋ฉด, USB ๋””๋ฒ„๊น…์„ ํ™œ์„ฑํ™”ํ•˜์—ฌ ์‹ค์ œ ๊ธฐ๊ธฐ์—์„œ ์‹คํ–‰ํ•˜๋Š” ๊ฒƒ์ด ๋” ํšจ์œจ์ 

๐Ÿ“Œ ํ•˜๋“œ์›จ์–ด ๊ฐ€์†์„ ์‚ฌ์šฉํ•  ์ˆ˜ ์—†๋‹ค๋ฉด, ARM ์ด๋ฏธ์ง€๋ฅผ ์„ ํƒํ•˜์—ฌ ์‹คํ–‰ํ•ด๋ณด์„ธ์š”.


๐Ÿ“Œ 4. ํŒจํ‚ค์ง€ ์ด๋ฆ„ ๋ณ€๊ฒฝ ํ›„ ์˜ค๋ฅ˜ ๋ฐœ์ƒ

๐Ÿšจ ์ฆ์ƒ:

  • ์•ฑ์˜ ํŒจํ‚ค์ง€๋ช…์„ ๋ณ€๊ฒฝํ–ˆ๋”๋‹ˆ ํ”„๋กœ์ ํŠธ๊ฐ€ ์‹คํ–‰๋˜์ง€ ์•Š์Œ
  • Error: Cannot resolve symbol R ์˜ค๋ฅ˜ ๋ฐœ์ƒ

โœ” ํ•ด๊ฒฐ ๋ฐฉ๋ฒ•

  1. ํŒจํ‚ค์ง€๋ช… ๋ณ€๊ฒฝ ํ›„ ๋ชจ๋“  ํŒŒ์ผ์—์„œ ์ผ๊ด€๋˜๊ฒŒ ์ˆ˜์ •ํ–ˆ๋Š”์ง€ ํ™•์ธ
    • AndroidManifest.xml
    • build.gradle
    • MainActivity.kt ๋˜๋Š” MainActivity.java
  2. Gradle ๋‹ค์‹œ ๋นŒ๋“œ ๋ฐ ํ”„๋กœ์ ํŠธ ๋™๊ธฐํ™”
    • Build → Rebuild Project ์‹คํ–‰
    • File → Sync Project with Gradle Files ์‹คํ–‰

๐Ÿ“Œ ํŒจํ‚ค์ง€๋ช…์„ ๋ณ€๊ฒฝํ•  ๋•Œ๋Š”, ๋‹จ์ˆœํžˆ ํด๋” ์ด๋ฆ„์„ ๋ณ€๊ฒฝํ•˜๋Š” ๊ฒƒ์ด ์•„๋‹ˆ๋ผ "Refactor" ๊ธฐ๋Šฅ์„ ์‚ฌ์šฉํ•˜๋Š” ๊ฒƒ์ด ์•ˆ์ „ํ•ฉ๋‹ˆ๋‹ค.


๐Ÿ“Œ 5. 'R' cannot be resolved ์˜ค๋ฅ˜ (๋ฆฌ์†Œ์Šค ์ธ์‹ ๋ฌธ์ œ)

๐Ÿšจ ์ฆ์ƒ:

  • R ํด๋ž˜์Šค๊ฐ€ ์ธ์‹๋˜์ง€ ์•Š์Œ (Cannot resolve symbol 'R')
  • R.layout.activity_main์„ ์ฐพ์„ ์ˆ˜ ์—†๋‹ค๋Š” ์˜ค๋ฅ˜ ๋ฐœ์ƒ

โœ” ํ•ด๊ฒฐ ๋ฐฉ๋ฒ•

  1. Gradle ํŒŒ์ผ ๋™๊ธฐํ™”
    • File → Sync Project with Gradle Files
  2. Build ๋ฐ Clean ์‹คํ–‰
    • Build → Clean Project
    • Build → Rebuild Project
  3. import ์˜ค๋ฅ˜ ํ™•์ธ
    • import android.R๊ฐ€ ๋˜์–ด ์žˆ๋‹ค๋ฉด ์‚ญ์ œํ•˜๊ณ  ๋‹ค์‹œ ๋นŒ๋“œ

๐Ÿ“Œ ๋Œ€๋ถ€๋ถ„์˜ ๊ฒฝ์šฐ Gradle์„ ๋‹ค์‹œ ๋™๊ธฐํ™”ํ•˜๊ฑฐ๋‚˜ ํ”„๋กœ์ ํŠธ๋ฅผ ํด๋ฆฐํ•˜๋ฉด ํ•ด๊ฒฐ๋ฉ๋‹ˆ๋‹ค.


๐Ÿ“Œ 6. Logcat์ด ์ถœ๋ ฅ๋˜์ง€ ์•Š์„ ๋•Œ (๋””๋ฒ„๊น… ๋ถˆ๊ฐ€๋Šฅ ๋ฌธ์ œ)

๐Ÿšจ ์ฆ์ƒ:

  • Logcat ์ฐฝ์ด ๋ณด์ด์ง€ ์•Š์Œ
  • ์•ฑ ์‹คํ–‰ ์ค‘์—๋„ ๋กœ๊ทธ๊ฐ€ ์ถœ๋ ฅ๋˜์ง€ ์•Š์Œ

โœ” ํ•ด๊ฒฐ ๋ฐฉ๋ฒ•

  1. Logcat ์ฐฝ์ด ๋‹ซํ˜€ ์žˆ๋Š” ๊ฒฝ์šฐ
    • View → Tool Windows → Logcat์„ ํด๋ฆญํ•˜์—ฌ ๋‹ค์‹œ ์—ด๊ธฐ
  2. ํ•„ํ„ฐ ์„ค์ • ํ™•์ธ
    • Show only selected application์ด ํ™œ์„ฑํ™”๋˜์–ด ์žˆ๋Š”์ง€ ํ™•์ธ
  3. ADB ๋‹ค์‹œ ์‹œ์ž‘
    • Tools → SDK Manager → SDK Tools์—์„œ ADB๋ฅผ ๋‹ค์‹œ ์„ค์น˜

๐Ÿ“Œ ๋กœ๊ทธ๊ฐ€ ๋ณด์ด์ง€ ์•Š๋Š”๋‹ค๋ฉด, ์‹ค์ œ ๊ธฐ๊ธฐ ๋˜๋Š” ๋‹ค๋ฅธ ๊ฐ€์ƒ ๋””๋ฐ”์ด์Šค์—์„œ ์‹คํ–‰ํ•ด๋ณด์„ธ์š”.


๐Ÿ“ข ์ž์ฃผ ๋ฌป๋Š” ์งˆ๋ฌธ (FAQ)

Q1. ์•ˆ๋“œ๋กœ์ด๋“œ ์ŠคํŠœ๋””์˜ค ์‹คํ–‰์ด ๋„ˆ๋ฌด ๋Š๋ ค์š”.

A. PC ์‚ฌ์–‘์ด ๋‚ฎ๋‹ค๋ฉด, ํ•˜๋“œ์›จ์–ด ๊ฐ€์† ํ™œ์„ฑํ™” ๋ฐ ๋ถˆํ•„์š”ํ•œ ํ”Œ๋Ÿฌ๊ทธ์ธ ์‚ญ์ œ๋กœ ์†๋„๋ฅผ ๊ฐœ์„ ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

Q2. Gradle ๋นŒ๋“œ ์‹œ๊ฐ„์ด ๋„ˆ๋ฌด ๊ธธ์–ด์š”.

A. Gradle ์บ์‹œ๋ฅผ ํ™œ์„ฑํ™”ํ•˜๊ณ , offline mode๋กœ ์„ค์ •ํ•˜๋ฉด ๋นŒ๋“œ ์†๋„๋ฅผ ๋†’์ผ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

Q3. ํŠน์ • ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๊ฐ€ ๋‹ค์šด๋กœ๋“œ๋˜์ง€ ์•Š์•„์š”.

A. ๋„คํŠธ์›Œํฌ ๋ฌธ์ œ์ผ ์ˆ˜ ์žˆ์œผ๋ฏ€๋กœ, VPN์„ ์‚ฌ์šฉํ•˜๊ฑฐ๋‚˜ ๋‹ค๋ฅธ ์ธํ„ฐ๋„ท ํ™˜๊ฒฝ์—์„œ ์‹œ๋„ํ•ด๋ณด์„ธ์š”.

Q4. ์•ฑ์„ ์‹คํ–‰ํ–ˆ๋Š”๋ฐ ํ™”๋ฉด์ด ์•ˆ ๋ณด์ด๊ณ  ์˜ค๋ฅ˜๋„ ์—†์–ด์š”.

A. Manifest.xml์—์„œ intent-filter ์„ค์ •์ด ์˜ฌ๋ฐ”๋ฅธ์ง€ ํ™•์ธํ•˜์„ธ์š”.


๐Ÿ”Ž ๊ฒฐ๋ก  – ์•ˆ๋“œ๋กœ์ด๋“œ ์ŠคํŠœ๋””์˜ค ์˜ค๋ฅ˜ ํ•ด๊ฒฐ ๋ฐฉ๋ฒ• ์ •๋ฆฌ

์˜ค๋ฅ˜ ์œ ํ˜• ํ•ด๊ฒฐ ๋ฐฉ๋ฒ•
์‹คํ–‰ ์˜ค๋ฅ˜ (Gradle sync failed) Gradle ์บ์‹œ ์‚ญ์ œ ํ›„ ๋‹ค์‹œ ๋นŒ๋“œ
๋นŒ๋“œ ์‹คํŒจ (Could not resolve dependency) Gradle ๋ฒ„์ „ ์—…๋ฐ์ดํŠธ, Sync Project ์‹คํ–‰
์—๋ฎฌ๋ ˆ์ดํ„ฐ ์‹คํ–‰ ๋ถˆ๊ฐ€ HAXM ํ™œ์„ฑํ™”, AVD ์žฌ์„ค์ •
ํŒจํ‚ค์ง€๋ช… ๋ณ€๊ฒฝ ํ›„ ์˜ค๋ฅ˜ Manifest.xml, build.gradle ํ™•์ธ ํ›„ Gradle ๋นŒ๋“œ
Cannot resolve symbol 'R' Gradle ๋™๊ธฐํ™”, Clean & Rebuild ์‹คํ–‰
Logcat์ด ๋ณด์ด์ง€ ์•Š์Œ View → Tool Windows → Logcat์—์„œ ํ™•์ธ

๐Ÿ“Œ ๐Ÿ‘‰ ์œ„ ๋ฐฉ๋ฒ•์„ ํ•˜๋‚˜์”ฉ ์‹œ๋„ํ•˜๋ฉด ๋Œ€๋ถ€๋ถ„์˜ ์˜ค๋ฅ˜๋ฅผ ํ•ด๊ฒฐํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค! ๐Ÿ˜Š๐Ÿš€

๋Œ“๊ธ€