Flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.16.0, on macOS 14.5 23F79 darwin-arm64, locale en-US)
[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 15.4)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2024.1)
[✓] IntelliJ IDEA Ultimate Edition (version 2024.1.2)
[✓] Connected device (3 available)
! Error: Browsing on the local area network for iPhone (3). 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
Machine is mac arm based. Android API 35
on building app with command flutter build apk
Getting failure, same code builds fine on mac with intel. I Have tried upgrading versions I am ran into same kind of errors.
../../../.pub-cache/hosted/pub.dev/firebase_storage_platform_interface-5.1.12/lib/firebase_storage_platform_interface.dart:12:1: Error: Error when reading '../../../.pub-cache/hosted/pub.dev/firebase_storage_platform_interface-5.1.12/lib/src/platform_interface/platform_interface_reference.dart': No such file or directory
export 'src/platform_interface/platform_interface_reference.dart';
^
../../../.pub-cache/hosted/pub.dev/firebase_storage-11.6.9/lib/src/reference.dart:15:3: Error: Type 'ReferencePlatform' not found.
ReferencePlatform _delegate;
^^^^^^^^^^^^^^^^^
../../../.pub-cache/hosted/pub.dev/firebase_storage_platform_interface-5.1.12/lib/src/platform_interface/platform_interface_firebase_storage.dart:102:3: Error: Type 'ReferencePlatform' not found.
ReferencePlatform ref(String path) {
^^^^^^^^^^^^^^^^^
I am expecting a apk for android.
2
Answers
Looks like computer’s dart global cache is corrupted, because if definitely exist in repo in 5.1.12, proof
I would start with repair command:
dart pub cache repair
in your terminal. It will reinstall all dependencies from scratch.If first error with
No such file or directory
disappears after repair, then all other mentioned errors would also be repaired.If you still getting the error then follow these steps