You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Run the example code on an Android Emulator (requires dependency on the file package).
Outputs true but then throws the following exception when executing the InputImage.fromFile() line:
I/flutter ( 7719): true
E/MLKitImageUtils( 7719): Could not open file: file:///img.jpg
E/MLKitImageUtils( 7719): java.io.FileNotFoundException: /img.jpg: open failed: ENOENT (No such file or directory)
E/MLKitImageUtils( 7719): at libcore.io.IoBridge.open(IoBridge.java:574)
E/MLKitImageUtils( 7719): at java.io.FileInputStream.<init>(FileInputStream.java:179)
E/MLKitImageUtils( 7719): at java.io.FileInputStream.<init>(FileInputStream.java:133)
E/MLKitImageUtils( 7719): at android.content.ContentResolver.openInputStream(ContentResolver.java:1526)
E/MLKitImageUtils( 7719): at android.provider.MediaStore$Images$Media.getBitmap(MediaStore.java:2858)
E/MLKitImageUtils( 7719): at com.google.mlkit.vision.common.internal.ImageUtils.zza(com.google.mlkit:vision-common@@17.3.0:1)
E/MLKitImageUtils( 7719): at com.google.mlkit.vision.common.InputImage.fromFilePath(com.google.mlkit:vision-common@@17.3.0:4)
Note: I am happy to re-word the issue if it's about the MFS, but in that case the complaint would just move to "it is surprisingly difficult to test this package", given that tests can't be run on a host, and there's seemingly no straightforward way to obtain an InputImage from an asset
Example code
import'package:file/memory.dart';
import'package:google_mlkit_text_recognition/google_mlkit_text_recognition.dart';
classRecognizer {
final fs =MemoryFileSystem();
Recognizer();
voidr() async {
final f = fs.file('/img.jpg')..writeAsBytesSync([]);
print('${f.existsSync()}');
final r =awaitTextRecognizer().processImage(InputImage.fromFile(f));
print('$r');
}
}
What is the expected result?
An error about the file being empty, or whatever the actual problem is (same error occurs when writing the bytes of an asset file instead of the empty list used in the example)
Did you try our example app?
No
Is it reproducible in the example app?
No
Reproducible in which OS?
Android
Flutter/Dart Version?
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel master, 3.27.0-1.0.pre.669, on macOS 14.6.1 23G93 darwin-arm64, locale en-US)
[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 16.0)
[✓] Chrome - develop for the web
[!] Android Studio (not installed)
[✓] IntelliJ IDEA Ultimate Edition (version 2024.3)
[✓] IntelliJ IDEA Ultimate Edition (version 2024.3)
[✓] VS Code (version 1.95.3)
[✓] VS Code (version 1.85.0-insider)
Plugin Version?
0.14.0
The text was updated successfully, but these errors were encountered:
I'm stuck having the same issue, specified my assets in my pubspec but still "File not found". I've tried using the default options but still no output
Description
Run the example code on an Android Emulator (requires dependency on the
file
package).Outputs
true
but then throws the following exception when executing theInputImage.fromFile()
line:Note: I am happy to re-word the issue if it's about the MFS, but in that case the complaint would just move to "it is surprisingly difficult to test this package", given that tests can't be run on a host, and there's seemingly no straightforward way to obtain an
InputImage
from an assetExample code
What is the expected result?
An error about the file being empty, or whatever the actual problem is (same error occurs when writing the bytes of an asset file instead of the empty list used in the example)
Did you try our example app?
No
Is it reproducible in the example app?
No
Reproducible in which OS?
Android
Flutter/Dart Version?
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel master, 3.27.0-1.0.pre.669, on macOS 14.6.1 23G93 darwin-arm64, locale en-US)
[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 16.0)
[✓] Chrome - develop for the web
[!] Android Studio (not installed)
[✓] IntelliJ IDEA Ultimate Edition (version 2024.3)
[✓] IntelliJ IDEA Ultimate Edition (version 2024.3)
[✓] VS Code (version 1.95.3)
[✓] VS Code (version 1.85.0-insider)
Plugin Version?
0.14.0
The text was updated successfully, but these errors were encountered: