'gradle'에 해당하는 글 1건

플러터 를 안드로이드 로 개발중인데 - 새버전이 나와서 업그레이드 하였다.

에러가 생길 것은 예상은 했다. 빌드해보니.

Launching lib/main.dart on sdk gphone64 arm64 in debug mode...
Running Gradle task 'assembleDebug'...

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> A problem occurred starting process 'command '/..../flutter/bin/flutter''

* 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 2s
Error: Gradle task assembleDebug failed with exit code 1
Error executing devicectl: ProcessException: Process exited abnormally with exit code 3:

User cancelled
  Command: /usr/bin/arch -arm64e xcrun devicectl list devices --timeout 5 --json-output /var/folders/d7/4qd968hd0kzc21y8jggx2qcr0000gn/T/flutter_tools.w7hJCy/core_devices.D5JYTk/core_device_list.json
Error executing devicectl: ProcessException: Process exited abnormally with exit code 3:

User cancelled
  Command: /usr/bin/arch -arm64e xcrun devicectl list devices --timeout 5 --json-output /var/folders/d7/4qd968hd0kzc21y8jggx2qcr0000gn/T/flutter_tools.w7hJCy/core_devices.AHDMpc/core_device_list.json

다음과 같은 에러가 발생하였다.

flutter doctor 해봐도 특별한 이상은 안 보였다.

 


iOS 쪽을 시도 해봤다.

# xcodebuild -downloadPlatform iOS

Downloading iOS 17.5 Simulator (21F79): 83.1% (6.09 GB of 7.34 GB)2024-05-27 00:10:48.511 xcodebuild[38139:36929395]  DVTDownloadable: Download Failed. Downloadable: https://download.developer.apple.com/Developer_Tools/iOS_17.5_Simulator_Runtime/iOS_17.5_Simulator_Runtime.dmg. Error Domain=NSPOSIXErrorDomain Code=28 "No space left on device" UserInfo={NSErrorFailingURLStringKey=https://download.developer.apple.com/Developer_Tools/iOS_17.5_Simulator_Runtime/iOS_17.5_Simulator_Runtime.dmg, NSErrorFailingURLKey=https://download.developer.apple.com/Developer_Tools/iOS_17.5_Simulator_Runtime/iOS_17.5_Simulator_Runtime.dmg, _NSURLErrorRelatedURLSessionTaskErrorKey=(
    "LocalDownloadTask <D677E7D4-290F-4ABB-AE5D-98AAF40F70BC>.<1>"
), _NSURLErrorFailingURLSessionTaskErrorKey=LocalDownloadTask <D677E7D4-290F-4ABB-AE5D-98AAF40F70BC>.<1>}
Downloading iOS 17.5 Simulator (21F79): Error: Error Domain=NSPOSIXErrorDomain Code=28 "No space left on device" UserInfo={NSErrorFailingURLStringKey=https://download.developer.apple.com/Developer_Tools/iOS_17.5_Simulator_Runtime/iOS_17.5_Simulator_Runtime.dmg, NSErrorFailingURLKey=https://download.developer.apple.com/Developer_Tools/iOS_17.5_Simulator_Runtime/iOS_17.5_Simulator_Runtime.dmg, _NSURLErrorRelatedURLSessionTaskErrorKey=(
    "LocalDownloadTask <D677E7D4-290F-4ABB-AE5D-98AAF40F70BC>.<1>"
), _NSURLErrorFailingURLSessionTaskErrorKey=LocalDownloadTask <D677E7D4-290F-4ABB-AE5D-98AAF40F70BC>.<1>}

여기도 에러.

하드 공간이 없다.  오랜만에 봤더니, 6기가 정도 밖에 안 남았네. ㅜㅜ

용량이 부족하다. 조금 정리하고 다시 시도..

Registering simulator runtime with CoreSimulator failed.
Domain: DVTDownloadableErrorDomain
Code: 29
User Info: {
    DVTErrorCreationDateKey = "2024-05-26 15:36:28 +0000";
}
--
Registering simulator runtime with CoreSimulator failed.
Domain: DVTDownloadableErrorDomain
Code: 29
--
Cannot copy the image because the disk is almost full
Domain: com.apple.CoreSimulator.simdiskimaged.SimDiskImageError
Code: 14
--


System Information

macOS Version 14.4.1 (Build 23E224)
Xcode 15.4 (22622) (Build 15F31d)
Timestamp: 2024-05-27T00:36:28+09:00

더 줄여야 겠다.

하드 좀 정리하고, 다시 해보니 정상 다운로드 되었다.
그리고, 안드로이드 스튜디오에서 다시 빌드 해보니 정상 동작 했다.

이제 안드로이드 쪽 빌드를 해결해보자.(즉, iOS 쪽은 정상)

android / gradle 빌드 쪽 이슈로 좁혀졌다.


[다시 시도]

flutter upgrade --force 로 플러터 SDK 를 업그레이드 해봤다.

* What went wrong:
Execution failed for task ':gradle:compileGroovy'.
> Failed to run Gradle Worker Daemon
   > A problem occurred starting process 'Gradle Worker Daemon 1'

에러가 나지만, 메시지가 달라졌다.

android/ 에서 gradle 을 콘솔에서 명령을 내려봤다.

# ./gradlew app:installDebug

FAILURE: Build failed with an exception.

* Where:
Build file '.../android/app/build.gradle' line: 2


What went wrong:
An exception occurred applying plugin request [id: 'com.android.application']
> Failed to apply plugin 'com.android.internal.application'.
   > Android Gradle plugin requires Java 11 to run. You are currently using Java 1.8.
      Your current JDK is located in /Library/Java/JavaVirtualMachines/temurin-8.jdk/Contents/Home/jre
      You can try some of the following options:
       - changing the IDE settings.
       - changing the JAVA_HOME environment variable.
       - changing `org.gradle.java.home` in `gradle.properties`.

* 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 24s
4 actionable tasks: 2 executed, 2 up-to-date

다른 프로젝트에서 1.8 오래된 버전이 필요해서 바꿨었는데, 그것이 영향을 준것 같다.
근데, 안드로이드 스튜디오 젤리피시 버전업 하기까지는 이상이 없었는데..??

android/gradle.properties
파일에 JAVA_HOME 패스를 넣었다.(.bash_profile 등에 넣어도 된다.)

org.gradle.java.home=/Library/Java/JavaVirtualMachines/adoptopenjdk-16.jdk/Contents/Home/

 

다시 빌드...

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':connectivity_plus:compileDebugJavaWithJavac'.
> error: invalid source release: 17

 

이거 점점 미궁으로 가는거 아닌가? ㅜㅜ

java 버전 17 으로 맞춰준다.

# brew install openjdk@17

sudo ln -s  /opt/homebrew/Cellar/openjdk\@17/17.0.11/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk-17.jdk

gradle.properties 나 IDE 세팅등에 버전을 맞춘다.

org.gradle.java.home=/Library/Java/JavaVirtualMachines/openjdk-17.jdk/Contents/Home/

 

일단 여기까지 해보니, 정상 빌드 된다.

반응형

WRITTEN BY
1day1
하루하루 즐거운일 하나씩, 행복한일 하나씩 만들어 가요.

,