swchrm logs

妄想技術録

【Flutter】#import <cloud_firestore/CloudFirestorePlugin.h>がError部として出力されるケースの処置

症状

MyMacBookAir:traveling_jirorian_problem_flutter swchrm$ flutter run
Launching lib/main.dart on {hogehoge} の iPhone in debug mode...
Automatically signing iOS for device deployment using specified development team in Xcode project: 7L3X9G2952
Starting Xcode build...
 ├─Assembling Flutter resources...                    3.5s

 └─Compiling, linking and signing...                  1.1s

Xcode build done.                                            8.2s
Failed to build iOS app
Error output from Xcode build:
↳
    ** BUILD FAILED **


Xcode's output:
↳
    /Users/swchrm/Documents/MyProject/traveling_jirorian_problem_flutter/ios/Runner/GeneratedPluginRegistrant.m:6:9: fatal error:
    'cloud_firestore/CloudFirestorePlugin.h' file not found
    #import <cloud_firestore/CloudFirestorePlugin.h>
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    1 error generated.

Could not build the precompiled application for the device.

Error launching application on {hogehoge} の iPhone.
 3.6s

原因

flutter runを実行する中でpod installをしてくれるにもかかわらず、別でpod installを行ってしまっていた。
これにより、flutter run時にすでにPodfile(もしくはPodfile.lock)ができてしまい、flutter run時のpod installでインストールされるはずのFirestoreのプラグインが入らなかった。

対処法

一度Podfile、Podfile.lock、Podsを削除して、flutter runpod installを行う。

flutter run時のError, "Could not build the precompiled application for the device. " の対処

症状

after flutter run, below messagse appeared.

Could not build the precompiled application for the device.
It appears that your application still contains the default signing identifier. Try replacing 'com.example' with your signing id in Xcode: open ios/Runner.xcworkspace
Error launching application on hogehoge の iPhone.

処置

change bundle ID.
ex:com.example.hogehoge -> com.example.hugahuga

ambrのβ版で遊んできた

ambrとは

OculusGoで利用できるソーシャルVR(のアプリ)。
現在βテストを実施中で、そのテストユーザーとして利用させていただきました。

ようす

かんそう

世界観がかわいかった…。

みんなで「はじめまして〜!」「なんて呼べばいいんですか??」というやりとりをした。
メイプルストーリーをはじめてやった小4のときの気持ちを思い出したよ。エモ。

ちなみに私は「すわ」でも「くろま」でもそのままでもなんでもよいです。

【CocoaPods】一度pod installしたプラグインを、Podfileから消せば再install時に削除されるか否か

知りたいこと

Podfileで以前にpod {hoge}を記述しpod installしたライブラリなどは、その際に書いたpod {hoge}を削除して再pod installすれば消えてくれるのか

結論

消せず、残る。

背景

Firebase for Flutter
を実施中、ビルドエラーの原因を勘違いしてマニュアル外であるPodfileの操作を誤って行ってしまったため。

検証

下記Podfile中のpod 'Firebase/Core'を削除したい。

削除前

Podsの中

BoringSSL               FirebaseAuthInterop     FirebaseInstanceID      Headers                 Protobuf                leveldb-library
Firebase                FirebaseCore            GTMSessionFetcher       Local Podspecs          Target Support Files    nanopb
FirebaseAnalytics       FirebaseDatabase        GoogleAppMeasurement    Manifest.lock           gRPC-C++
FirebaseAuth            FirebaseFirestore       GoogleUtilities         Pods.xcodeproj          gRPC-Core

FirebaseCore が消えるかどうか。

Podfileで以前追記したpod 'Firebase/Core'を消す。

# Uncomment this line to define a global platform for your project
# platform :ios, '9.0'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'

project 'Runner', {
  'Debug' => :debug,
  'Profile' => :release,
  'Release' => :release,
}

