Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(Android / IOS / Web ) Simulator not working after flutter updated to version 3.22.0 #148645

Open
drahcirtan opened this issue May 19, 2024 · 9 comments
Labels
in triage Presently being triaged by the triage team waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds

Comments

@drahcirtan
Copy link

drahcirtan commented May 19, 2024

Steps to reproduce

Hi, I am new to Flutter, currently learning flutter from a book. am creating a testing case for the flutter project, previously the simulator still works on the testing project, after updates, all the simulator seems to have issue and error when trying to run it.

  1. Updated Flutter
  2. Updated Packages
  3. Run existing project (without changing any codes, before updates the simulator still works)
  4. Error encountered.

Actual results

Below is for IOS simulator

Launching lib/main.dart on iPhone 15 Pro Max in debug mode...
Running Xcode build...
Xcode build done.                                            3.6s
Failed to build iOS app
Error (Xcode): ../development/flutter/packages/flutter/lib/src/widgets/routes.dart:343:82: Error: A value of type 'Animation<double>?' can't be assigned to a variable of type 'Animation<double>' because 'Animation<double>?' is nullable and 'Animation<double>' isn't.

Error (Xcode): Color.lerp(a.error, b.error, t),

Could not build the application for the simulator.
Error launching application on iPhone 15 Pro Max.

Below is for Android Devices

Launching lib/main.dart on sdk gphone64 arm64 in debug mode...
Running Gradle task 'assembleDebug'...

                                    ^
Target kernel_snapshot failed: Exception


FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command '/Users/development/flutter/bin/flutter'' finished with non-zero exit value 1
..........
<with millions of rows or errors that exceed this text box limitation>
..........
* 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 1s
Error: Gradle task assembleDebug failed with exit code 1

Below is updated Gradle

Download https://storage.googleapis.com/download.flutter.io/io/flutter/x86_debug/1.0.0-f6344b75dcf861d8bf1f1322780b8811f982e31a/x86_debug-1.0.0-f6344b75dcf861d8bf1f1322780b8811f982e31a.jar, took 2 s 416 ms
Download https://storage.googleapis.com/download.flutter.io/io/flutter/arm64_v8a_debug/1.0.0-f6344b75dcf861d8bf1f1322780b8811f982e31a/arm64_v8a_debug-1.0.0-f6344b75dcf861d8bf1f1322780b8811f982e31a.jar, took 5 s 141 ms
Download https://storage.googleapis.com/download.flutter.io/io/flutter/x86_64_debug/1.0.0-f6344b75dcf861d8bf1f1322780b8811f982e31a/x86_64_debug-1.0.0-f6344b75dcf861d8bf1f1322780b8811f982e31a.jar, took 8 s 686 ms

Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

For more on this, please refer to https://docs.gradle.org/8.7/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.

BUILD SUCCESSFUL in 3m 26s
4 actionable tasks: 4 executed
```

### Logs

<details open>
<summary>Logs</summary>

```console
flutter pub upgrade --major-versions
Resolving dependencies... (1.2s)
Downloading packages... 
  leak_tracker 10.0.4 (10.0.5 available)
  leak_tracker_flutter_testing 3.0.3 (3.0.5 available)
  material_color_utilities 0.8.0 (0.11.1 available)
  meta 1.12.0 (1.15.0 available)
  test_api 0.7.0 (0.7.1 available)
  vm_service 14.2.1 (14.2.2 available)
No dependencies changed.
6 packages have newer versions incompatible with dependency constraints.
Try `flutter pub outdated` for more information.
```

</details>


### Flutter Doctor output

<details open>
<summary>Doctor output</summary>

```console
No changes to pubspec.yaml!
% flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.22.0, on macOS 14.4.1 23E224 darwin-arm64, locale en-US)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 15.4)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2023.3)
[✓] VS Code (version 1.88.0)
[✓] Connected device (5 available)
[✓] Network resources

• No issues found!

% flutter doctor -v
[✓] Flutter (Channel stable, 3.22.0, on macOS 14.4.1 23E224 darwin-arm64, locale en-US)
    • Flutter version 3.22.0 on channel stable at /Users/user/development/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 5dcb86f68f (10 days ago), 2024-05-09 07:39:20 -0500
    • Engine revision f6344b75dc
    • Dart version 3.4.0
    • DevTools version 2.34.3

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /Users/user/Library/Android/sdk
    • Platform android-34, build-tools 34.0.0
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.10+0-17.0.10b1087.21-11572160)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.4)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 15F31d
    • CocoaPods version 1.15.2

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

[✓] Android Studio (version 2023.3)
    • 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 17.0.10+0-17.0.10b1087.21-11572160)

[✓] VS Code (version 1.88.0)
    • VS Code at /Users/user/Desktop/ProjectRich/Visual Studio Code.app/Contents
    • Flutter extension version 3.86.0

