2022-06-09 flutter 报错Showing All

2022-06-09  本文已影响0人  我是小胡胡分胡

target 'Runner' do
 use_frameworks!
  flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))

  pod 'FlutterPluginRegistrant', :path => File.join('Flutter', 'FlutterPluginRegistrant'), :inhibit_warnings => true
end

android studio那边运行 模拟器报错:
报错了:

    truncated or malformed object (offset field plus size field of section 1 in LC_SEGMENT_64 command 0 extends past the end of the file)truncated or malformed object (offset field plus size field of section 1 in LC_SEGMENT_64 command 0 extends past the end of the file)In file included from <built-in>:1:
    /Volumes/xx/xxx/xxxx/.ios/Pods/Target Support Files/FMDB/FMDB-prefix.pch:2:2: fatal error: file '/Users/xxx/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/YZ8U7SJEE558/UIKit-1V5UHAPTOD24G.pcm' is not a valid precompiled module file
    #import <UIKit/UIKit.h>
     ^
    1 error generated.

到xcod这边编译运行,错误提示是:

Showing All Errors Only
/xxxx/.ios/Pods/Target Support Files/FMDB/FMDB-prefix.pch:2:2: File '/Users/xxx/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/YZ8U7SJEE558/UIKit-1V5UHAPTOD24G.pcm' is not a valid precompiled module file

image.png

那看来就是sqflite插件问题:
看看插件podspec:

#
# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html
#
Pod::Spec.new do |s|
  s.name             = 'sqflite'
  s.version          = '0.0.2'
  s.summary          = 'SQLite plugin.'
  s.description      = <<-DESC
Accss SQLite database.
                       DESC
  s.homepage         = 'https://github.com/tekartik/sqflite'
  s.license          = { :file => '../LICENSE' }
  s.author           = { 'Tekartik' => 'alex@tekartik.com' }
  s.source           = { :path => '.' }
  s.source_files = 'Classes/**/*'
  s.public_header_files = 'Classes/**/*.h'
  s.dependency 'Flutter'
  s.dependency 'FMDB', '>= 2.7.5'

  s.platform = :ios, '9.0'
  s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'VALID_ARCHS[sdk=iphonesimulator*]' => 'x86_64' }
end


那么改一下podfile

use_frameworks!

注释调这行,可以了

改成
use_frameworks! :linkage => :static 报错
改成
use_frameworks! :linkage => :dynamic
同样报错。

什么情况?

为什么这里必须要注释调# use_frameworks!

上一篇下一篇

猜你喜欢

热点阅读