Flutter app not running on iOS

Hello,

My flutter app runs on emulator Android device no problems, and I am now working to get it running on the iOS simulator, but after sorting cocoapod issues, have run into the following error message:

Unhandled Exception: PlatformException(8002, Could not parse request with message: , status code 404, headers POST /2D9687B4-3707-406D-FFE5-0F693EAF1D00/8E3EB658-1A11-4BA7-983B-63FA2E5231700/data/Exhibit/find, Could not parse request with message: , status code 404, headers POST /2D9687B4-3707-406D-FFE5-0F693EAF1D00/8E3EB658-1A11-4BA7-983B-63FA2E5231700/data/Exhibit/find, null)

In my pubspec.yaml I have backendless_sdk: ^7.3.5. Following the Client-side setup in the Flutter SDK, I am using the Backendless native endpoint for the EU cluster and provide my ids (again, the app works on Android). There seems to be an issue with the find function but I’ve not been able to figure out what. Any help will be greatly appreciated, as always.

Also this is an example of how I’m using find in case it helps in any way:

  static Future<List<Exhibit?>?> fetchedExhibits() {
    var query = DataQueryBuilder()
      ..sortBy = ['endDate']
      ..related = ['linkedVenues', 'linkedCategories', 'linkedArtists'];
    var dbdata =
        Backendless.data.withClass<Exhibit>().find(query).then((exhibits) {
      return exhibits;
    });
    return dbdata;
  }

Thanks so much!

Ilayda

Hi @Ilayda_B

I’ve created an internal ticket BKNDLSS-32429 to investigate the issue

Regards,
Vlad

1 Like

Hi @vladimir-upirov,

Hope you’re well, just checking to see if there’s been any progress getting to the bottom of this issue?

Kind regards,

Ilayda

Hello, @Ilayda_B.

You cannot use a function return and then at the same time.
You already had a similar error in your previous topics:

Regards, Nikita.

Hi Nikita,

You’re right, sorry I still had that in my code. However I’ve now removed all .then() from my find calls in my entire project and the iOS app still doesn’t run. This is what I get

[VERBOSE-2:dart_vm_initializer.cc(41)] Unhandled Exception: PlatformException(8002, Could not parse request with message: , status code 404, headers POST /2D9687B4-3707-406D-FFE5-0F693EAF1D00/8E3EB658-1A11-4BA7-983B-63FA2E5231700/data/Exhibit/find, Could not parse request with message: , status code 404, headers POST /2D9687B4-3707-406D-FFE5-0F693EAF1D00/8E3EB658-1A11-4BA7-983B-63FA2E5231700/data/Exhibit/find, null)

Can you share with me how your code that send request looks like now? Also, can you clarify that you iOS API key correct?

Regards, Nikita.

Of course, here’s the change I made across all my functions in my project that interact with Backendless:

  static Future<List<Exhibit?>?> fetchedExhibits() {
    var query = DataQueryBuilder()
      ..sortBy = ['endDate']
      ..related = ['linkedVenues', 'linkedCategories', 'linkedArtists'];
    var dbdata = Backendless.data.withClass<Exhibit>().find(query);
    return dbdata;
  }

I just double checked the iOS API key and there was an extra 0 that was messing me up! Thanks for the prompt to look, everything’s loading up on iOS now so thank you SO much!!!

(AndI won’t forget about using find and then again! Promise! :cowboy_hat_face:)