Repository navigation
Replies: 1 comment
|
I think two things in your setup are fighting the plugin. 1. Remove the manual AdMob pod. pod 'Google-Mobile-Ads-SDK', '~> 12.2.0'2. Don't start AdMob in AppDelegate. In SDK 12 the Swift API lost the GAD prefix, so WidgetsFlutterBinding.ensureInitialized();
await Firebase.initializeApp();
MobileAds.instance.initialize();3. Check Info.plist. iOS needs your AdMob app ID or the app crashes at launch: <key>GADApplicationIdentifier</key>
<string>ca-app-pub-XXXXXXXXXXXXXXXX~YYYYYYYYYY</string>Add the 4. Reinstall the pods cleanly: cd ios
pod deintegrate
rm -rf Pods Podfile.lock
pod install --repo-update
cd ..
flutter clean && flutter runIf it still fails after this, post the exact error from Xcode or |
Uh oh!
There was an error while loading. Please reload this page.
import UIKit
import Flutter
import FirebaseCore
import GoogleMobileAds
@main
@objc class AppDelegate: FlutterAppDelegate {
override func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
}
}
platform :ios, '13.0'
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
project 'Runner', {
'Debug' => :debug,
'Profile' => :release,
'Release' => :release,
}
FLUTTER_ROOT yolunu doğru biçimde bul
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. Run flutter pub get"
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
Flutter Pod Helper dosyasını çağır
require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
target 'Runner' do
use_frameworks! :linkage => :static
use_modular_headers!
Firebase ve AdMob SDK sürümleri
pod 'Firebase/Auth', '11.13.0'
pod 'Firebase/Core', '11.13.0'
pod 'Firebase/Firestore', '11.13.0'
pod 'Firebase/Messaging', '11.13.0'
pod 'Google-Mobile-Ads-SDK', '~> 12.2.0'
flutter_install_all_ios_pods(File.dirname(File.realpath(FILE)))
end
post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
end
ObjC bağımlılıkları için linker ayarı
installer.pods_project.build_configurations.each do |config|
config.build_settings['OTHER_LDFLAGS'] = '$(inherited) -ObjC'
end
end
name: voicememoai
description: "A new Flutter project."
publish_to: 'none'
version: 1.0.0+1
environment:
sdk: ">=3.8.0 <4.0.0"
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^1.0.8
google_fonts: ^6.2.1
particles_flutter: ^1.0.1
flutter_svg: ^2.1.0
record: ^6.0.0
speech_to_text: ^7.0.0
permission_handler: ^12.0.0+1
stop_watch_timer: ^3.2.2
audio_waveforms: ^1.3.0
firebase_core: ^3.14.0
cloud_firestore: ^5.6.8
firebase_auth: ^5.5.4
uuid: ^4.5.1
shared_preferences: ^2.5.3
intl: ^0.20.2
share_plus: ^11.0.0
path_provider: ^2.1.5
cross_file: ^0.3.4+2
flutter_localization: ^0.3.2
google_mobile_ads: ^6.0.0
dev_dependencies:
flutter_test:
sdk: flutter
flutter_lints: ^5.0.0
flutter_launcher_icons: ^0.13.1
flutter:
uses-material-design: true
assets:
- assets/background.svg
- assets/logo.png
- assets/pause.png
- assets/play-button.png
- assets/stop.png
- assets/notebook.png
- assets/watch.png
- assets/save.png
- assets/delete.png
- assets/mic.json
- assets/share.png
flutter_icons:
ios: true
android: false
image_path: "assets/logo.png"
All reactions