我正在尝试为Tapkey Mobile SDK开发Flutter插件。
我设法通过修改插件的podspec和示例的Podfile添加了他们的SDK:
tapkey.podspec:
Pod::Spec.new do |s|
s.name = 'tapkey'
s.version = '0.0.1'
s.summary = 'A tapkey flutter plugin'
s.description = <<-DESC
A tapkey flutter plugin
DESC
s.homepage = 'http://example.com'
s.license = { :file => '../LICENSE' }
s.author = { 'Your Company' => 'email@example.com' }
s.source = { :path => '.' }
s.source_files = 'Classes/**/*'
s.dependency 'Flutter'
s.platform = :ios, '9.0'
s.dependency 'TapkeyMobileLib', '~> 2.5.10.0'
s.static_framework = true
# Flutter.framework does not contain a i386 slice. Only x86_64 simulators are supported.
s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'VALID_ARCHS[sdk=iphonesimulator*]' => 'x86_64' }
s.swift_version = '5.0'
end
Podfile:
platform :ios, '9.0'
source 'https://github.com/tapkey/TapkeyCocoaPods'
source 'https://github.com/CocoaPods/Specs.git'
# unmodified Podfile
但是,构建应用失败,并显示以下信息:
Running Xcode build...
Xcode build done. 26,4s
Failed to build iOS app
Error output from Xcode build:
2019-12-26 22:07:57.289 xcodebuild[57331:4745526] DTDeviceKit: deviceType from 1816565999a8254de93745cb449376c7b2946e65 was NULL
2019-12-26 22:07:57.441 xcodebuild[57331:4745803] DTDeviceKit: deviceType from 1816565999a8254de93745cb449376c7b2946e65 was NULL
** BUILD FAILED **
Xcode's output:
22 warnings generated.
<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "Headers/GsonPublicHeader.h"
^
/Users/zarbex/IdeaProjects/tapkey/example/ios/Pods/GsonJ2ObjC-Light/Gson.framework/Headers/GsonPublicHeader.h:1:10: note: in file included from /Users/zarbex/IdeaProjects/tapkey/example/ios/Pods/GsonJ2ObjC-Light/Gson.framework/Headers/GsonPublicHeader.h:1:
#include "$Gson$Preconditions.h"
^
/Users/zarbex/IdeaProjects/tapkey/example/ios/Pods/GsonJ2ObjC-Light/Gson.framework/Headers/$Gson$Preconditions.h:6:10: error: 'J2ObjC_header.h' file not found
#include "J2ObjC_header.h"
^
<unknown>:0: error: could not build Objective-C module 'Gson'
<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "Headers/TapkeyMobileLib.h"
^
/Users/zarbex/IdeaProjects/tapkey/example/ios/Pods/TapkeyMobileLib/TapkeyMobileLib.framework/Headers/TapkeyMobileLib.h:27:9: note: in file included from /Users/zarbex/IdeaProjects/tapkey/example/ios/Pods/TapkeyMobileLib/TapkeyMobileLib.framework/Headers/TapkeyMobileLib.h:27:
#import "CipherFactories.h"
^
note: Using new build system
note: Planning build
note: Constructing build description
Could not build the precompiled application for the device.
我看过几个类似的GitHub问题,但无法解决问题。