tdu-na / GitHub-Repository-Search-App

0 stars 0 forks source link

flutter run (macOSで)をしてもアプリが立ち上がらない。 #4

Open tdu-na opened 6 months ago

tdu-na commented 6 months ago

flutter runを実行して macOS を選択すると、次のエラーを出力する。(ユーザー名はuserとしてます。)


Connected devices:
macOS (desktop) • macos  • darwin-arm64   • macOS 14.3 23D2057 darwin-arm64
Chrome (web)    • chrome • web-javascript • Google Chrome 124.0.6367.119

Checking for wireless devices...

[1]: macOS (macos)
[2]: Chrome (chrome)
Please choose one (or "q" to quit): 1

Launching lib/main.dart on macOS in debug mode...
--- xcodebuild: WARNING: Using the first of multiple matching destinations:
{ platform:macOS, arch:arm64, id:00008122-001661D23E06001C }
{ platform:macOS, arch:x86_64, id:00008122-001661D23E06001C }
Invalid depfile: /Users/user/flutter-github-search/github_repo_search/.dart_tool/flutter_build/49a55db2c21567108b06f10af8770aad/kernel_s
napshot.d                                                                                                                                Invalid depfile: /Users/user/flutter-github-search/github_repo_search/.dart_tool/flutter_build/49a55db2c21567108b06f10af8770aad/kernel_s
napshot.d                                                                                                                                Error: Couldn't resolve the package 'flutter_bloc' in 'package:flutter_bloc/flutter_bloc.dart'.
lib/main.dart:2:8: Error: Not found: 'package:flutter_bloc/flutter_bloc.dart'
import 'package:flutter_bloc/flutter_bloc.dart';
       ^
lib/home_page.dart:2:8: Error: Not found: 'package:flutter_bloc/flutter_bloc.dart'
import 'package:flutter_bloc/flutter_bloc.dart';
       ^
lib/repo_search_bloc.dart:1:8: Error: Not found: 'package:flutter_bloc/flutter_bloc.dart'
import 'package:flutter_bloc/flutter_bloc.dart';
       ^
lib/services/data_repository.dart:1:8: Error: Error when reading 'lib/features/search/data/github_api_service.dart': No such file or dire
ctory                                                                                                                                    import 'package:github_repo_search/features/search/data/github_api_service.dart';
       ^
lib/services/data_repository.dart:2:8: Error: Error when reading 'lib/features/search/data/repo_data_model.dart': No such file or directo
ry                                                                                                                                       import 'package:github_repo_search/features/search/data/repo_data_model.dart';
       ^
lib/home_page.dart:3:8: Error: Error when reading 'lib/core/utils/constants/app_strings.dart': No such file or directory
import 'package:github_repo_search/core/utils/constants/app_strings.dart';
       ^
lib/search_page.dart:2:8: Error: Not found: 'package:flutter_bloc/flutter_bloc.dart'
import 'package:flutter_bloc/flutter_bloc.dart';
       ^
lib/search_page.dart:3:8: Error: Error when reading 'lib/core/utils/constants/app_strings.dart': No such file or directory
import 'package:github_repo_search/core/utils/constants/app_strings.dart';
       ^
