Skip to content

Commit

Permalink
add crashlytics
Browse files Browse the repository at this point in the history
  • Loading branch information
cp-sidhdhi-p committed Jun 14, 2024
1 parent c3b72d9 commit cf506d8
Show file tree
Hide file tree
Showing 18 changed files with 124 additions and 52 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/android_build.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
name: Android Build APK

on:
workflow_dispatch:
push:
branches:
- main
#on:
# workflow_dispatch:
# push:
# branches:
# - main

on: push

jobs:

Expand Down
12 changes: 7 additions & 5 deletions .github/workflows/android_deploy.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
name: Publish to Google Play Store

on:
push:
branches:
- main
workflow_dispatch:
#on:
# push:
# branches:
# - main
# workflow_dispatch:

on: push

jobs:

Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/ios_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,8 @@ jobs:
buildName="${versionValue[0]}.${versionValue[1]}.${{ github.run_number }}"
echo "Generating iOS build $buildName $buildNumber"
flutter build ipa --release --build-number=$buildNumber --build-name=$buildName --export-options-plist=$HOME/export_options.plist
# echo "Uploading dSYM to Crashlytics"
# ios/Pods/FirebaseCrashlytics/upload-symbols -gsp ios/Runner/GoogleService-Info.plist -p ios /ios/archive/kelo.xcarchive/dSYMs

