작성
·
451
답변 4
1
0
Launching lib\main.dart on Android SDK built for x86 in debug mode...
Warning: The plugin flutter_plugin_android_lifecycle requires Android SDK version 31.
Warning: The plugin image_picker_android requires Android SDK version 31.
One or more plugins require a higher Android SDK version.
Fix this issue by adding the following to L:\flutter\instagram_clone_2\android\app\build.gradle:
android {
compileSdkVersion 31
...
}
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:checkDebugAarMetadata'.
> Multiple task action failures occurred:
> A failure occurred while executing com.android.build.gradle.internal.tasks.CheckAarMetadataWorkAction
> The minCompileSdk (31) specified in a
dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties)
is greater than this module's compileSdkVersion (android-30).
Dependency: androidx.window:window-java:1.0.0-beta04.
AAR metadata file: C:\Users\apoet\.gradle\caches\transforms-2\files-2.1\ad201fac15a88598107ec645f351f5b4\jetified-window-java-1.0.0-beta04\META-INF\com\android\build\gradle\aar-metadata.properties.
> A failure occurred while executing com.android.build.gradle.internal.tasks.CheckAarMetadataWorkAction
> The minCompileSdk (31) specified in a
dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties)
is greater than this module's compileSdkVersion (android-30).
Dependency: androidx.window:window:1.0.0-beta04.
AAR metadata file: C:\Users\apoet\.gradle\caches\transforms-2\files-2.1\03c633e46d75bfb21f082f0417f55161\jetified-window-1.0.0-beta04\META-INF\com\android\build\gradle\aar-metadata.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 5s
Exception: Gradle task assembleDebug failed with exit code 1
Exited (sigterm)
오류는 안뜨는데 에뮬레이터가 안되네요.
0
어떤 에러가 나는지 에러메시지를 알려주셔야 정확한 진단이 가능한데요.
아마 타입이 안 맞는다고 할 것 같습니다.
image_picker : 0.7.4 기준으로
우선 변경사항 확인하시고
https://github.com/junsuk5/flutter_insta_clon/commit/dc5583a035ac8ec5216a8c8df921ab0b72bf2898
완성 코드 비교 해 보시기 바랍니다.
https://github.com/junsuk5/flutter_insta_clon/blob/dc5583a035ac8ec5216a8c8df921ab0b72bf2898/lib/create_page.dart
최신 버전은 image_picker 0.8.5+3 이기 때문에 그 사이에 또 변경사항이 있을 수 있습니다. 최신 버전 적용시에는 공식 문서 확인해 보세요.
https://pub.dev/packages/image_picker
Null Safety 적용하여 진행중이시군요.
다음 코드를 참고하세요.
https://github.com/junsuk5/flutter_insta_clon/tree/null-safety
image_picker: ^0.8.4+4 기준입니다.
Null Safety 관련 내용이 챕터 7에 있으니 그 부분도 훑어보시면 좋겠네요.