title: Flutter project not running after successful migration to null safety
body: <p>I have problem running flutter project after successful migration to null safety. I use android studio. Here is the result of flutter doctor:</p>
  <pre><code>Doctor summary (to see all details, run flutter doctor -v):
  [√] Flutter (Channel stable, 2.2.1, on Microsoft Windows [Version 10.0.19041.985], locale en-US)
  [√] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
  [√] Chrome - develop for the web
  [√] Android Studio (version 4.1.0)
  [√] Connected device (3 available)
  
  • No issues found!
  </code></pre>
  <p>And here is the result of outdated dependency checks:</p>
  <pre><code>See https://dart.dev/go/null-safety-migration for a migration guide.
  
  Analyzing project...
  [-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\]
  All sources appear to be already migrated.  Nothing to do.
  </code></pre>
  <p>However, I get an error caused by a dependency (not used directly in my pubspec.yaml, but seems one of the packages is using it and this dependency has no null safety updated). So when I try to run it from android studio I get the following output (even though dart migrate should have mention even internal packages dependencies since it might be a stopper from running):</p>
  <pre><code>Launching lib\main.dart on Android SDK built for x86 in debug mode...
  Running Gradle task 'assembleDebug'...
  Error: Cannot run with sound null safety, because the following dependencies
  don't support null safety:
  
   - package:tinycolor
  
  For solutions, see https://dart.dev/go/unsound-null-safety
  lib/screens/invitations_screen.dart:115:5: Warning: Operand of null-aware operation '?.' has type 'TabController' which excludes null.
   - 'TabController' is from 'package:flutter/src/material/tab_controller.dart' ('/D:/Flutter/flutterV1.0.0.0/packages/flutter/lib/src/material/tab_controller.dart').
      _c1?.dispose();
      ^
  /D:/Flutter/flutterV1.0.0.0/.pub-cache/hosted/pub.dartlang.org/flutter_datetime_picker-1.5.1/lib/flutter_datetime_picker.dart:311:32: Warning: Operand of null-aware operation '??' has type 'Color' which excludes null.
   - 'Color' is from 'dart:ui'.
                    color: theme.backgroundColor ?? Colors.white,
                                 ^
  
  
  FAILURE: Build failed with an exception.
  
  * Where:
  Script 'D:\Flutter\flutterV1.0.0.0\packages\flutter_tools\gradle\flutter.gradle' line: 1035
  
  * What went wrong:
  Execution failed for task ':app:compileFlutterBuildDebug'.
  &gt; Process 'command 'D:\Flutter\flutterV1.0.0.0\bin\flutter.bat'' finished with non-zero exit value 1
  
  * 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 23s
  Exception: Gradle task assembleDebug failed with exit code 1
  </code></pre>
  <p>So I tried finally to run without sound-null-safety, but still an error keeps happening (I tried flutter clean --&gt; Invalidate Caches/Restart --&gt; pub get --&gt; flutter run --no-sound-null-safety but still the same problem):</p>
  <pre><code>Using hardware rendering with device Android SDK built for x86. If you notice graphics artifacts, consider enabling software rendering with &quot;--enable-software-rendering&quot;.
  Launching lib\main.dart on Android SDK built for x86 in debug mode...
  Running Gradle task 'assembleDebug'...
  Running Gradle task 'assembleDebug'... Done                        22.1s
  √  Built build\app\outputs\flutter-apk\app-debug.apk.
  Error connecting to the service protocol: failed to connect to http://127.0.0.1:57596/NxvUCmZt3sM=/
  </code></pre>
  <p>Note: Before the last trial of restarting android studio, this last error also showed an exception  right before the &quot;Error connecting ...&quot; statement, and the exception was as I recall (sorry don't have the full stack trace as it doesn't show anymore):</p>
  <p>androidx WindowInsetsCompat ---&gt; NullPointerException on Preconditions.checkNonNull</p>
  <p><strong>EDIT</strong>
  After going through dependencies in a new porject as suggested by @Taur, it turns out the problem when running without sound-null-safety was caused by flutter_typeahead dependency throwing the previously mentioned exception when I run the project:</p>
  <pre><code>E/AndroidRuntime(11173): java.lang.ExceptionInInitializerError
  E/AndroidRuntime(11173):    at androidx.core.view.WindowInsetsCompat.&lt;clinit&gt;(WindowInsetsCompat.java:82)
  E/AndroidRuntime(11173):    at androidx.core.view.WindowInsetsCompat.toWindowInsetsCompat(WindowInsetsCompat.java:169)
  E/AndroidRuntime(11173):    at androidx.core.view.ViewCompat$Api21Impl$1.onApplyWindowInsets(ViewCompat.java:4753)
  E/AndroidRuntime(11173):    at android.view.View.dispatchApplyWindowInsets(View.java:9799)
  E/AndroidRuntime(11173):    at android.view.ViewGroup.dispatchApplyWindowInsets(ViewGroup.java:7076)
  E/AndroidRuntime(11173):    at android.view.ViewGroup.dispatchApplyWindowInsets(ViewGroup.java:7080)
  E/AndroidRuntime(11173):    at android.view.ViewGroup.dispatchApplyWindowInsets(ViewGroup.java:7080)
  E/AndroidRuntime(11173):    at android.view.ViewRootImpl.dispatchApplyInsets(ViewRootImpl.java:1632)
  E/AndroidRuntime(11173):    at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1734)
  E/AndroidRuntime(11173):    at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1443)
  E/AndroidRuntime(11173):    at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7125)
  E/AndroidRuntime(11173):    at android.view.Choreographer$CallbackRecord.run(Choreographer.java:935)
  E/AndroidRuntime(11173):    at android.view.Choreographer.doCallbacks(Choreographer.java:747)
  E/AndroidRuntime(11173):    at android.view.Choreographer.doFrame(Choreographer.java:682)
  E/AndroidRuntime(11173):    at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:921)
  E/AndroidRuntime(11173):    at android.os.Handler.handleCallback(Handler.java:873)
  E/AndroidRuntime(11173):    at android.os.Handler.dispatchMessage(Handler.java:99)
  E/AndroidRuntime(11173):    at android.os.Looper.loop(Looper.java:164)
  E/AndroidRuntime(11173):    at android.app.ActivityThread.main(ActivityThread.java:6649)
  E/AndroidRuntime(11173):    at java.lang.reflect.Method.invoke(Native Method)
  E/AndroidRuntime(11173):    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
  E/AndroidRuntime(11173):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:826)
  E/AndroidRuntime(11173): Caused by: java.lang.NullPointerException
  E/AndroidRuntime(11173):    at androidx.core.util.Preconditions.checkNotNull(Preconditions.java:119)
  E/AndroidRuntime(11173):    at androidx.core.view.WindowInsetsCompat.toWindowInsetsCompat(WindowInsetsCompat.java:169)
  E/AndroidRuntime(11173):    at androidx.core.view.WindowInsetsCompat.toWindowInsetsCompat(WindowInsetsCompat.java:149)
  E/AndroidRuntime(11173):    at androidx.core.view.WindowInsetsCompat$BuilderImpl20.build(WindowInsetsCompat.java:1706)
  E/AndroidRuntime(11173):    at androidx.core.view.WindowInsetsCompat$Builder.build(WindowInsetsCompat.java:1588)
  E/AndroidRuntime(11173):    at androidx.core.view.WindowInsetsCompat$Impl.&lt;clinit&gt;(WindowInsetsCompat.java:748)
  E/AndroidRuntime(11173):    ... 22 more 
  </code></pre>