Quantcast
Channel: Active questions tagged crash - Stack Overflow
Viewing all articles
Browse latest Browse all 7186

Flutter + ArCore + Qrscan crash

$
0
0

im working with Flutter+AndroidStudio and im currently starting to work with Augmented Reality the problem is:Id like to have a QrCode somewhere and while im walking with the ArCore function ON i can press a "Scan Button" and open a "real camera" with the scanning function.

  Future _scan() async {   String barcode = await scanner.scan();   print(barcode);  }  @override  Widget build(BuildContext context) {  return Scaffold(  appBar: AppBar(    title: Text(widget.title),  ),  body: Stack(    children: <Widget>[      ArCoreView(        onArCoreViewCreated: _onArCoreViewCreated,        enableTapRecognizer: true,      ),      Align(        alignment: Alignment.topLeft,        child: RaisedButton(          onPressed: () {            _scan();          },          child: Text('Go back!'),        ),      ),    ],  ),);}

If i dont put:

ArCoreView(        onArCoreViewCreated: _onArCoreViewCreated,        enableTapRecognizer: true,      )

It actually works fine.The 2 plugins are:import 'package:arcore_flutter_plugin/arcore_flutter_plugin.dart';

import 'package:qrscan/qrscan.dart' as scanner;

I think the problem is that the camera is already open or something like that, i don't know how i can fix this, thank you in advance!

That's the error i get:

I/com.difrancescogianmarco.arcore_flutter_plugin.ArCoreView( 9820): onActivityPausedI/native  ( 9820): session.cc:1154 Entering Session::Pause.W/native  ( 9820): calibration_convergence_detector_utils.cc:143 Failed to get calibration qualification statistics: States are empty.I/native  ( 9820): online_calibration_manager.cc:126 OnlineCalibrationManager: Discarding the new online recalibration estimates.I/native  ( 9820): cameras.cc:1309 Camera 0 changed state CAPTURING->STOPPING; Capture session stopping... i=2E/ACameraDevice( 9820): onDeviceIdle sending state cbI/native  ( 9820): android_camera.cc:1617 [Camera=0; State=STOPPING] Camera completed repeating capture sequence 0I/native  ( 9820): logger.h:28 CameraMetrics: LastCaptureComplete: 233.815312msI/native  ( 9820): logger.h:28 CameraMetrics: CloseCaptureSession: 206.000938msI/native  ( 9820): cameras.cc:1309 Camera 0 changed state STOPPING->OPEN; Camera stopped. i=3I/native  ( 9820): logger.h:28 CameraMetrics: CloseCamera: 111.259687msI/native  ( 9820): cameras.cc:1309 Camera 0 changed state OPEN->CLOSED; Camera device closed successfully. i=4I/native  ( 9820): logger.h:28 DataSourceMetrics: kStopImageSubSystem: 551.795989msI/native  ( 9820): session.cc:1239 Session::PauseWithAnalytics returning OK.I/Choreographer( 9820): Skipped 33 frames!  The application may be doing too much work on its main thread.W/ActivityThread( 9820): handleWindowVisibility: no activity for token android.os.BinderProxy@edfedecD/AndroidRuntime( 9820): Shutting down VME/AndroidRuntime( 9820): FATAL EXCEPTION: mainE/AndroidRuntime( 9820): Process: com.example.flutterapp4, PID: 9820E/AndroidRuntime( 9820): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.flutterapp4/com.shinow.qrscan.SecondActivity}: java.lang.IllegalArgumentException: Parameter specified as non-null is null: method kotlin.jvm.internal.Intrinsics.checkParameterIsNotNull, parameter savedInstanceStateE/AndroidRuntime( 9820):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3276)E/AndroidRuntime( 9820):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3415)E/AndroidRuntime( 9820):    at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)E/AndroidRuntime( 9820):    at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)E/AndroidRuntime( 9820):    at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)E/AndroidRuntime( 9820):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2022)E/AndroidRuntime( 9820):    at android.os.Handler.dispatchMessage(Handler.java:107)E/AndroidRuntime( 9820):    at android.os.Looper.loop(Looper.java:359)E/AndroidRuntime( 9820):    at android.app.ActivityThread.main(ActivityThread.java:7418)E/AndroidRuntime( 9820):    at java.lang.reflect.Method.invoke(Native Method)E/AndroidRuntime( 9820):    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)E/AndroidRuntime( 9820):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:935)E/AndroidRuntime( 9820): Caused by: java.lang.IllegalArgumentException: Parameter specified as non-null is null: method kotlin.jvm.internal.Intrinsics.checkParameterIsNotNull, parameter savedInstanceStateE/AndroidRuntime( 9820):    at com.difrancescogianmarco.arcore_flutter_plugin.ArCoreView$setupLifeCycle$1.onActivityCreated(Unknown Source:7)E/AndroidRuntime( 9820):    at android.app.Application.dispatchActivityCreated(Application.java:373)E/AndroidRuntime( 9820):    at android.app.Activity.dispatchActivityCreated(Activity.java:1202)E/AndroidRuntime( 9820):    at android.app.Activity.onCreate(Activity.java:1475)E/AndroidRuntime( 9820):    at androidx.core.app.ComponentActivity.onCreate(ComponentActivity.java:81)E/AndroidRuntime( 9820):    at androidx.activity.ComponentActivity.onCreate(ComponentActivity.java:149)E/AndroidRuntime( 9820):    at androidx.fragment.app.FragmentActivity.onCreate(FragmentActivity.java:313)E/AndroidRuntime( 9820):    at androidx.appcompat.app.AppCompatActivity.onCreate(AppCompatActivity.java:106)E/AndroidRuntime( 9820):    at com.shinow.qrscan.SecondActivity.onCreate(SecondActivity.java:36)E/AndroidRuntime( 9820):    at android.app.Activity.performCreate(Activity.java:7802)E/AndroidRuntime( 9820):    at android.app.Activity.performCreate(Activity.java:7791)E/AndroidRuntime( 9820):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1307)E/AndroidRuntime( 9820):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3251)

Viewing all articles
Browse latest Browse all 7186

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>