flutter export iOS problem 2

问题1:The Swift pod FirebaseCoreInternal depends upon GoogleUtilities, which does not define modules. To opt into those targets generating module maps (which is necessary to import them from Swift when building as static libraries)
参考

正如上图报错第三方库The Swift pod FirebaseCoreInternal depends upon GoogleUtilities,那么就在FirebaseCoreInternal和GoogleUtilities添加上:modular_headers => true即可
在你的ios项目文件夹中找到Podfile文件,找到target配置
例:
pod ‘FirebaseCoreInternal’,9.2.0, :modular_headers => true
pod ‘GoogleUtilities’,7.7.0, :modular_headers => true

insert image description here
Question 2: [!] 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 Target Support Files /Pods-Runner/Pods-Runner.profile.xcconfig or include the Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig in your build configuration (Flutter/Release.xcconfig).
Reference
[!] CocoaPods does not set the project base configuration because your project already has a custom configuration set. For the CocoaPods integration to work, set the base configuration of the target "Runner" to "target Support Files/Pods Runner/Pods-Runner.profile". xcconfig or include "Target Support Files/Pods Runner/Pods-Runner.profile". xcconfig is in build configuration (Flutter/Release.xcconf).
insert image description here
Release.xcconfig add:

#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"
#include "Generated.xcconfig"

Debug.xcconfig add:

#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
#include "Generated.xcconfig"

pod install again

pod instal

Analyzing dependencies
Downloading dependencies
Generating Pods project
Integrating client project
Pod installation complete! There are 27 dependencies from the Podfile and 35 total pods installed.

Question 3
Compiling for iOS xxx, but module 'xxx' 'has a minimum deployment target of iOS xxx Error solution
reference
Error reason:
The minimum running version of iphone or iPad setting is ios10.0, but the third-party library used, the minimum The operation is ios12.0, because the minimum requirement of the third-party library is higher than that of the iPhone or iPad, so the operation reports an error.
Solution:
1. Check the minimum ios version of the iphone iPad Target.
The target running version set by my iphone iPad is iOS 10.0. The viewing interface is as follows, select your own project, targets, and then General → Deployment Info → ios is set to 10.0. Now you need to set The third-party library in the pod is also set to 10.0 or below
insert image description here
2. Modify the target version of the third-party library in the pod
Click Pods in the left directory, select Targets → select the third-party library that reported the error → Deployment->IOS Deployment Target Change the previous 12.0 into 10.0, if you can't find it, just search in the search box. As shown in the figure below:
insert image description here
Because xcode 12 starts to set all third-party libraries to iOS12.0 by default, hold down shift to select all third-party libraries on the left, and then select 12.0, as shown in the figure below: Compile again and compile successfully
insert image description here
.

Question 4: 'flutter_vibrate/flutter_vibrate-Swift.h' file not found
Comment out the project's plugins
Go to Ios/Podfile and add the following lines:

platform :ios, '12.0'
use_frameworks!

target 'Runner' do
  use_frameworks!
end

Framework: It is actually a packaging method that packages the binary files, header files and related resource files of the library together for easy management and distribution.
CocoaPods controls whether to use Framework through use_frameworks.
If use_frameworks! is not used, the .a file will be generated using static libraries.
If you use use_frameworks!, the dynamic frameworks method will be used to generate the .framework file.
In pure oc projects, frameworks are generally not used, but the swift project imported by pod must use use_frameworks! , my flutter project is also a third-party library imported by pod, so use_frameworks must be added

Then perform
flutter clean cleaning,
delete the Podfile.lock file and re-run,
perform pod install installation, etc.

When encountering problems in flutter projects, the methods we use the most are:
1. Flutter clean;
2. File–Invalidate Caches / Restart–Invalidate and Restart in Android Studio, or AS restart;
3. Command+ in xcode Shift+K to clean up;
4. Re-plug the phone;
5. Restart the phone;
6. Restart the computer;
7. Restart xcode;
8. Delete the Podfile.lock file and run again;
9. Execute pod install, etc.

Fill in the data in faceBook,
right click info, open with code


Configure iOS 
Read through the "Getting Started with App Events for iOS" tutorial and in particular, follow step 5 by opening info.plist "As Source Code" and add the following

If your code does not have CFBundleURLTypes, add the following just before the final </dict> element:
<key>CFBundleURLTypes</key>
<array>
  <dict>
  <key>CFBundleURLSchemes</key>
  <array>
    <string>fb[APP_ID]</string>
  </array>
  </dict>
</array>
<key>FacebookAppID</key>
<string>[APP_ID]</string>
<key>FacebookClientToken</key>
<string>[CLIENT_TOKEN]</string>
<key>FacebookDisplayName</key>
<string>[APP_NAME]</string>

If your code already contains CFBundleURLTypes, insert the following:
<array>
 <dict>
 <key>CFBundleURLSchemes</key>
 <array>
   <string>fb[APP_ID]</string>
 </array>
 </dict>
</array>
<key>FacebookAppID</key>
<string>[APP_ID]</string>
<key>FacebookClientToken</key>
<string>[CLIENT_TOKEN]</string>
<key>FacebookDisplayName</key>
<string>[APP_NAME]</string>

Question 5: File not found: /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/arc/libarclite_iphoneos.a
reference

post_install do |installer|
  installer.generated_projects.each do |project|
    project.targets.each do |target|
      target.build_configurations.each do |config|
        config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.0'
      end
    end
  end

  installer.pods_project.targets.each do |target|
    flutter_additional_ios_build_settings(target)
  end
end

insert image description here
insert image description here
insert image description here
insert image description here
insert image description here
Question 6:
Failed to connect to developers.facebook.com port 443 after 75013 ms: Couldn't connect to server, there is a library that cannot be pulled from the server, and cannot be installed
for reference

Problem 7: Two versions of the library call the same library of a different version, and one of them lowers the version
reference

问题描述
Flutter的项目中引入了极光的两个插件jpush_flutter和jverify使用的核心模块JCore版本不一致,导致合并Podfile出现问题:
AdministratordeMacBook-Air:ios administrator$ pod install
/Users/administrator/VSCodeProjects/kiss_you_new/ios/Podfile:41: warning: ... at EOL, should be parenthesized?
Analyzing dependencies
[!] CocoaPods could not find compatible versions for pod "JCore":
  In Podfile:
    jpush_flutter (from `.symlinks/plugins/jpush_flutter/ios`) was resolved to 0.0.2, which depends on
      JCore (= 2.7.1)

    jverify (from `.symlinks/plugins/jverify/ios`) was resolved to 0.0.1, which depends on
      JCore (= 2.6.2)

    jverify (from `.symlinks/plugins/jverify/ios`) was resolved to 0.0.1, which depends on
      JVerification (= 2.7.5) was resolved to 2.7.5, which depends on
        JCore (< 6.0.0, >= 2.1.6)

解决
将jpush_flutter的JCore模块降级版本:

点开ios目录下.symlinks/plugins,打开jpush_flutter/ios/jpush_flutter.podspec文件,修改如下两行:
  s.version          = '0.0.1'

  s.dependency 'JCore','2.6.2'

insert image description here
Summary
Since the JCore version of the jverify plugin is inconsistent with the JCore version of jpush_flutter, the version of jpush_flutter and jverify can be appropriately reduced in the future. When I have time later, I will list the matching versions, so that there is no need to modify the podspec file.

Guess you like

Origin blog.csdn.net/weixin_44911775/article/details/132023189
Recommended