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

Crash when starting up our app with torch_compat #21

Open
vanlooverenkoen opened this issue Nov 18, 2021 · 1 comment · May be fixed by jeffmikels/flutter_torch_compat#1
Open

Crash when starting up our app with torch_compat #21

vanlooverenkoen opened this issue Nov 18, 2021 · 1 comment · May be fixed by jeffmikels/flutter_torch_compat#1

Comments

@vanlooverenkoen
Copy link

This is the crash we get when starting up our app

Caused by java.util.NoSuchElementException: Array contains no element matching the predicate.
       at fr.g123k.torch_compat.impl.TorchCamera2Impl.<init>(TorchCamera2Impl.java:37)
       at fr.g123k.torch_compat.TorchCompatPlugin.<init>(TorchCompatPlugin.java:24)
       at fr.g123k.torch_compat.TorchCompatPlugin$Companion.registerWith(TorchCompatPlugin.java:39)
       at fr.g123k.torch_compat.TorchCompatPlugin.registerWith(TorchCompatPlugin.java:2)
       at io.flutter.plugins.GeneratedPluginRegistrant.registerWith(GeneratedPluginRegistrant.java:37)
       at be.our.app.MainActivity.configureFlutterEngine(MainActivity.java:19)
       at io.flutter.embedding.android.FlutterActivityAndFragmentDelegate.onAttach(FlutterActivityAndFragmentDelegate.java:180)
       at io.flutter.embedding.android.FlutterActivity.onCreate(FlutterActivity.java:409)
       at be.our.app.MainActivity.onCreate(MainActivity.java:14)
       at android.app.Activity.performCreate(Activity.java:7876)
       at android.app.Activity.performCreate(Activity.java:7865)
       at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1306)
       at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3273)
       at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3437)
       at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
       at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
       at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2041)
       at android.os.Handler.dispatchMessage(Handler.java:107)
       at android.os.Looper.loop(Looper.java:214)
       at android.app.ActivityThread.main(ActivityThread.java:7386)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:980)
@vanlooverenkoen
Copy link
Author

vanlooverenkoen commented Nov 18, 2021

firstOrNull should be used instead of first
Because for our app a flash is not required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant