gpt4 book ai didi

ios - Flutter:由于集成了 firebase 和 Admob,无法构建 iOS 应用程序

转载 作者:行者123 更新时间:2023-12-04 13:54:12 27 4
gpt4 key购买 nike

我使用 AdMob,所以我不得不在我的项目中包含 firebase。
我觉得 Podfile 有问题,但我对 flutter 很陌生,我不知道如何解决这个错误。
在我添加 Admob 之前,该应用程序运行良好。
一开始我只是通过添加 Jason 文件而不更改 Podfiles 和应用程序委托(delegate)数据来集成 Firebase。
但是该应用程序总是显示找不到 _firapp 或某事的错误,所以我做了一些研究并准备了应用程序 deleagte 中的 Podfile 和行以用于 firebase und admob,现在没有任何工作了。
运行应用程序时,日志显示:

Launching lib/main.dart on iPhone 11 Pro Max in debug mode...
Running Xcode build...
Xcode build done. 102,8s
Failed to build iOS app
Error output from Xcode build:

2021-01-03 20:31:10.214 xcodebuild[33146:1683247] warning: The file reference for "Firebase.debug.xcconfig" is a member of multiple groups ("Support Files" and "Support Files"); this indicates a malformed project. Only the membership in one of the groups will be preserved (but membership in targets will be unaffected). If you want a reference to the same file in more than one group, please add another reference to the same path.
2021-01-03 20:31:10.214 xcodebuild[33146:1683247] warning: The file reference for "Firebase.release.xcconfig" is a member of multiple groups ("Support Files" and "Support Files"); this indicates a malformed project. Only the membership in one of the groups will be preserved (but membership in targets will be unaffected). If you want a reference to the same file in more than one group, please add another reference to the same path.
2021-01-03 20:31:10.218 xcodebuild[33146:1683247] warning: The file reference for "GoogleUtilities.debug.xcconfig" is a member of multiple groups ("Support Files" and "Support Files"); this indicates a malformed project. Only the membership in one of the groups will be preserved (but membership in targets will be unaffected). If you want a reference to the same file in more than one group, please add another reference to the same path.
2021-01-03 20:31:10.218 xcodebuild[33146:1683247] warning: The file reference for "GoogleUtilities.release.xcconfig" is a member of multiple groups ("Support Files" and "Support Files"); this indicates a malformed project. Only the membership in one of the groups will be preserved (but membership in targets will be unaffected). If you want a reference to the same file in more than one group, please add another reference to the same path.
2021-01-03 20:32:28.128 xcodebuild[33146:1683564] DVTAssertions: Warning in /Library/Caches/com.apple.xbs/Sources/DVTiOSFrameworks/DVTiOSFrameworks-17705/DTDeviceKitBase/DTDKRemoteDeviceData.m:371
Details: (null) deviceType from fccbabe047ce389d7f1818829974b98ca79ecafb was NULL when -platform called.
Object: <DTDKMobileDeviceToken: 0x7fac7d3bdad0>
Method: -platform
Thread: <NSThread: 0x7fac7a40e4f0>{number = 7, name = (null)}
Please file a bug at https://feedbackassistant.apple.com with this warning message and any useful information you can provide.
** BUILD FAILED **


Xcode's output:

GoogleDataTransport-hjetnganqxhhsyasdefxkgubodfu
In file included from /Users/patrickmeyer/AndroidStudioProjects/thirty_day_challange_app/ios/Pods/FirebaseCore/FirebaseCore/Sources/FIRHeartbeatInfo.m:17:
/Users/patrickmeyer/AndroidStudioProjects/thirty_day_challange_app/ios/Pods/FirebaseCore/GoogleUtilities/Logger/Private/GULLogger.h:22:9: fatal error: 'GoogleUtilities/GULLoggerLevel.h' file not found
#import <GoogleUtilities/GULLoggerLevel.h>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
In file included from /Users/patrickmeyer/AndroidStudioProjects/thirty_day_challange_app/ios/Pods/FirebaseCore/FirebaseCore/Sources/FIRLogger.m:19:
/Users/patrickmeyer/AndroidStudioProjects/thirty_day_challange_app/ios/Pods/FirebaseCore/GoogleUtilities/Logger/Private/GULLogger.h:22:9: fatal error: 'GoogleUtilities/GULLoggerLevel.h' file not found
#import <GoogleUtilities/GULLoggerLevel.h>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
GoogleDataTransport-hjetnganqxhhsyasdefxkgubodfu
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Constructing build description
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.3.99. (in target 'FirebaseCore' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.3.99. (in target 'FirebaseCoreDiagnostics' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.3.99. (in target 'firebase_core' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.3.99. (in target 'Firebase' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 4.3, but the range of supported deployment target versions is 9.0 to 14.3.99. (in target 'nanopb' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.3.99. (in target 'share' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.3.99. (in target 'firebase_admob' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 6.0, but the range of supported deployment target versions is 9.0 to 14.3.99. (in target 'GoogleInterchangeUtilities' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 7.0, but the range of supported deployment target versions is 9.0 to 14.3.99. (in target 'FirebaseInstanceID' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 6.0, but the range of supported deployment target versions is 9.0 to 14.3.99. (in target 'GoogleSymbolUtilities' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.3.99. (in target 'GoogleAppMeasurement' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.3.99. (in target 'GoogleDataTransport' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.3.99. (in target 'GoogleUtilities' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 7.0, but the range of supported deployment target versions is 9.0 to 14.3.99. (in target 'FirebaseAnalytics' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.3.99. (in target 'Flutter' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.3.99. (in target 'shared_preferences' from project 'Pods')

Could not build the application for the simulator.
Error launching application on iPhone 11 Pro Max.
我的 AppDelegate.m :
#import "AppDelegate.h"
#import "GeneratedPluginRegistrant.h"

@import Firebase;
@import GoogleMobileAds;

@implementation AppDelegate

- (BOOL)application:(UIApplication *)application
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[GeneratedPluginRegistrant registerWithRegistry:self];
// Use Firebase library to configure APIs.
[FIRApp configure];
// Initialize the Google Mobile Ads SDK.
[[GADMobileAds sharedInstance] startWithCompletionHandler:nil];
// Override point for customization after application launch.
return [super application:application didFinishLaunchingWithOptions:launchOptions];
}
@end
还有我的 Podfile:
# 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 flutter_root
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
unless File.exist?(generated_xcode_build_settings_path)
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
end

File.foreach(generated_xcode_build_settings_path) do |line|
matches = line.match(/FLUTTER_ROOT\=(.*)/)
return matches[1].strip if matches
end
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
end

require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)

flutter_ios_podfile_setup

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

# add the Firebase pod for Google Analytics
pod 'Firebase/Analytics'
# add pods for any other desired Firebase products
# https://firebase.google.com/docs/ios/setup#available-pods

pod 'Google-Mobile-Ads-SDK'

post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
end
end
我的 Flutter Doctor 没有显示任何错误。

最佳答案

好像pod update成功了。
它现在正在运行。

关于ios - Flutter:由于集成了 firebase 和 Admob,无法构建 iOS 应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65554558/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com