echo "Uploading dSYM to Crashlytics"
ios/Pods/FirebaseCrashlytics/upload-symbols -gsp ios/Runner/GoogleService-Info.plist -p ios build/ios/archive/Runner.xcarchive/dSYMs
- name: Publish the app to App Store Connect
run: |
Expand Down
2 changes: 1 addition & 1 deletion khelo/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ android {
applicationId "com.canopas.khelo"
// You can update the following values to match your application needs.
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
minSdkVersion 21
minSdkVersion 23
targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
Expand Down
56 changes: 56 additions & 0 deletions khelo/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -963,6 +963,9 @@ PODS:
- FirebaseAuth (~> 10.27.0)
- Firebase/CoreOnly (10.27.0):
- FirebaseCore (= 10.27.0)
- Firebase/Crashlytics (10.27.0):
- Firebase/CoreOnly
- FirebaseCrashlytics (~> 10.27.0)
- Firebase/Firestore (10.27.0):
- Firebase/CoreOnly
- FirebaseFirestore (~> 10.27.0)
Expand All @@ -976,6 +979,10 @@ PODS:
- firebase_core (3.0.0):
- Firebase/CoreOnly (= 10.27.0)
- Flutter
- firebase_crashlytics (4.0.0):
- Firebase/Crashlytics (= 10.27.0)
- firebase_core
- Flutter
- firebase_storage (12.0.0):
- Firebase/Storage (= 10.27.0)
- firebase_core
Expand All @@ -997,6 +1004,15 @@ PODS:
- FirebaseCore (~> 10.0)
- FirebaseCoreInternal (10.27.0):
- "GoogleUtilities/NSData+zlib (~> 7.8)"
- FirebaseCrashlytics (10.27.0):
- FirebaseCore (~> 10.5)
- FirebaseInstallations (~> 10.0)
- FirebaseRemoteConfigInterop (~> 10.23)
- FirebaseSessions (~> 10.5)
- GoogleDataTransport (~> 9.2)
- GoogleUtilities/Environment (~> 7.8)
- nanopb (< 2.30911.0, >= 2.30908.0)
- PromisesObjC (~> 2.1)
- FirebaseFirestore (10.27.0):
- FirebaseCore (~> 10.0)
- FirebaseCoreExtension (~> 10.0)
Expand All @@ -1017,6 +1033,21 @@ PODS:
- gRPC-Core (~> 1.62.0)
- leveldb-library (~> 1.22)
- nanopb (< 2.30911.0, >= 2.30908.0)
- FirebaseInstallations (10.27.0):
- FirebaseCore (~> 10.0)
- GoogleUtilities/Environment (~> 7.8)
- GoogleUtilities/UserDefaults (~> 7.8)
- PromisesObjC (~> 2.1)
- FirebaseRemoteConfigInterop (10.27.0)
- FirebaseSessions (10.27.0):
- FirebaseCore (~> 10.5)
- FirebaseCoreExtension (~> 10.0)
- FirebaseInstallations (~> 10.0)
- GoogleDataTransport (~> 9.2)
- GoogleUtilities/Environment (~> 7.13)
- GoogleUtilities/UserDefaults (~> 7.13)
- nanopb (< 2.30911.0, >= 2.30908.0)
- PromisesSwift (~> 2.1)
- FirebaseSharedSwift (10.27.0)
- FirebaseStorage (10.27.0):
- FirebaseAppCheckInterop (~> 10.0)
Expand All @@ -1031,6 +1062,10 @@ PODS:
- fluttertoast (0.0.2):
- Flutter
- Toast
- GoogleDataTransport (9.4.1):
- GoogleUtilities/Environment (~> 7.7)
- nanopb (< 2.30911.0, >= 2.30908.0)
- PromisesObjC (< 3.0, >= 1.2)
- GoogleUtilities/AppDelegateSwizzler (7.13.3):
- GoogleUtilities/Environment
- GoogleUtilities/Logger
Expand All @@ -1053,6 +1088,9 @@ PODS:
- GoogleUtilities/Reachability (7.13.3):
- GoogleUtilities/Logger
- GoogleUtilities/Privacy
- GoogleUtilities/UserDefaults (7.13.3):
- GoogleUtilities/Logger
- GoogleUtilities/Privacy
- "gRPC-C++ (1.62.5)":
- "gRPC-C++/Implementation (= 1.62.5)"
- "gRPC-C++/Interface (= 1.62.5)"
Expand Down Expand Up @@ -1149,6 +1187,8 @@ PODS:
- Flutter
- FlutterMacOS
- PromisesObjC (2.4.0)
- PromisesSwift (2.4.0):
- PromisesObjC (= 2.4.0)
- RecaptchaInterop (100.0.0)
- shared_preferences_foundation (0.0.1):
- Flutter
Expand All @@ -1164,6 +1204,7 @@ DEPENDENCIES:
- device_info_plus (from `.symlinks/plugins/device_info_plus/ios`)
- firebase_auth (from `.symlinks/plugins/firebase_auth/ios`)
- firebase_core (from `.symlinks/plugins/firebase_core/ios`)
- firebase_crashlytics (from `.symlinks/plugins/firebase_crashlytics/ios`)
- firebase_storage (from `.symlinks/plugins/firebase_storage/ios`)
- Flutter (from `Flutter`)
- flutter_timezone (from `.symlinks/plugins/flutter_timezone/ios`)
Expand All @@ -1186,17 +1227,23 @@ SPEC REPOS:
- FirebaseCore
- FirebaseCoreExtension
- FirebaseCoreInternal
- FirebaseCrashlytics
- FirebaseFirestore
- FirebaseFirestoreInternal
- FirebaseInstallations
- FirebaseRemoteConfigInterop
- FirebaseSessions
- FirebaseSharedSwift
- FirebaseStorage
- GoogleDataTransport
- GoogleUtilities
- "gRPC-C++"
- gRPC-Core
- GTMSessionFetcher
- leveldb-library
- nanopb
- PromisesObjC
- PromisesSwift
- RecaptchaInterop
- Toast
- TOCropViewController
Expand All @@ -1210,6 +1257,8 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/firebase_auth/ios"
firebase_core:
:path: ".symlinks/plugins/firebase_core/ios"
firebase_crashlytics:
:path: ".symlinks/plugins/firebase_crashlytics/ios"
firebase_storage:
:path: ".symlinks/plugins/firebase_storage/ios"
Flutter:
Expand Down Expand Up @@ -1239,20 +1288,26 @@ SPEC CHECKSUMS:
Firebase: 26b040b20866a55f55eb3611b9fcf3ae64816b86
firebase_auth: 17ce83d25a062b2a594e5dfce91a4ad36e3739d5
firebase_core: 5926464bbb028fef87d2443369b73ada2a8a3608
firebase_crashlytics: fd7d916778823b47ca742a7cbd552c9520da1f1c
firebase_storage: ff66671828d524fc9e36f30cd7ed1909036324c7
FirebaseAppCheckInterop: 0dd062c9926a76332ca5711dbed6f1a9ac540b54
FirebaseAuth: 77a012b7e08042bf44d0db835ca2e86e6ca7bbd3
FirebaseAuthInterop: 0344acef098654eaf59f6add4c93254349bc5de4
FirebaseCore: a2b95ae4ce7c83ceecfbbbe3b6f1cddc7415a808
FirebaseCoreExtension: 4ec89dd0c6de93d6becde32122d68b7c35f6bf5d
FirebaseCoreInternal: 4b297a2d56063dbea2c1d0d04222d44a8d058862
FirebaseCrashlytics: 81ea6ec96519388687f6061beb838a8eec482293
FirebaseFirestore: 7169b75e7db8f9796d4130e3c2157ed444f100d4
FirebaseFirestoreInternal: 7ba63f170a554ae49392da44f9430e5b7915a7ff
FirebaseInstallations: 766dabca09fd94aef922538aaf144cc4a6fb6869
FirebaseRemoteConfigInterop: c55a739f5ab121792776e191d9fd437dc624a541
FirebaseSessions: 2fdf949f9e58295a57703ae8f2efc44f9fa3aa16
FirebaseSharedSwift: a03fe7a59ee646fef71099a887f774fe25d745b8
FirebaseStorage: 255526c3d04c49874d7a5e3886964a79f77d6f33
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
flutter_timezone: ffb07bdad3c6276af8dada0f11978d8a1f8a20bb
fluttertoast: e9a18c7be5413da53898f660530c56f35edfba9c
GoogleDataTransport: 6c09b596d841063d76d4288cc2d2f42cc36e1e2a
GoogleUtilities: ea963c370a38a8069cc5f7ba4ca849a60b6d7d15
"gRPC-C++": e725ef63c4475d7cdb7e2cf16eb0fde84bd9ee51
gRPC-Core: eee4be35df218649fe66d721a05a7f27a28f069b
Expand All @@ -1264,6 +1319,7 @@ SPEC CHECKSUMS:
package_info_plus: 58f0028419748fad15bf008b270aaa8e54380b1c
path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46
PromisesObjC: f5707f49cb48b9636751c5b2e7d227e43fba9f47
PromisesSwift: 9d77319bbe72ebf6d872900551f7eeba9bce2851
RecaptchaInterop: 7d1a4a01a6b2cb1610a47ef3f85f0c411434cb21
shared_preferences_foundation: fcdcbc04712aee1108ac7fda236f363274528f78
sqflite: 673a0e54cc04b7d6dba8d24fb8095b31c3a99eec
Expand Down
2 changes: 1 addition & 1 deletion khelo/ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -718,7 +718,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.canopas.khelo;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "provision-khelo-distribution-2024-05-16";
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "provision-khelo-distribution-2024-06-12";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_VERSION = 5.0;
VERSIONING_SYSTEM = "apple-generic";
Expand Down
16 changes: 16 additions & 0 deletions khelo/ios/Runner/AppDelegate.swift
Original file line number Diff line number Diff line change
@@ -1,13 +1,29 @@
import UIKit
import Flutter
import Firebase
import FirebaseAuth

@UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate {
override func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
FirebaseApp.configure()
GeneratedPluginRegistrant.register(with: self)
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
}

override func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
let firebaseAuth = Auth.auth()
firebaseAuth.setAPNSToken(deviceToken, type: AuthAPNSTokenType.unknown)
}

