Debug service listening on ws://127.0.0.1:50555/1Fsne_rH2SE=/ws
Error: PlatformException(error, Expected a value of type ‘Object’, but got one of type ‘Null’, null, null)
at Object.throw_ [as throw] (http://localhost:50499/dart_sdk.js:5061:11)
at StandardMethodCodec.decodeEnvelope (http://localhost:50499/packages/flutter/src/services/restoration.dart.lib.js:2286:19)
at MethodChannel._invokeMethod (http://localhost:50499/packages/flutter/src/services/restoration.dart.lib.js:1528:47)
at _invokeMethod.next ()
at http://localhost:50499/dart_sdk.js:38640:33
at _RootZone.runUnary (http://localhost:50499/dart_sdk.js:38511:59)
at _FutureListener.thenAwait.handleValue (http://localhost:50499/dart_sdk.js:33713:29)
at handleValueCallback (http://localhost:50499/dart_sdk.js:34265:49)
at Function._propagateToListeners (http://localhost:50499/dart_sdk.js:34303:17)
at _Future.new.[_completeWithValue] (http://localhost:50499/dart_sdk.js:34151:23)
at async._AsyncCallbackEntry.new.callback (http://localhost:50499/dart_sdk.js:34172:35)
at Object._microtaskLoop (http://localhost:50499/dart_sdk.js:38778:13)
at _startMicrotaskLoop (http://localhost:50499/dart_sdk.js:38784:13)
at http://localhost:50499/dart_sdk.js:34519:9
and this is flutter doctor:
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 2.5.3, on Microsoft Windows [Version 10.0.19042.1288], locale en-US)
[√] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
[√] Chrome - develop for the web
[√] Android Studio (version 2020.3)
[√] Connected device (3 available)
• No issues found!
Try to minimize the request. Use only setUrl
, initApp
and default find
request.
@override
void initState() {
super.initState();
Backendless.setUrl('https://eu-api.backendless.com');
Backendless.initApp(
applicationId: APP_ID,
jsApiKey: JS_KEY);
Backendless.data.of('ProductDetails').find().then((value) => print(value));
}
I tried to connect to your application and retrieve objects. It worked for me.
What is your backendless version?
and any difference between my flutter and dart version and yours?
My version of backendless-sdk - 7.1.6.
Flutter - 2.5.2
Dart - 2.14.3
A similar error occurs when the initialization data is incorrectly specified.
It still seems to me that you have incorrectly specified appId\apiKey\url
Please let me know if the problem is resolved.
No, Error stands. I created a new project and add your codes:
@override
void initState() {
super.initState();
Backendless.setUrl(‘https://eu-api.backendless.com’);
Backendless.initApp(
applicationId: ‘F16241XXXXXXXXXXXXXXXXXX’,
jsApiKey: ‘1D6FA8XXXXXXXXXXXXXXXXX’);
print(‘done’);
Backendless.data.of(‘ProductDetails’).find().then((value) => print(value));
}
outcome:
Debug service listening on ws://127.0.0.1:60902/ZiOB5IZM6XI=/ws
done
Error: PlatformException(error, Expected a value of type ‘Object’, but got one of type ‘Null’, null, null)
I managed to reproduce your problem, we will investigate it.
Best Regards, Nikita.
We have created an internal ticket BKNDLSS-26668. Whenever we have any news, we will let you know in this thread.
Best Regards, Nikita.
Hello, @Ehsan_Nikaeen1.
The new version of Flutter-SDK 7.1.7 has been released. Fixed issues with flutter-web.
Let us know if everything is working well for you now.
Best Regards, Nikita.
Thanks for your considerations but I tested and nothing changed.
Although when I run runZoneGaurded to catch errors it works fine!
look:
void main() {
runZonedGuarded(() {
runApp(MyApp());
}, (Object error, StackTrace stack) {
getList();
});
}
Future getList() async{
print(‘isInitialized’);
List<Map?>? data = await Backendless.data.of(‘ProductDetails’).find().onError((error, stackTrace) => throw error.toString());
print(data);
}
Make sure you have upgraded to 7.1.7 and also run the flutter pub get
command.
Can you help reproduce this issue?
I tried run next code and it works fine:
void initState() {
super.initState();
Backendless.setUrl('https://eu-api.backendless.com');
Backendless.initApp(
applicationId: APPID,
androidApiKey: ANDROID_KEY,
iosApiKey: IOS_KEY,
jsApiKey: JS_KEY)
.then((value) => print('done'));
}
void _but() async {
Backendless.data.of('ProductDetails').find().then((value) => print(value));
}
Could you share your index.html
file with me ?
And describe steps to reproduce?
Best Regards, Nikita.
Hello, @Ehsan_Nikaeen1.
Did you manage to figure out the problem?
Regards, Nikita.
I started a totally new project and add very simple lines just to read some data! This doesn’t work! No!
and I am stuck!
I use version7.1.9
add that line to index.html and
<script src="https://api.backendless.com/sdk/js/latest/backendless.min.js"></script>
@override
void initState() {
super.initState();
Backendless.initApp(
applicationId: 'F16241BA-7A18-F7D0-FF2F-XXXXXXXXXXXX',
jsApiKey: '1D6FA8C7-E93A-4518-XXXXX-XXXXXXXXX');
}
and getiing:
Error: PlatformException(error, Error: Application with ID F16241BA-7A18-F7D0-FF2F-XXXXXXXXXX does not exist, null, null)
at Object.throw_ [as throw] (http://localhost:53262/dart_sdk.js:5386:11)
at StandardMethodCodec.decodeEnvelope (http://localhost:53262/packages/flutter/src/services/restoration.dart.lib.js:2439:19)
at MethodChannel._invokeMethod (http://localhost:53262/packages/flutter/src/services/restoration.dart.lib.js:1608:47)
at _invokeMethod.next (<anonymous>)
at http://localhost:53262/dart_sdk.js:42610:33
at _RootZone.runUnary (http://localhost:53262/dart_sdk.js:42466:58)
at _FutureListener.thenAwait.handleValue (http://localhost:53262/dart_sdk.js:37033:29)
at handleValueCallback (http://localhost:53262/dart_sdk.js:37636:49)
at Function._propagateToListeners (http://localhost:53262/dart_sdk.js:37674:17)
at _Future.new.[_completeWithValue] (http://localhost:53262/dart_sdk.js:37516:23)
at async._AsyncCallbackEntry.new.callback (http://localhost:53262/dart_sdk.js:37539:35)
at Object._microtaskLoop (http://localhost:53262/dart_sdk.js:42771:13)
at _startMicrotaskLoop (http://localhost:53262/dart_sdk.js:42777:13)
at http://localhost:53262/dart_sdk.js:37905:9