강의

멘토링

커뮤니티

Inflearn Community Q&A

kkl0709's profile image
kkl0709

asked

[Code Factory] [Intermediate] Flutter Real Practice! State Management, Cache Management, Code Generation, GoRouter, Authentication Logic, etc. Essential Skills to Become an Intermediate!

리버팟 패키지가 import가 안되는 것 같습니다...

Written on

·

472

0

스크린샷 2023-01-06 오전 9.44.54.png
이렇게 뜨는데 왜이럴까요 ...ㅠㅠ

에러 메시지는 정확히

lib/riverpot/state_provier_screen.dart:1:8: Error: Error when reading '../../../Documents/libraries/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_riverpod-2.1.3/lib/flutter_riverpod.dart/': Not a directory

import "package:flutter_riverpod/flutter_riverpod.dart/";

^

lib/riverpot/state_provier_screen.dart:3:24: Error: Method not found: 'StateProvider'.

final numberProvider = StateProvider<int>((ref) => 0);

^^^^^^^^^^^^^

FAILURE: Build failed with an exception.

* Where:

Script '/Users/kimkinam/Documents/libraries/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 1159

* What went wrong:

Execution failed for task ':app:compileFlutterBuildDebug'.

> Process 'command '/Users/kimkinam/Documents/libraries/flutter/bin/flutter'' finished with non-zero exit value 1

* 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 6s

Exception: Gradle task assembleDebug failed with exit code 1

 

이렇게 뜹니다.

Flutter하이브리드 앱

Answer 1

0

codefactory님의 프로필 이미지
codefactory
Instructor

안녕하세요!

import를 잘못하셨네요.

임포트 패키지명 끝에 슬래시를 추가하셨습니다

kkl0709's profile image
kkl0709

asked

Ask a question