override func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) {
let firebaseAuth = Auth.auth()
if (firebaseAuth.canHandleNotification(userInfo)){
print(userInfo)
return
}
}
}
2 changes: 1 addition & 1 deletion khelo/ios/Runner/ExportOptions.plist
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<string>74a6f92b-75d4-4c72-b610-435ae643721f</string>
</dict>
<key>signingCertificate</key>
<string>1EDB213DC565912BC6BC866ADEBF192575C633DC</string>
<string>Apple Distribution</string>
<key>signingStyle</key>
<string>manual</string>
<key>stripSwiftSymbols</key>
Expand Down
1 change: 1 addition & 0 deletions khelo/ios/Runner/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
<key>CFBundleURLSchemes</key>
<array>
<string>app-1-753506519474-ios-8cd38557e090c0b51e7cab</string>
<string>com.googleusercontent.apps.753506519474-6qolf71653023s197ur4ag97q2lvaf9r</string>
</array>
</dict>
</array>
Expand Down
2 changes: 1 addition & 1 deletion khelo/ios/Runner/RunnerRelease.entitlements
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
<plist version="1.0">
<dict>
<key>aps-environment</key>
<string>development</string>
<string>unknown</string>
</dict>
</plist>
3 changes: 2 additions & 1 deletion khelo/lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:data/storage/provider/preferences_provider.dart';
import 'package:firebase_crashlytics/firebase_crashlytics.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:firebase_core/firebase_core.dart';
Expand All @@ -20,7 +21,7 @@ Future<ProviderContainer> _initContainer() async {
);

if (!kDebugMode) {
// await FirebaseCrashlytics.instance.setCrashlyticsCollectionEnabled(true);
await FirebaseCrashlytics.instance.setCrashlyticsCollectionEnabled(true);
}

final prefs = await SharedPreferences.getInstance();
Expand Down
3 changes: 1 addition & 2 deletions khelo/lib/ui/flow/my_game/my_game_tab_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,7 @@ class _MyGameTabScreenState extends ConsumerState<MyGameTabScreen>
return LargeIconButton(
backgroundColor: context.colorScheme.primary,
onTap: () async {
// AppRoute.addMatch().push(context);
// FirebaseCrashlytics.instance.crash();
AppRoute.addMatch().push(context);
},
icon: Icon(
Icons.add_rounded,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'package:canopas_country_picker/canopas_country_picker.dart';
import 'package:data/service/auth/auth_service.dart';
import 'package:data/service/device/device_service.dart';
import 'package:firebase_crashlytics/firebase_crashlytics.dart';
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:freezed_annotation/freezed_annotation.dart';
Expand Down Expand Up @@ -67,9 +68,9 @@ class SignInWithPhoneViewNotifier extends StateNotifier<SignInWithPhoneState> {
state = state.copyWith(verifying: false, signInSuccess: true);
},
onVerificationFailed: (error) {
// FirebaseCrashlytics.instance.recordError(error, error.stackTrace,
// reason: "Verify Phone-Number Error",
// information: [error.statusCode ?? "", error.message ?? ""]);
FirebaseCrashlytics.instance.recordError(error, error.stackTrace,
reason: "Verify Phone-Number Error",
information: [error.statusCode ?? "", error.message ?? ""]);
state = state.copyWith(verifying: false, actionError: error);
debugPrint(
"SignInWithPhoneViewNotifier: error in verifyPhoneNumber -> $error");
Expand All @@ -78,10 +79,12 @@ class SignInWithPhoneViewNotifier extends StateNotifier<SignInWithPhoneState> {
state = state.copyWith(
verificationId: verificationId, verifying: false);
});
} catch (e) {
state = state.copyWith(verifying: false, actionError: e);
} catch (error, stack) {
FirebaseCrashlytics.instance
.recordError(error, stack, reason: "Verify Phone-Number Error");
state = state.copyWith(verifying: false, actionError: error);
debugPrint(
"SignInWithPhoneViewNotifier: error in verifyPhoneNumber -> $e");
"SignInWithPhoneViewNotifier: error in verifyPhoneNumber -> $error");
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions khelo/macos/Flutter/GeneratedPluginRegistrant.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import device_info_plus
import file_selector_macos
import firebase_auth
import firebase_core
import firebase_crashlytics
import firebase_storage
import flutter_timezone
import package_info_plus
Expand All @@ -23,6 +24,7 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
FileSelectorPlugin.register(with: registry.registrar(forPlugin: "FileSelectorPlugin"))
FLTFirebaseAuthPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseAuthPlugin"))
FLTFirebaseCorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseCorePlugin"))
FLTFirebaseCrashlyticsPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseCrashlyticsPlugin"))
FLTFirebaseStoragePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseStoragePlugin"))
FlutterTimezonePlugin.register(with: registry.registrar(forPlugin: "FlutterTimezonePlugin"))
FPPPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FPPPackageInfoPlusPlugin"))
Expand Down
19 changes: 0 additions & 19 deletions khelo/macos/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,6 @@
33CC10EB2044A3C60003C045 /* Resources */,
33CC110E2044A8840003C045 /* Bundle Framework */,
3399D490228B24CF009A79C7 /* ShellScript */,
419246AC32827AD35B79802B /* FlutterFire: "flutterfire upload-crashlytics-symbols" */,
);
buildRules = (
);
Expand Down Expand Up @@ -333,24 +332,6 @@
shellPath = /bin/sh;
shellScript = "\"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh && touch Flutter/ephemeral/tripwire";
};
419246AC32827AD35B79802B /* FlutterFire: "flutterfire upload-crashlytics-symbols" */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
);
name = "FlutterFire: \"flutterfire upload-crashlytics-symbols\"";
outputFileListPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\n#!/bin/bash\nPATH=${PATH}:$FLUTTER_ROOT/bin:$HOME/.pub-cache/bin\nflutterfire upload-crashlytics-symbols --upload-symbols-script-path=$PODS_ROOT/FirebaseCrashlytics/upload-symbols --platform=macos --apple-project-path=${SRCROOT} --env-platform-name=${PLATFORM_NAME} --env-configuration=${CONFIGURATION} --env-project-dir=${PROJECT_DIR} --env-built-products-dir=${BUILT_PRODUCTS_DIR} --env-dwarf-dsym-folder-path=${DWARF_DSYM_FOLDER_PATH} --env-dwarf-dsym-file-name=${DWARF_DSYM_FILE_NAME} --env-infoplist-path=${INFOPLIST_PATH} --default-config=default\n";
};
/* End PBXShellScriptBuildPhase section */

/* Begin PBXSourcesBuildPhase section */
Expand Down
Loading

0 comments on commit cf506d8

Please sign in to comment.