Skip to content

Commit c70e66a

Browse files
fix(firebase_crashlytics): [core/duplicate-app] exception when running the example (#8991)
* Use Firebase configurations from `GoogleService.json` * Add generated `Podfile` * Add updated `AppFrameworkInfo.plist` * Add updated `Info.pllist` * Run iOS
1 parent 037e3a5 commit c70e66a

File tree

7 files changed

+71
-32
lines changed

7 files changed

+71
-32
lines changed

packages/firebase_crashlytics/firebase_crashlytics/example/ios/Flutter/AppFrameworkInfo.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@
2121
<key>CFBundleVersion</key>
2222
<string>1.0</string>
2323
<key>MinimumOSVersion</key>
24-
<string>8.0</string>
24+
<string>9.0</string>
2525
</dict>
2626
</plist>
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Uncomment this line to define a global platform for your project
2+
# platform :ios, '9.0'
3+
4+
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
5+
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
6+
7+
project 'Runner', {
8+
'Debug' => :debug,
9+
'Profile' => :release,
10+
'Release' => :release,
11+
}
12+
13+
def flutter_root
14+
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
15+
unless File.exist?(generated_xcode_build_settings_path)
16+
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
17+
end
18+
19+
File.foreach(generated_xcode_build_settings_path) do |line|
20+
matches = line.match(/FLUTTER_ROOT\=(.*)/)
21+
return matches[1].strip if matches
22+
end
23+
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
24+
end
25+
26+
require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
27+
28+
flutter_ios_podfile_setup
29+
30+
target 'Runner' do
31+
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
32+
end
33+
34+
post_install do |installer|
35+
installer.pods_project.targets.each do |target|
36+
flutter_additional_ios_build_settings(target)
37+
end
38+
end

packages/firebase_crashlytics/firebase_crashlytics/example/ios/Runner.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
archiveVersion = 1;
44
classes = {
55
};
6-
objectVersion = 46;
6+
objectVersion = 50;
77
objects = {
88

99
/* Begin PBXBuildFile section */
@@ -170,7 +170,7 @@
170170
97C146E61CF9000F007C117D /* Project object */ = {
171171
isa = PBXProject;
172172
attributes = {
173-
LastUpgradeCheck = 0910;
173+
LastUpgradeCheck = 1300;
174174
ORGANIZATIONNAME = "The Chromium Authors";
175175
TargetAttributes = {
176176
97C146ED1CF9000F007C117D = {

packages/firebase_crashlytics/firebase_crashlytics/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/firebase_crashlytics/firebase_crashlytics/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0910"
3+
LastUpgradeVersion = "1300"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

packages/firebase_crashlytics/firebase_crashlytics/example/ios/Runner/Info.plist

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,7 @@
4141
</array>
4242
<key>UIViewControllerBasedStatusBarAppearance</key>
4343
<false/>
44+
<key>CADisableMinimumFrameDurationOnPhone</key>
45+
<true/>
4446
</dict>
4547
</plist>

packages/firebase_crashlytics/firebase_crashlytics/example/lib/firebase_options.dart

Lines changed: 26 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -38,42 +38,41 @@ class DefaultFirebaseOptions {
3838
}
3939

4040
static const FirebaseOptions android = FirebaseOptions(
41-
apiKey: 'AIzaSyCdRjCVZlhrq72RuEklEyyxYlBRCYhI2Sw',
42-
appId: '1:406099696497:android:0f3f7bfe78b8b7103574d0',
43-
messagingSenderId: '406099696497',
44-
projectId: 'flutterfire-e2e-tests',
45-
databaseURL:
46-
'https://flutterfire-e2e-tests-default-rtdb.europe-west1.firebasedatabase.app',
47-
storageBucket: 'flutterfire-e2e-tests.appspot.com',
41+
apiKey: 'AIzaSyAHAsf51D0A407EklG1bs-5wA7EbyfNFg0',
42+
appId: '1:448618578101:ios:3d7b3d90894e689eac3efc',
43+
messagingSenderId: '448618578101',
44+
projectId: 'react-native-firebase-testing',
45+
databaseURL: 'https://react-native-firebase-testing.firebaseio.com',
46+
storageBucket: 'react-native-firebase-testing.appspot.com',
4847
);
4948

5049
static const FirebaseOptions ios = FirebaseOptions(
51-
apiKey: 'AIzaSyDooSUGSf63Ghq02_iIhtnmwMDs4HlWS6c',
52-
appId: '1:406099696497:ios:1d042a17c4dd64323574d0',
53-
messagingSenderId: '406099696497',
54-
projectId: 'flutterfire-e2e-tests',
55-
databaseURL:
56-
'https://flutterfire-e2e-tests-default-rtdb.europe-west1.firebasedatabase.app',
57-
storageBucket: 'flutterfire-e2e-tests.appspot.com',
50+
apiKey: 'AIzaSyAHAsf51D0A407EklG1bs-5wA7EbyfNFg0',
51+
appId: '1:448618578101:ios:3d7b3d90894e689eac3efc',
52+
messagingSenderId: '448618578101',
53+
projectId: 'react-native-firebase-testing',
54+
databaseURL: 'https://react-native-firebase-testing.firebaseio.com',
55+
storageBucket: 'react-native-firebase-testing.appspot.com',
5856
androidClientId:
59-
'406099696497-tvtvuiqogct1gs1s6lh114jeps7hpjm5.apps.googleusercontent.com',
57+
'448618578101-velutq65ok2dr5ohh0oi1q62irr920ss.apps.googleusercontent.com',
6058
iosClientId:
61-
'406099696497-epk7902e2mb4pj4i4gcotk4q7dp2i9h3.apps.googleusercontent.com',
62-
iosBundleId: 'io.flutter.plugins.firebase.crashlytics.example',
59+
'448618578101-54jhd806d0tr4vkgode0b4fi8iruvjpn.apps.googleusercontent.com',
60+
iosBundleId:
61+
'io.flutter.plugins.firebase.crashlytics.firebaseCrashlyticsExample',
6362
);
6463

6564
static const FirebaseOptions macos = FirebaseOptions(
66-
apiKey: 'AIzaSyDooSUGSf63Ghq02_iIhtnmwMDs4HlWS6c',
67-
appId: '1:406099696497:ios:1d042a17c4dd64323574d0',
68-
messagingSenderId: '406099696497',
69-
projectId: 'flutterfire-e2e-tests',
70-
databaseURL:
71-
'https://flutterfire-e2e-tests-default-rtdb.europe-west1.firebasedatabase.app',
72-
storageBucket: 'flutterfire-e2e-tests.appspot.com',
65+
apiKey: 'AIzaSyAHAsf51D0A407EklG1bs-5wA7EbyfNFg0',
66+
appId: '1:448618578101:ios:3d7b3d90894e689eac3efc',
67+
messagingSenderId: '448618578101',
68+
projectId: 'react-native-firebase-testing',
69+
databaseURL: 'https://react-native-firebase-testing.firebaseio.com',
70+
storageBucket: 'react-native-firebase-testing.appspot.com',
7371
androidClientId:
74-
'406099696497-tvtvuiqogct1gs1s6lh114jeps7hpjm5.apps.googleusercontent.com',
72+
'448618578101-velutq65ok2dr5ohh0oi1q62irr920ss.apps.googleusercontent.com',
7573
iosClientId:
76-
'406099696497-epk7902e2mb4pj4i4gcotk4q7dp2i9h3.apps.googleusercontent.com',
77-
iosBundleId: 'io.flutter.plugins.firebase.crashlytics.example',
74+
'448618578101-54jhd806d0tr4vkgode0b4fi8iruvjpn.apps.googleusercontent.com',
75+
iosBundleId:
76+
'io.flutter.plugins.firebase.crashlytics.firebaseCrashlyticsExample',
7877
);
7978
}

0 commit comments

Comments
 (0)