I need help with setting properly environment variables with API.
I have added API Calls to my backend. When i run test calls using FF Response & Test
they work fine.
However when i build, build fails with following error:
(...)
Running pod install... 1,623ms
Running Xcode build...
Xcode build done. 21.7s
Failed to build iOS app
Error (Xcode): lib/backend/api_requests/api_calls.dart:52:5: Error: Local variable 'baseUrl' can't be referenced before it is declared.
Could not build the application for the simulator.
Error launching application on iPhone 16 Pro.
I have downloaded code to see where exactly is the problem:
How i have my API and variables set up:
API
API Base URL set as
[base_url]
parameter (it will be different for different environments)set up group variable
base_url
Environment:
development
defined
apiURL
variable with my localhost endpoint
In all actions using API calls i am providing value for
base_url
indicating environmentapiURL
variable