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

Access denied finding property "vendor.camera.aux.packagelist" #27

Closed
moseskarunia opened this issue May 3, 2019 · 8 comments
Closed

Comments

@moseskarunia
Copy link

moseskarunia commented May 3, 2019

Hi guys, I'm getting this error when opening the camera preview

E/libc (25094): Access denied finding property "vendor.camera.aux.packagelist"
W/om.example.hits(25094): type=1400 audit(0.0:8817): avc: denied { read } for name="u:object_r:vendor_camera_prop:s0" dev="tmpfs" ino=3997 scontext=u:r:untrusted_app:s0:c54,c257,c512,c768 tcontext=u:object_r:vendor_camera_prop:s0 tclass=file permissive=0
E/libc (25094): Access denied finding property "persist.vendor.camera.privapp.list"
W/om.example.hits(25094): type=1400 audit(0.0:8818): avc: denied { read } for name="u:object_r:vendor_camera_prop:s0" dev="tmpfs" ino=3997 scontext=u:r:untrusted_app:s0:c54,c257,c512,c768 tcontext=u:object_r:vendor_camera_prop:s0 tclass=file permissive=0
W/Binder:25094_6(25094): type=1400 audit(0.0:8819): avc: denied { read } for name="u:object_r:vendor_camera_prop:s0" dev="tmpfs" ino=3997 scontext=u:r:untrusted_app:s0:c54,c257,c512,c768 tcontext=u:object_r:vendor_camera_prop:s0 tclass=file permissive=0
E/libc (25094): Access denied finding property "vendor.camera.aux.packagelist"
E/libc (25094): Access denied finding property "vendor.camera.aux.packagelist"
W/System (25094): A resource failed to call release.
I/flutter (25094): Bad state: No element, #0 List.first (dart:core/runtime/libgrowable_array.dart:216:5)
I/flutter (25094): #1 _MLScannerPageState.build..
package:hits/mlScannerTest.dart:40
I/flutter (25094): #2 State.setState
package:flutter/…/widgets/framework.dart:1122
I/flutter (25094): #3 _MLScannerPageState.build.
package:hits/mlScannerTest.dart:39
I/flutter (25094): #4 CameraMlVisionState._processImage (package:flutter_camera_ml_vision/flutter_camera_ml_vision.dart)
I/flutter (25094):
I/flutter (25094): #5 CameraController.startImageStream.
package:camera/camera.dart:367
I/flutter (25094): #6 _rootRunUnary (dart:async/zone.dart:1132:38)
I/flutter (25094): #7 _CustomZone.runUnary (dart:async/zone.dart:1029:19)
I/flutter (25094): #8 _CustomZone.runUnaryGuarded (dart:async/zone.dart:931:7)
I/flutter (25094): #9 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:336:11)
I/flutter (25094): #10 _DelayedData.perform (dart:async/stream_impl.dart:591:14)
I/flutter (25094): #11 _StreamImplEvents.handleNext (dart:async/stream_impl.dart:707:11)
I/flutter (25094): #12 _PendingEvents.schedule. (dart:async/stream_impl.dart:667:7)
I/flutter (25094): #13 _rootRun (dart:async/zone.dart:1120:38)
I/flutter (25094): #14 _CustomZone.run (dart:async/zone.dart:1021:19)
I/flutter (25094): #15 _CustomZone.runGuarded (dart:async/zone.dart:923:7)
I/flutter (25094): #16 _CustomZone.bindCallbackGuarded. (dart:async/zone.dart:963:23)
I/flutter (25094): #17 _rootRun (dart:async/zone.dart:1124:13)
I/flutter (25094): #18 _CustomZone.run (dart:async/zone.dart:1021:19)
I/flutter (25094): #19 _CustomZone.runGuarded (dart:async/zone.dart:923:7)
I/flutter (25094): #20 _CustomZone.bindCallbackGuarded. (dart:async/zone.dart:963:23)
I/flutter (25094): #21 _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
I/flutter (25094): #22 _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
I/flutter (25094):
W/System (25094): A resource failed to call release.
I/flutter (25094): Bad state: No element, #0 List.first (dart:core/runtime/libgrowable_array.dart:216:5)
I/flutter (25094): #1 _MLScannerPageState.build..
package:hits/mlScannerTest.dart:40
I/flutter (25094): #2 State.setState
package:flutter/…/widgets/framework.dart:1122
I/flutter (25094): #3 _MLScannerPageState.build.
package:hits/mlScannerTest.dart:39
I/flutter (25094): #4 CameraMlVisionState._processImage (package:flutter_camera_ml_vision/flutter_camera_ml_vision.dart)
I/flutter (25094):
I/flutter (25094): #5 CameraController.startImageStream.
package:camera/camera.dart:367
I/flutter (25094): #6 _rootRunUnary (dart:async/zone.dart:1132:38)
I/flutter (25094): #7 _CustomZone.runUnary (dart:async/zone.dart:1029:19)
I/flutter (25094): #8 _CustomZone.runUnaryGuarded (dart:async/zone.dart:931:7)
I/flutter (25094): #9 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:336:11)
I/flutter (25094): #10 _DelayedData.perform (dart:async/stream_impl.dart:591:14)
I/flutter (25094): #11 _StreamImplEvents.handleNext (dart:async/stream_impl.dart:707:11)
I/flutter (25094): #12 _PendingEvents.schedule. (dart:async/stream_impl.dart:667:7)
I/flutter (25094): #13 _rootRun (dart:async/zone.dart:1120:38)
I/flutter (25094): #14 _CustomZone.run (dart:async/zone.dart:1021:19)
I/flutter (25094): #15 _CustomZone.runGuarded (dart:async/zone.dart:923:7)
I/flutter (25094): #16 _CustomZone.bindCallbackGuarded. (dart:async/zone.dart:963:23)
I/flutter (25094): #17 _rootRun (dart:async/zone.dart:1124:13)
I/flutter (25094): #18 _CustomZone.run (dart:async/zone.dart:1021:19)
I/flutter (25094): #19 _CustomZone.runGuarded (dart:async/zone.dart:923:7)
I/flutter (25094): #20 _CustomZone.bindCallbackGuarded. (dart:async/zone.dart:963:23)
I/flutter (25094): #21 _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
I/flutter (25094): #22 _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
I/flutter (25094):
E/libc (25094): Access denied finding property "vendor.camera.aux.packagelist"
W/Binder:25094_7(25094): type=1400 audit(0.0:8821): avc: denied { read } for name="u:object_r:vendor_camera_prop:s0" dev="tmpfs" ino=3997 scontext=u:r:untrusted_app:s0:c54,c257,c512,c768 tcontext=u:object_r:vendor_camera_prop:s0 tclass=file permissive=0
E/libc (25094): Access denied finding property "vendor.camera.aux.packagelist"
W/Binder:25094_7(25094): type=1400 audit(0.0:8822): avc: denied { read } for name="u:object_r:vendor_camera_prop:s0" dev="tmpfs" ino=3997 scontext=u:r:untrusted_app:s0:c54,c257,c512,c768 tcontext=u:object_r:vendor_camera_prop:s0 tclass=file permissive=0
E/EventChannel#plugins.flutter.io/camera/imageStream(25094): Failed to close event stream
E/EventChannel#plugins.flutter.io/camera/imageStream(25094): java.lang.NullPointerException: Attempt to invoke virtual method 'void android.media.ImageReader.setOnImageAvailableListener(android.media.ImageReader$OnImageAvailableListener, android.os.Handler)' on a null object reference
E/EventChannel#plugins.flutter.io/camera/imageStream(25094): at io.flutter.plugins.camera.CameraHandler$Camera$9.onCancel(CameraHandler.java:827)
E/EventChannel#plugins.flutter.io/camera/imageStream(25094): at io.flutter.plugin.common.EventChannel$IncomingStreamRequestHandler.onCancel(EventChannel.java:194)
E/EventChannel#plugins.flutter.io/camera/imageStream(25094): at io.flutter.plugin.common.EventChannel$IncomingStreamRequestHandler.onMessage(EventChannel.java:162)
E/EventChannel#plugins.flutter.io/camera/imageStream(25094): at io.flutter.view.FlutterNativeView$PlatformMessageHandlerImpl.handleMessageFromDart(FlutterNativeView.java:188)
E/EventChannel#plugins.flutter.io/camera/imageStream(25094): at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:202)
E/EventChannel#plugins.flutter.io/camera/imageStream(25094): at android.os.MessageQueue.nativePollOnce(Native Method)
E/EventChannel#plugins.flutter.io/camera/imageStream(25094): at android.os.MessageQueue.next(MessageQueue.java:326)
E/EventChannel#plugins.flutter.io/camera/imageStream(25094): at android.os.Looper.loop(Looper.java:165)
E/EventChannel#plugins.flutter.io/camera/imageStream(25094): at android.app.ActivityThread.main(ActivityThread.java:6729)
E/EventChannel#plugins.flutter.io/camera/imageStream(25094): at java.lang.reflect.Method.invoke(Native Method)
E/EventChannel#plugins.flutter.io/camera/imageStream(25094): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
E/EventChannel#plugins.flutter.io/camera/imageStream(25094): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)


Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, v1.2.1, on Microsoft Windows [Version 10.0.17134.706], locale en-US)
[√] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[!] Android Studio (version 3.2)
X Flutter plugin not installed; this adds Flutter specific functionality.
X Dart plugin not installed; this adds Dart specific functionality.
[√] VS Code, 64-bit edition (version 1.33.1)
[√] Connected device (1 available)