def parse_KV_file(file, separator='=')
  file_abs_path = File.expand_path(file)
  if !File.exists? file_abs_path
    return [];
  end
  pods_ary = []
  skip_line_start_symbols = ["#", "/"]
  File.foreach(file_abs_path) { |line|
      next if skip_line_start_symbols.any? { |symbol| line =~ /^\s*#{symbol}/ }
      plugin = line.split(pattern=separator)
      if plugin.length == 2
        podname = plugin[0].strip()
        path = plugin[1].strip()
        podpath = File.expand_path("#{path}", file_abs_path)
        pods_ary.push({:name => podname, :path => podpath});
      else
        puts "Invalid plugin specification: #{line}"
      end
  }
  return pods_ary
end

target 'Runner' do
  # Prepare symlinks folder. We use symlinks to avoid having Podfile.lock
  # referring to absolute paths on developers' machines.
  system('rm -rf .symlinks')
  system('mkdir -p .symlinks/plugins')

  # Flutter Pods
  generated_xcode_build_settings = parse_KV_file('./Flutter/Generated.xcconfig')
  if generated_xcode_build_settings.empty?
    puts "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter packages get is executed first."
  end
  generated_xcode_build_settings.map { |p|
    if p[:name] == 'FLUTTER_FRAMEWORK_DIR'
      symlink = File.join('.symlinks', 'flutter')
      File.symlink(File.dirname(p[:path]), symlink)
      pod 'Flutter', :path => File.join(symlink, File.basename(p[:path]))
    end
  }

  # Plugin Pods
  plugin_pods = parse_KV_file('../.flutter-plugins')
  plugin_pods.map { |p|
    symlink = File.join('.symlinks', 'plugins', p[:name])
    File.symlink(p[:path], symlink)
    pod p[:name], :path => File.join(symlink, 'ios')
    pod 'Firebase/Core'
  }
end

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['ENABLE_BITCODE'] = 'NO'
    end
  end
end

削除後、pod isntallを実行。

実行結果

Analyzing dependencies
Fetching podspec for `Flutter` from `.symlinks/flutter/ios`
Fetching podspec for `cloud_firestore` from `.symlinks/plugins/cloud_firestore/ios`
Fetching podspec for `firebase_core` from `.symlinks/plugins/firebase_core/ios`
Downloading dependencies
Using BoringSSL (10.0.6)
Using Firebase (5.14.0)
Using FirebaseAnalytics (5.4.0)
Using FirebaseAuth (5.1.0)
Using FirebaseAuthInterop (1.0.0)
Using FirebaseCore (5.1.9)
Using FirebaseDatabase (5.0.4)
Using FirebaseFirestore (0.16.0)
Using FirebaseInstanceID (3.3.0)
Using Flutter (1.0.0)
Using GTMSessionFetcher (1.2.1)
Using GoogleAppMeasurement (5.4.0)
Using GoogleUtilities (5.3.6)
Using Protobuf (3.6.1)
Using cloud_firestore (0.0.1)
Using firebase_core (0.0.1)
Using gRPC-C++ (0.0.5)
Using gRPC-Core (1.14.0)
Using leveldb-library (1.20)
Using nanopb (0.3.901)
Generating Pods project
Integrating client project
Pod installation complete! There are 3 dependencies from the Podfile and 20 total pods installed.

[!] Automatically assigning platform `ios` with version `8.0` on target `Runner` because no platform was specified. Please specify a platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`.

[!] CocoaPods did not set the base configuration of your project because your project already has a custom config set. In order for CocoaPods integration to work at all, please either set the base configurations of the target `Runner` to `Pods/Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig` or include the `Pods/Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig` in your build configuration (`Flutter/Release.xcconfig`).

今回はfirebase_coreがインストールされていない。

pod 'Firebase/Core'を追加したときの実行ログ。
firebase_coreがインストールされている。

Analyzing dependencies
Fetching podspec for `Flutter` from `.symlinks/flutter/ios`
Fetching podspec for `cloud_firestore` from `.symlinks/plugins/cloud_firestore/ios`
Fetching podspec for `firebase_core` from `.symlinks/plugins/firebase_core/ios`
Downloading dependencies
Using BoringSSL (10.0.6)
Using Firebase (5.14.0)
Using FirebaseAnalytics (5.4.0)
Using FirebaseAuth (5.1.0)
Using FirebaseAuthInterop (1.0.0)
Using FirebaseCore (5.1.9)
Using FirebaseDatabase (5.0.4)
Using FirebaseFirestore (0.16.0)
Using FirebaseInstanceID (3.3.0)
Using Flutter (1.0.0)
Using GTMSessionFetcher (1.2.1)
Using GoogleAppMeasurement (5.4.0)
Using GoogleUtilities (5.3.6)
Using Protobuf (3.6.1)
Using cloud_firestore (0.0.1)
Using firebase_core (0.0.1)
Using gRPC-C++ (0.0.5)
Using gRPC-Core (1.14.0)
Using leveldb-library (1.20)
Using nanopb (0.3.901)
Generating Pods project
Integrating client project
Pod installation complete! There are 4 dependencies from the Podfile and 20 total pods installed.

[!] Automatically assigning platform `ios` with version `8.0` on target `Runner` because no platform was specified. Please specify a platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`.

[!] CocoaPods did not set the base configuration of your project because your project already has a custom config set. In order for CocoaPods integration to work at all, please either set the base configurations of the target `Runner` to `Pods/Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig` or include the `Pods/Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig` in your build configuration (`Flutter/Release.xcconfig`).

削除・再インストール後

Podsの中

BoringSSL               FirebaseAuthInterop     FirebaseInstanceID      Headers                 Protobuf                leveldb-library
Firebase                FirebaseCore            GTMSessionFetcher       Local Podspecs          Target Support Files    nanopb
FirebaseAnalytics       FirebaseDatabase        GoogleAppMeasurement    Manifest.lock           gRPC-C++
FirebaseAuth            FirebaseFirestore       GoogleUtilities         Pods.xcodeproj          gRPC-Core

変わりませんでした。

理由

未検証

感想

まぁそうでしょうね。

以上

【Vue.js】Module not found: Error: Can't resolve './vue-temp/vue-editor-bridge' 

症状

Module not found: Error: Can't resolve './vue-temp/vue-editor-bridge'
となる

処方箋

余分にimportしている

'./vue-temp/vue-editor-bridge'
を削除する。

いつimportされたか謎…

終わり