1

After i add Firebase to my flutter project both android and IOS app not working . here is the error ,

Note-IOS does installing the app , but shows only white blank screen

Android

e: /Users/capt.nizam/.gradle/caches/transforms-2/files-2.1/00446b2c2a7eae3f618598721af19725/jetified-firebase-analytics-ktx-20.0.0-api.jar!/META-INF/java.com.google.android.libraries.firebase.firebase_analytics_ktx_granule.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':app:compileDebugKotlin'.

Compilation error. See log for more details

  • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 12s Exception: Gradle task assembleDebug failed with exit code 1

And IOS APP

Debug service listening on ws://127.0.0.1:61461/6M_23sVQpSg=/ws

Syncing files to device iPhone 13 Pro Max... [VERBOSE-2:ui_dart_state.cc(209)] Unhandled Exception: Null check operator used on a null value #0 MethodChannel.binaryMessenger (package:flutter/src/services/platform_channel.dart:121:86) #1 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:146:36) #2 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:329:12) #3 MethodChannel.invokeListMethod (package:flutter/src/services/platform_channel.dart:342:41) #4 MethodChannelFirebase._initializeCore (package:firebase_core_platform_interface/src/method_channel/method_channel_firebase.dart:31:37) #5 MethodChannelFirebase.initializeApp (package:firebase_core_platform_interface/src/method_channel/method_channel_firebase.dart:73:13) #6 Firebase.initializeApp (package:firebase_core/src/firebase.dart:42:47) #7 main (package:ipqb/main.dart:7:18) #8 _runMainZoned.. (dart:ui/hooks.dart:145:25) #9 _rootRun (dart:async/zone.d<…>

I followed everything in the docs. i tried multiple time , even checked in a new project i am facing same error !

  • Hi Mohammed, Your exception stack will be easier for others to read if you put it in a `code` section. Is the error happening during the build, test, packaging, or deployment phase? Does the error explanation in the stack dump make any sense: `Unhandled Exception: Null check operator used on a null value`? Is the source of the exception in your code or in a third-party library? Hope these questions help get you closer to finding the cause. Good luck. – devdanke Dec 01 '21 at 12:48
  • Does this answer your question? [Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15](https://stackoverflow.com/questions/67699823/module-was-compiled-with-an-incompatible-version-of-kotlin-the-binary-version-o) – snakecharmerb Dec 04 '21 at 15:20

1 Answers1

2

The solution to this problem is to ensure that when initializing firebase in your project, ensure you include the "name" parameter of your project. See the example below.

Future<void> main() async {


WidgetsFlutterBinding.ensureInitialized();

  await Firebase.initializeApp(
    name: 'firebase-project-name',
    options: DefaultFirebaseOptions.currentPlatform,
  );
}
stan
  • 51
  • 8
  • This worked for me. Followed the doc here https://firebase.google.com/docs/flutter/setup?platform=ios and it was just showing a blank screen without the name... Thanks Stan ! – schankam Mar 24 '23 at 21:03