lib/repo_search_state.dart:22:48: Error: Can't find '}' to match '{'.
class SearchErrorState extends RepoSearchState {
                                               ^
Error: Couldn't resolve the package 'equatable' in 'package:equatable/equatable.dart'.
lib/details_page.dart:4:8: Error: Error when reading 'lib/details_page_repository.dart': No such file or directory
import 'package:github_repo_search/details_page_repository.dart';
       ^
lib/search_page.dart:5:8: Error: Error when reading 'lib/features/search/presentation/bloc/repo_search_bloc.dart': No such file or direct
ory                                                                                                                                      import 'package:github_repo_search/features/search/presentation/bloc/repo_search_bloc.dart';
       ^
lib/search_page.dart:6:8: Error: Error when reading 'lib/features/search/presentation/bloc/repo_search_event.dart': No such file or direc
tory                                                                                                                                     import 'package:github_repo_search/features/search/presentation/bloc/repo_search_event.dart';
       ^
lib/search_page.dart:7:8: Error: Error when reading 'lib/features/search/presentation/bloc/repo_search_state.dart': No such file or direc
tory                                                                                                                                     import 'package:github_repo_search/features/search/presentation/bloc/repo_search_state.dart';
       ^
lib/search_page.dart:8:8: Error: Error when reading 'lib/features/search/presentation/pages/github_item.dart': No such file or directory
import 'package:github_repo_search/features/search/presentation/pages/github_item.dart';
       ^
lib/repo_search_state.dart:1:8: Error: Not found: 'package:equatable/equatable.dart'
import 'package:equatable/equatable.dart';
       ^
lib/services/data_repository.dart:5:15: Error: Type 'RepoDataModel' not found.
  Future<List<RepoDataModel>> getTrendingRepositories() => GithubApiService.getTrendingRepositories();
              ^^^^^^^^^^^^^
lib/services/data_repository.dart:7:15: Error: Type 'RepoDataModel' not found.
  Future<List<RepoDataModel>> getRepositoriesWithSearchQuery(String query) =>
              ^^^^^^^^^^^^^
lib/repo_search_bloc.dart:6:30: Error: Type 'Bloc' not found.
class RepoSearchBloc extends Bloc<RepoSearchEvent, RepoSearchState> {
                             ^^^^
lib/repo_search_state.dart:4:40: Error: Type 'Equatable' not found.
abstract class RepoSearchState extends Equatable {
                                       ^^^^^^^^^
lib/main.dart:10:5: Error: Method not found: 'BlocProvider'.
    BlocProvider<RepoSearchBloc>(
    ^^^^^^^^^^^^
lib/main.dart:24:13: Error: The method 'BlocProvider' isn't defined for the class 'MyApp'.
 - 'MyApp' is from 'package:github_repo_search/main.dart' ('lib/main.dart').
Try correcting the name to the name of an existing method, or defining a method named 'BlocProvider'.
      home: BlocProvider(
            ^^^^^^^^^^^^
lib/services/data_repository.dart:5:60: Error: The getter 'GithubApiService' isn't defined for the class 'DataRepository'.
 - 'DataRepository' is from 'package:github_repo_search/services/data_repository.dart' ('lib/services/data_repository.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'GithubApiService'.
  Future<List<RepoDataModel>> getTrendingRepositories() => GithubApiService.getTrendingRepositories();
                                                           ^^^^^^^^^^^^^^^^
lib/services/data_repository.dart:8:7: Error: The getter 'GithubApiService' isn't defined for the class 'DataRepository'.
 - 'DataRepository' is from 'package:github_repo_search/services/data_repository.dart' ('lib/services/data_repository.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'GithubApiService'.
      GithubApiService.getRepositoriesWithSearchQuery(query);
      ^^^^^^^^^^^^^^^^
lib/home_page.dart:21:15: Error: The method 'read' isn't defined for the class 'BuildContext'.
 - 'BuildContext' is from 'package:flutter/src/widgets/framework.dart' ('/usr/local/Caskroom/flutter/3.19.4/flutter/packages/flutter/lib/
src/widgets/framework.dart').                                                                                                            Try correcting the name to the name of an existing method, or defining a method named 'read'.
      context.read<RepoSearchBloc>().add(SearchRefreshRequested());
              ^^^^
lib/home_page.dart:29:21: Error: The getter 'AppStrings' isn't defined for the class '_HomeState'.
 - '_HomeState' is from 'package:github_repo_search/home_page.dart' ('lib/home_page.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'AppStrings'.
        title: Text(AppStrings.appBarTitleHome),
                    ^^^^^^^^^^
lib/home_page.dart:36:41: Error: The getter 'BlocProvider' isn't defined for the class '_HomeState'.
 - '_HomeState' is from 'package:github_repo_search/home_page.dart' ('lib/home_page.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'BlocProvider'.
                  builder: (context) => BlocProvider.value(
                                        ^^^^^^^^^^^^
lib/home_page.dart:38:25: Error: The getter 'BlocProvider' isn't defined for the class '_HomeState'.
 - '_HomeState' is from 'package:github_repo_search/home_page.dart' ('lib/home_page.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'BlocProvider'.
                        BlocProvider.of<RepoSearchBloc>(context, listen: false),
                        ^^^^^^^^^^^^
lib/home_page.dart:47:13: Error: The method 'BlocBuilder' isn't defined for the class '_HomeState'.
 - '_HomeState' is from 'package:github_repo_search/home_page.dart' ('lib/home_page.dart').
Try correcting the name to the name of an existing method, or defining a method named 'BlocBuilder'.
      body: BlocBuilder<RepoSearchBloc, RepoSearchState>(
            ^^^^^^^^^^^
lib/home_page.dart:74:37: Error: The getter 'AppStrings' isn't defined for the class '_HomeState'.
 - '_HomeState' is from 'package:github_repo_search/home_page.dart' ('lib/home_page.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'AppStrings'.
          return Center(child: Text(AppStrings.pullToRefresh));
                                    ^^^^^^^^^^
lib/repo_search_bloc.dart:9:47: Error: Too many positional arguments: 0 allowed, but 1 found.
Try removing the extra positional arguments.
  RepoSearchBloc(this._dataRepository) : super(SearchInitialState()) {
                                              ^
lib/repo_search_bloc.dart:10:5: Error: The method 'on' isn't defined for the class 'RepoSearchBloc'.
 - 'RepoSearchBloc' is from 'package:github_repo_search/repo_search_bloc.dart' ('lib/repo_search_bloc.dart').
Try correcting the name to the name of an existing method, or defining a method named 'on'.
    on<SearchQueryChanged>((event, emit) async {
    ^^
lib/repo_search_bloc.dart:16:25: Error: The getter 'name' isn't defined for the class 'Object?'.
 - 'Object' is from 'dart:core'.
Try correcting the name to the name of an existing getter, or defining a getter or field named 'name'.
            (a, b) => a.name.toLowerCase().compareTo(b.name.toLowerCase()));
                        ^^^^
lib/repo_search_bloc.dart:16:56: Error: The getter 'name' isn't defined for the class 'Object?'.
 - 'Object' is from 'dart:core'.
Try correcting the name to the name of an existing getter, or defining a getter or field named 'name'.
            (a, b) => a.name.toLowerCase().compareTo(b.name.toLowerCase()));
                                                       ^^^^
lib/repo_search_bloc.dart:23:5: Error: The method 'on' isn't defined for the class 'RepoSearchBloc'.
 - 'RepoSearchBloc' is from 'package:github_repo_search/repo_search_bloc.dart' ('lib/repo_search_bloc.dart').
Try correcting the name to the name of an existing method, or defining a method named 'on'.
    on<SearchRefreshRequested>((event, emit) async {
    ^^
lib/repo_search_bloc.dart:32:5: Error: The method 'on' isn't defined for the class 'RepoSearchBloc'.
 - 'RepoSearchBloc' is from 'package:github_repo_search/repo_search_bloc.dart' ('lib/repo_search_bloc.dart').
Try correcting the name to the name of an existing method, or defining a method named 'on'.
    on<ClearSearch>((event, emit) {
    ^^
lib/details_page.dart:14:11: Error: 'DetailsPageRepository' isn't a type.
    final DetailsPageRepository dataRepository = DetailsPageRepository();
          ^^^^^^^^^^^^^^^^^^^^^
lib/details_page.dart:14:50: Error: The method 'DetailsPageRepository' isn't defined for the class 'DetailsPage'.
 - 'DetailsPage' is from 'package:github_repo_search/details_page.dart' ('lib/details_page.dart').
Try correcting the name to the name of an existing method, or defining a method named 'DetailsPageRepository'.
    final DetailsPageRepository dataRepository = DetailsPageRepository();
                                                 ^^^^^^^^^^^^^^^^^^^^^
lib/search_page.dart:34:20: Error: 'RepoSearchBloc' isn't a type.
      context.read<RepoSearchBloc>().add(SearchQueryChanged(query));
                   ^^^^^^^^^^^^^^
lib/search_page.dart:36:20: Error: 'RepoSearchBloc' isn't a type.
      context.read<RepoSearchBloc>().add(ClearSearch());
                   ^^^^^^^^^^^^^^
lib/search_page.dart:34:15: Error: The method 'read' isn't defined for the class 'BuildContext'.
 - 'BuildContext' is from 'package:flutter/src/widgets/framework.dart' ('/usr/local/Caskroom/flutter/3.19.4/flutter/packages/flutter/lib/
src/widgets/framework.dart').                                                                                                            Try correcting the name to the name of an existing method, or defining a method named 'read'.
      context.read<RepoSearchBloc>().add(SearchQueryChanged(query));
              ^^^^
lib/search_page.dart:34:42: Error: The method 'SearchQueryChanged' isn't defined for the class '_SearchPageState'.
 - '_SearchPageState' is from 'package:github_repo_search/search_page.dart' ('lib/search_page.dart').
Try correcting the name to the name of an existing method, or defining a method named 'SearchQueryChanged'.
      context.read<RepoSearchBloc>().add(SearchQueryChanged(query));
                                         ^^^^^^^^^^^^^^^^^^
lib/search_page.dart:36:15: Error: The method 'read' isn't defined for the class 'BuildContext'.
 - 'BuildContext' is from 'package:flutter/src/widgets/framework.dart' ('/usr/local/Caskroom/flutter/3.19.4/flutter/packages/flutter/lib/
src/widgets/framework.dart').                                                                                                            Try correcting the name to the name of an existing method, or defining a method named 'read'.
      context.read<RepoSearchBloc>().add(ClearSearch());
              ^^^^
lib/search_page.dart:36:42: Error: The method 'ClearSearch' isn't defined for the class '_SearchPageState'.
 - '_SearchPageState' is from 'package:github_repo_search/search_page.dart' ('lib/search_page.dart').
Try correcting the name to the name of an existing method, or defining a method named 'ClearSearch'.
      context.read<RepoSearchBloc>().add(ClearSearch());
                                         ^^^^^^^^^^^
lib/search_page.dart:55:26: Error: 'RepoSearchBloc' isn't a type.
      body: BlocConsumer<RepoSearchBloc, RepoSearchState>(
                         ^^^^^^^^^^^^^^
lib/search_page.dart:55:42: Error: 'RepoSearchState' isn't a type.
      body: BlocConsumer<RepoSearchBloc, RepoSearchState>(
                                         ^^^^^^^^^^^^^^^
lib/search_page.dart:57:24: Error: 'SearchErrorState' isn't a type.
          if (state is SearchErrorState) {
                       ^^^^^^^^^^^^^^^^
lib/search_page.dart:65:24: Error: 'SearchLoadingState' isn't a type.
          if (state is SearchLoadingState) {
                       ^^^^^^^^^^^^^^^^^^
lib/search_page.dart:67:31: Error: 'SearchLoadedState' isn't a type.
          } else if (state is SearchLoadedState) {
                              ^^^^^^^^^^^^^^^^^
lib/search_page.dart:82:31: Error: 'SearchErrorState' isn't a type.
          } else if (state is SearchErrorState) {
                              ^^^^^^^^^^^^^^^^
lib/search_page.dart:48:23: Error: The getter 'AppStrings' isn't defined for the class '_SearchPageState'.
 - '_SearchPageState' is from 'package:github_repo_search/search_page.dart' ('lib/search_page.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'AppStrings'.
            hintText: AppStrings.searchHintText,
                      ^^^^^^^^^^
lib/search_page.dart:55:13: Error: The method 'BlocConsumer' isn't defined for the class '_SearchPageState'.
 - '_SearchPageState' is from 'package:github_repo_search/search_page.dart' ('lib/search_page.dart').
Try correcting the name to the name of an existing method, or defining a method named 'BlocConsumer'.
      body: BlocConsumer<RepoSearchBloc, RepoSearchState>(
            ^^^^^^^^^^^^
lib/search_page.dart:63:39: Error: The getter 'AppStrings' isn't defined for the class '_SearchPageState'.
 - '_SearchPageState' is from 'package:github_repo_search/search_page.dart' ('lib/search_page.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'AppStrings'.
            return Center(child: Text(AppStrings.typeToSearch));
                                      ^^^^^^^^^^
lib/search_page.dart:72:24: Error: The method 'GithubItem' isn't defined for the class '_SearchPageState'.
 - '_SearchPageState' is from 'package:github_repo_search/search_page.dart' ('lib/search_page.dart').
Try correcting the name to the name of an existing method, or defining a method named 'GithubItem'.
                return GithubItem(
                       ^^^^^^^^^^
lib/search_page.dart:85:37: Error: The getter 'AppStrings' isn't defined for the class '_SearchPageState'.
 - '_SearchPageState' is from 'package:github_repo_search/search_page.dart' ('lib/search_page.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'AppStrings'.
          return Center(child: Text(AppStrings.typeToSearch));
                                    ^^^^^^^^^^
Unhandled exception:
FileSystemException(uri=org-dartlang-untranslatable-uri:package%3Aflutter_bloc%2Fflutter_bloc.dart; message=StandardFileSystem only suppo
rts file:* and data:* URIs)                                                                                                              #0      StandardFileSystem.entityForUri (package:front_end/src/api_prototype/standard_file_system.dart:34)
#1      asFileUri (package:vm/kernel_front_end.dart:748)
#2      writeDepfile (package:vm/kernel_front_end.dart:886)
<asynchronous suspension>
#3      FrontendCompiler.compile (package:frontend_server/frontend_server.dart:673)
<asynchronous suspension>
#4      starter (package:frontend_server/starter.dart:101)
<asynchronous suspension>
#5      main (file:///Volumes/Work/s/w/ir/x/w/sdk/pkg/frontend_server/bin/frontend_server_starter.dart:13)
<asynchronous suspension>

Target kernel_snapshot failed: Exception

Command PhaseScriptExecution failed with a nonzero exit code
** BUILD FAILED **

Building macOS application...                                           
Error: Build process failed
tdu-na commented 6 months ago

Error: Couldn't resolve the package 'flutter_bloc' in 'package:flutter_bloc/flutter_bloc.dart'. とか、ディレクトリ階層のせいで、悪さをしている気がする。