Repository: flutter
Issue: ios: flutter run --release: flutter crash on first app from tutorial; log asks that an issue be filed.
Labels: tool,team-tool

### Steps to reproduce

On macOS Sonoma 14.0, deploy target: iphone 8 running iOS 16.6

~~~
jaten@jbook ~/flutter101namer/namer $  flutter --version
 flutter --version
Flutter 3.24.4 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 603104015d (2 weeks ago) • 2024-10-24 08:01:25 -0700
Engine • revision db49896cf2
Tools • Dart 3.5.4 • DevTools 2.37.3
jaten@jbook ~/flutter101namer/namer $
~~~


I followed the steps in the intro tutorial, https://codelabs.developers.google.com/codelabs/flutter-codelab-first#0 to create a basic flutter app.

Try to run with: flutter run --release

~~~
jaten@jbook ~/flutter101namer/namer $ flutter run --release
flutter run --release
Launching lib/main.dart on dartag8 in release mode...
Automatically signing iOS for device deployment using specified development team in Xcode project:
KW7XZXMAF3
Running Xcode build...
Xcode build done.                                           70.1s
Failed to build iOS app
Could not build the precompiled application for the device.
Error (Xcode): Oops; flutter has exited unexpectedly: "Null check operator used on a null value".



Error running application on dartag8.
jaten@jbook ~/flutter101namer/namer $
~~~

### Expected results

Expected: deploy and run on iphone. Not to crash and create a log requesting a bug be filed.

### Actual results

contents of log

~/flutter101namer/namer $ cat flutter_03.log |pbcopy

~~~
Flutter crash report.
Please report a bug at https://github.com/flutter/flutter/issues.

## command

flutter assemble --no-version-check --output=/Users/jaten/flutter101namer/namer/build/ios/Release/ -dTargetPlatform=ios -dTargetFile=/Users/jaten/flutter101namer/namer/lib/main.dart -dBuildMode=release -dIosArchs=arm64 -dSdkRoot=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk -dSplitDebugInfo= -dTreeShakeIcons=false -dTrackWidgetCreation=true -dDartObfuscation=false -dAction=build -dFrontendServerStarterPath= --ExtraGenSnapshotOptions= --DartDefines= --ExtraFrontEndOptions= -dCodesignIdentity=1163D43329F84306237F9C753A2DF5EAA7818ABC release_ios_bundle_flutter_assets

## exception

_TypeError: Null check operator used on a null value

```
#0      NativeAssets._buildIOS (package:flutter_tools/src/build_system/targets/native_assets.dart:291:68)
#1      NativeAssets.build (package:flutter_tools/src/build_system/targets/native_assets.dart:85:32)
<asynchronous suspension>
#2      _BuildInstance._invokeInternal (package:flutter_tools/src/build_system/build_system.dart:875:9)
<asynchronous suspension>
#3      Future.wait.<anonymous closure> (dart:async/future.dart:534:21)
<asynchronous suspension>
#4      _BuildInstance.invokeTarget (package:flutter_tools/src/build_system/build_system.dart:813:32)
<asynchronous suspension>
#5      Future.wait.<anonymous closure> (dart:async/future.dart:534:21)
<asynchronous suspension>
#6      _BuildInstance.invokeTarget (package:flutter_tools/src/build_system/build_system.dart:813:32)
<asynchronous suspension>
#7      Future.wait.<anonymous closure> (dart:async/future.dart:534:21)
<asynchronous suspension>
#8      _BuildInstance.invokeTarget (package:flutter_tools/src/build_system/build_system.dart:813:32)
<asynchronous suspension>
#9      Future.wait.<anonymous closure> (dart:async/future.dart:534:21)
<asynchronous suspension>
#10     _BuildInstance.invokeTarget (package:flutter_tools/src/build_system/build_system.dart:813:32)
<asynchronous suspension>
#11     FlutterBuildSystem.build (package:flutter_tools/src/build_system/build_system.dart:635:16)
<asynchronous suspension>
#12     AssembleCommand.runCommand (package:flutter_tools/src/commands/assemble.dart:328:32)
<asynchronous suspension>
#13     FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:1408:27)
<asynchronous suspension>
#14     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:153:19)
<asynchronous suspension>
#15     CommandRunner.runCommand (package:args/command_runner.dart:212:13)
<asynchronous suspension>
#16     FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:420:9)
<asynchronous suspension>
#17     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:153:19)
<asynchronous suspension>
#18     FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:364:5)
<asynchronous suspension>
#19     run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:130:9)
<asynchronous suspension>
#20     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:153:19)
<asynchronous suspension>
#21     main (package:flutter_tools/executable.dart:93:3)
<asynchronous suspension>
```

## flutter doctor

```
[✓] Flutter (Channel stable, 3.24.4, on macOS 14.0 23A344 darwin-x64, locale en-US)
    • Flutter version 3.24.4 on channel stable at /Users/jaten/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 603104015d (2 weeks ago), 2024-10-24 08:01:25 -0700
    • Engine revision db49896cf2
    • Dart version 3.5.4
    • DevTools version 2.37.3

[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
    • Android SDK at /Users/jaten/Library/Android/sdk
    • Platform android-35, build-tools 35.0.0
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 21.0.3+-79915915-b509.11)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.0)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 15A240d
    • CocoaPods version 1.16.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2024.2)
    • 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.3+-79915915-b509.11)

[✓] VS Code (version unknown)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.100.0
    ✗ Unable to determine VS Code version.

[✓] Connected device (2 available)
    • macOS (desktop) • macos  • darwin-x64     • macOS 14.0 23A344 darwin-x64
    • Chrome (web)    • chrome • web-javascript • Google Chrome 130.0.6723.92

[✓] Network resources
    • All expected network resources are available.

• No issues found!
```
~~~

### Code sample

<details open><summary>Code sample</summary>

```dart
import 'package:english_words/english_words.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return ChangeNotifierProvider(
      create: (context) => MyAppState(),
      child: MaterialApp(
        title: 'Namer App',
        theme: ThemeData(
          useMaterial3: true,
          colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepOrange),
        ),
        home: MyHomePage(),
      ),
    );
  }
}

class MyAppState extends ChangeNotifier {
  var current = WordPair.random();

  // ↓ Add this.
  void getNext() {
    current = WordPair.random();
    notifyListeners();
  }
}

class MyHomePage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    var appState = context.watch<MyAppState>();

    return Scaffold(
      body: Column(
        children: [
          Text('A random GREAT idea:'),
          Text('The second line from the top:'),
          Text('The third line from the top:'),
          Text(appState.current.asLowerCase),

          // ↓ Add this.
          ElevatedButton(
            onPressed: () {
              appState.getNext(); // ← This instead of print().
              print('button pressed!');
            },
            child: Text('Next'),
          ),
        ],
      ),
    );
  }
}

```

</details>


### Screenshots or Video

<details open>
<summary>Screenshots / Video demonstration</summary>

[Upload media here]

</details>


### Logs

<details open><summary>Logs</summary>

```console
see above.
```

</details>


### Flutter Doctor output

<details open><summary>Doctor output</summary>

```console
see above in log.
```

</details>