! Doctor found issues in 1 category.


Testing with my device: Nokia 6.1 plus.

Dependencies

firebase_ml_vision: ^0.7.0+2
flutter_camera_ml_vision: ^2.0.0


Here's my code

mlScannerTest.dart

import 'package:flutter/material.dart';
import 'package:flutter_camera_ml_vision/flutter_camera_ml_vision.dart';
import 'package:firebase_ml_vision/firebase_ml_vision.dart';

class MLScannerPage extends StatefulWidget {
  MLScannerPage({Key key, this.title}) : super(key: key);

  final String title;

  @override
  _MLScannerPageState createState() => _MLScannerPageState();
}

class _MLScannerPageState extends State<MLScannerPage> {
  String _code;
  StatefulWidget _camML;
  bool _startCamera = true;
  bool _resultSent = false;
  final _scanKey = GlobalKey<CameraMlVisionState>();

  @override
  void initState() {
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    _camML = _startCamera
        ? CameraMlVision<List<Barcode>>(
            key: _scanKey,
            detector: FirebaseVision.instance.barcodeDetector().detectInImage,
            onResult: (List<Barcode> barcodes) {
              if (_resultSent || !mounted) {
                return;
              }
              _resultSent = true;

              setState(() {
                _code = barcodes.first.displayValue;
              });
            })
        : null;

    return Scaffold(
      appBar: AppBar(
        title: Text(_code != null && _code.isNotEmpty ? _code : 'None'),
      ),
      body: SizedBox.expand(
        child: _camML,
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: () {
          setState(() {
            _startCamera = !_startCamera;
            _resultSent = false;
          });
        },
        tooltip: 'Code',
        child: Icon(Icons.add),
      ),
    );
  }
}

