0

I recently upgraded my Flutter SDK from 3.32.7 → 3.35.0. Since then, my app works fine in debug mode, but crashes on launch in release mode with the following stacktrace:

FATAL EXCEPTION: main
E/AndroidRuntime(28502): Process: com.hexaview.app, PID: 28502
E/AndroidRuntime(28502): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.hexaview.app/com.hexaview.app.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void Z2.j.D(java.lang.String, w7.d)' on a null object reference
E/AndroidRuntime(28502):        at o.k.D(Unknown Source:4)
E/AndroidRuntime(28502):        at w7.q.b(Unknown Source:33)
E/AndroidRuntime(28502):        at o7.a.<init>(SourceFile:18)
E/AndroidRuntime(28502):        at o.k.<init>(SourceFile:7)
E/AndroidRuntime(28502):        at n7.c.<init>(SourceFile:15)
E/AndroidRuntime(28502):        at n7.g.a(Unknown Source:85)
E/AndroidRuntime(28502):        at m7.c.onCreate(Unknown Source:252)

What I’ve tried

Works fine on Flutter 3.32.7 (no crash in release mode).

Happens only after upgrading to 3.35.0.

Debug build works fine.

Updated settings.gradle:

id "com.android.application" version "8.6.0" apply false
id "org.jetbrains.kotlin.android" version "2.0.0" apply false
id "com.google.gms.google-services" version "4.4.2" apply false
id "com.google.firebase.crashlytics" version "3.0.2" apply false

Updated Gradle wrapper:

distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip

Ran flutter clean, ./gradlew clean, and rebuilt — still the same crash.

flutter doctor -v                
[✓] Flutter (Channel stable, 3.35.4, on macOS 26.0 25A354 darwin-arm64, locale en-IN) [250ms]
    • Flutter version 3.35.4 on channel stable at /Users/shashankjain/src/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision d693b4b9db (2 weeks ago), 2025-09-16 14:27:41 +0000
    • Engine revision c298091351
    • Dart version 3.9.2
    • DevTools version 2.48.0
    • Feature flags: enable-web, enable-linux-desktop, enable-macos-desktop, enable-windows-desktop, enable-android, enable-ios, cli-animations, enable-lldb-debugging

[✓] Android toolchain - develop for Android devices (Android SDK version 36.0.0) [1,041ms]
    • Android SDK at /Users/shashankjain/Library/Android/sdk
    • Emulator version 36.1.9.0 (build_id 13823996) (CL:N/A)
    • Platform android-36, build-tools 36.0.0
    • Java binary at: /Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/bin/java
      This JDK is specified in your Flutter configuration.
      To change the current JDK, run: `flutter config --jdk-dir="path/to/jdk"`.
    • Java version Java(TM) SE Runtime Environment (build 17.0.6+9-LTS-190)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 26.0.1) [767ms]
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 17A400
    • CocoaPods version 1.16.2

[✓] Chrome - develop for the web [7ms]
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2025.1) [7ms]
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 21.0.6+-13391695-b895.109)

[✓] VS Code (version 1.104.2) [6ms]
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.120.0

[✓] Connected device (3 available) [6.1s]
    • Redmi Note 9 Pro (mobile) • 2c48028 • android-arm64  • Android 12 (API 31)
    • macOS (desktop)           • macos   • darwin-arm64   • macOS 26.0 25A354 darwin-arm64
    • Chrome (web)              • chrome  • web-javascript • Google Chrome 140.0.7339.208
    ! Error: Browsing on the local area network for Shashank’s iPhone. Ensure the device is unlocked and attached with a cable or associated with the same local area network as this Mac.
      The device must be opted into Developer Mode to connect wirelessly. (code -27)

[✓] Network resources [1,051ms]
    • All expected network resources are available.


0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.