Execution failed for task ':processDebugResources' / Using compileSdk 35 requires Android Gradle Plugin (AGP) 8.1.0 or higher.

겨레·2025년 2월 10일
0

┌─ Flutter Fix ────────────────────────────────────────────────────────────────────────────────────┐
│ [!] Using compileSdk 35 requires Android Gradle Plugin (AGP) 8.1.0 or higher.                    │
│  Please upgrade to a newer AGP version. The version of AGP that your project uses is likely      │
│  defined in:                                                                                     │
│ C:\git_repo\lalalabs_flutter_renewal\android\settings.gradle,                                    │
│ in the 'plugins' closure (by the number following "com.android.application").                    │
│  Alternatively, if your project was created with an older version of the templates, it is likely │
│ in the buildscript.dependencies closure of the top-level build.gradle:                           │
│ C:\git_repo\lalalabs_flutter_renewal\android\build.gradle,                                       │
│ as the number following "com.android.tools.build:gradle:".                                       │
│                                                                                                  │
│  Finally, if you have a strong reason to avoid upgrading AGP, you can temporarily lower the      │
│  compileSdk version in the following file:                                                       │
│ C:\git_repo\lalalabs_flutter_renewal\android\app\build.gradle                                    │
└──────────────────────────────────────────────────────────────────────────────────────────────────┘
Error: Gradle task assembleDebug failed with exit code 1

💣Execution failed for task ':processDebugResources' 에러 발생!!!

그리고 Using compileSdk 35 requires Android Gradle Plugin (AGP) 8.1.0 or higher. 이런 문제도 발생했다.

이 문제 때문에 애뮬레이터 빌드가 되지 않았다...


✅ 원인
👉 compileSdk 35을 사용 중인데 AGP(Android Gradle Plugin)가 최신 버전이 아님!

  • compileSdkVersion 35을 사용하려면 AGP 8.1.0 이상이 필요함.
  • 현재 프로젝트의 AGP 버전이 낮아서 충돌이 발생한 것...

👉 android-35 플랫폼의 android.jar 파일 문제

  • C:\Users\HOME\AppData\Local\Android\sdk\platforms\android-35\android.jar 관련 오류는 Android SDK가 손상됨.
  • android-35 SDK 버전이 올바르게 설치되지 않음.

📍 해결 방법

  • gradle/wrapper.properties로 들어가서 기존 코드를
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip

아래와 같이 수정했준다...

distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-all.zip
networkTimeout=10000
  • android/settings.gradle도 수정해준다.
plugins {
   // 기존
   id "com.android.application" version "7.3.0" apply false
  // 수정 
   id "com.android.application" version "8.1.0" apply false

(+) android-35 플랫폼의 android.jar 파일 문제는 여전히 다소 미궁 속에...

안드로이드 스튜디오를 삭제하고 재설치해서 디바이스를 추가했다. 난 API 35는 필요없었는데, 왜 자꾸 저절로 재설치가 되는 것인지....

계속 오류나더니 위 방법으로 수정하고 난 후에는 API 35가 자동 설치되어도 잘 동작했다... 흠🤔

profile
호떡 신문지에서 개발자로 환생

2개의 댓글

comment-user-thumbnail
2025년 6월 13일

덕분에 며칠 헤매던거 수습했습니다. 정말 감사합니다!

1개의 답글