[✓] Connected device (3 available)
    • macOS (desktop)                 • macos                 • darwin-arm64   • macOS 14.4.1 23E224 darwin-arm64
    • Mac Designed for iPad (desktop) • mac-designed-for-ipad • darwin         • macOS 14.4.1 23E224 darwin-arm64
    • Chrome (web)                    • chrome                • web-javascript • Google Chrome 123.0.6312.107

[✓] Network resources
    • All expected network resources are available.

• No issues found!

```
</details>
@Vadagon
Copy link

Vadagon commented May 20, 2024

Same here after upgrading from previous version:

Failed to build iOS app
Error (Xcode): Undefined symbols:


Error (Xcode): Linker command failed with exit code 1 (use -v to see invocation)


Could not build the application for the simulator.
Error launching application on iPhone 15.

@darshankawar darshankawar added the in triage Presently being triaged by the triage team label May 20, 2024
@darshankawar
Copy link
Member

@drahcirtan Looking at the error, it seems to be related to casting or null assertion operator.
When you upgraded to latest, did you run flutter pub get ?
Also, looks like a pub cache kind of an issue that you can try to clear and re-run.
If above doesn't help, please provide a runnable code from the book that we can take a look to verify this further.

@darshankawar darshankawar added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label May 20, 2024
@drahcirtan
Copy link
Author

drahcirtan commented May 20, 2024

Hi @darshankawar, below is what I have tried.

Tried Pub Get

% flutter pub get                            
Resolving dependencies... 
Downloading packages... 
  leak_tracker 10.0.4 (10.0.5 available)
  leak_tracker_flutter_testing 3.0.3 (3.0.5 available)
  material_color_utilities 0.8.0 (0.11.1 available)
  meta 1.12.0 (1.15.0 available)
  test_api 0.7.0 (0.7.1 available)
  vm_service 14.2.1 (14.2.2 available)
Got dependencies!
6 packages have newer versions incompatible with dependency constraints.
Try `flutter pub outdated` for more information.

Tried pub cache repair

 % flutter pub cache repair                   
Reinstalled 188 packages.

Below is the code that can be run successfully before update

import 'package:flutter/material.dart';

void main() => runApp(const MyApp());

class MyApp extends StatefulWidget {
  const MyApp({super.key});

  // This widget is the root of your application.
  @override
  MyAppState createState() => MyAppState();
  }

  class MyAppState extends State<MyApp> {
    double? _numberFrom;

    @override
    //initiate state
    void initState() {
      _numberFrom = null;
      super.initState();
    }
    @override
  Widget build(BuildContext context) {
      return MaterialApp(
        title: 'Measures Converter',
        home: Scaffold(
          appBar: AppBar(
            title: const Text('Measure Converter'),
          ),
          body: Center(
            child: Column(
              children: [
                TextField(
                  onChanged: (text) {
                    var rv = double.tryParse(text);
                    if (rv != null) {
                      setState(() {
                        _numberFrom = rv;
                      });
                    }
                  },
                ),
                Text((_numberFrom == null) ? '' : _numberFrom.toString())
            ]
            ),
          ),
        ),
      );
    }
}

yaml file (Not sure if it helps?)

version: 1.0.0+1

environment:
  sdk: '>=3.3.4 <4.0.0'

dependencies:
  flutter:
    sdk: flutter
  cupertino_icons: ^1.0.8

dev_dependencies:
  flutter_test:
    sdk: flutter
  flutter_lints: ^4.0.0

flutter:
  uses-material-design: true

@github-actions github-actions bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label May 20, 2024
@darshankawar
Copy link
Member

@drahcirtan
I ran the code sample on Android emulator using latest stable version which compiled and built the app properly without throwing any errors as you reported. Maybe there's a setup / config issue at your end that you'll need to revisit and see what could be causing the error.

@darshankawar darshankawar added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label May 21, 2024
@drahcirtan
Copy link
Author

Hi @darshankawar,
I encounter the error after I updated Flutter, the codes is working perfectly fine before the update, hence there should not have any issue in the code. Should I uninstalled the flutter and reinstalled ? Above I ran the flutter doctor and all seems okay.

@github-actions github-actions bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label May 21, 2024
@Vadagon
Copy link

Vadagon commented May 21, 2024

Try to create a new project. If it's not starting then the problem is in your code otherwise delete flutter folder and install new one.

@Vadagon
Copy link

Vadagon commented May 21, 2024

I had that issue cause of the 3rd party repo.

@drahcirtan
Copy link
Author

drahcirtan commented May 21, 2024

Hi @Vadagon, tried new project previously, doesn't work. Do I need to reinstall flutter only or everything I installed with flutter previously ?

Do I follow the below steps ?
https://docs.flutter.dev/get-started/uninstall?tab=macos

Thanks

@darshankawar
Copy link
Member

@drahcirtan Uninstalling isn't an ideal solution. Can you put your project in a repo and share the link here so that we can clone it and check what is going on in it ?

@darshankawar darshankawar added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in triage Presently being triaged by the triage team waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds
Projects
None yet
Development

No branches or pull requests

3 participants