main.dart

import 'package:flutter/material.dart';
import 'package:hits/mlScannerTest.dart';

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

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: MLScannerPage(title: 'Flutter Demo Home Page'),
    );
  }
}

So basically, the preview was shown. But no detection whatsoever.

@Kleak
Copy link
Contributor

Kleak commented May 3, 2019

This is not related with vendor.camera.aux.packagelist.

in your log you have this
I/flutter (25094): Bad state: No element, #0 List.first (dart:core/runtime/libgrowable_array.dart:216:5)
this is because barcodes can be empty or null so you have to check it on your side.

@moseskarunia
Copy link
Author

Thanks for reminding the check, but it still didn't work even after I add a safeguard before accessing barcodes.first.displayValue

The safeguard : if (barcodes == null || barcodes.length == 0) return;

The error still there, but without the I/flutter (25094): Bad state: No element, #0 List.first (dart:core/runtime/libgrowable_array.dart:216:5)

@Kleak
Copy link
Contributor

Kleak commented May 3, 2019

Seems to be a duplicate of #9

@Kleak Kleak added the duplicate This issue or pull request already exists label May 3, 2019
@moseskarunia
Copy link
Author

Seems to be a duplicate of #9

so the issue is from the device?

@Kleak
Copy link
Contributor

Kleak commented May 3, 2019

Could you share the entire code that repro your bug i will try to look at it in an hour or so

@Kleak
Copy link
Contributor

Kleak commented May 3, 2019

If you can share with us the entire project it would be great

@Kleak Kleak removed the duplicate This issue or pull request already exists label May 5, 2019
@Kleak
Copy link
Contributor

Kleak commented May 5, 2019

ok i figured out the problem (this don't block you on using the package) are from the camera plugins and we don't have the hand on it. Maybe you could open an issue for it here.
And my bad it's not a duplicate of #9

EDIT: this doesn't seems to be linked with the camera plugin but an hardware problem. I also got this message but the package is working.

We will close this since we can't do something on this part we are just using the camera plugin and the firebase_ml_vision plugin together. No native code is involved on our side.

@Kleak Kleak closed this as completed May 5, 2019
@moseskarunia
Copy link
Author

hello mate. just been able to reply now. just uploaded mine to github here. https://github.com/moseskarunia/testapp/blob/master/lib/mlScannerTest.dart

note that it's just a test project. codes maybe all over the place.

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

No branches or pull requests

2 participants