Open media-ch opened 2 years ago
@bilel2104
I have just solved this problem. Flutter pub arcore_flutter_plugin 0.1.0-null-safety.3
seems not to contain this change.
The cause is null checke operator at package:arcore_flutter_plugin/src/arcore_controller.dart:157:75
.
Repository's master branch contains that fix, but flutter pub does not contain. Easy solution is to install directly this packges to your flutter project directory without passing through flutter pub add
.
your_flutter_project/plugins/
dependencies:
flutter:
sdk: flutter
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
# ↓from flutter pub. comment out or remove.
# arcore_flutter_plugin: ^0.1.0-null-safety.3
# ↓read from your local.
arcore_flutter_plugin:
path: ./plugins/arcore_flutter_plugin-master/
flutter packages get
. The pakcage will be read from your local!I hope the master branch's change is taken in flutter pub as soon as possible. If flutter pub updated, above solution is unnecessary and we just install new version.
@media-ch I encountered and faced the same issue several hours before try your solutions. However my project will build failed after followed the solution.
And I traced the error stack, I found the core issue is in this line
./arcore_flutter_plugin-0.1.0-null-safety.3/lib/src/arcore_controller.dart :: 157
final params = _addParentNodeNameToParams(node.toMap(), parentNodeName!);
The issue is the private function is requesting a nullable parentNodeName parameter. Unfortunately, the function still pasting a Null check '!'. At the same time , addArCoreNodeToAugmentedImage() have had accept the nullable parentNodeName input parameter.
In this situation, I make the code change as showing in below. Just do remove the Null check from parentNodeName , as unnecessary
final params = _addParentNodeNameToParams(node.toMap(), parentNodeName);
The script will pass smoothly after a quick fix.
Hello. I have faced "Unhandled Exception: Null check operator used on a null value" on using
addArCoreNodeToAugmentedImage
.As a tutorial, I copied the augmented_images.dart example to my flutter project. And I tried with my android device in debug mode.
Image detection seems to be succeeded, but an exception was caused and no reactions. Recording result as below.
My code is here. (Almost copy)
pubspec.yaml
I think this example result will show like this on my device. https://github.com/giandifra/arcore_flutter_plugin/issues/4#issuecomment-607263366
But display on my device with above my code is here.
Is it probmlem of ArCoreController.addArCoreNodeToAugmentedImage or my coding?