Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flutter: where is xcode_backend.sh?

Tags:

flutter

In the doc https://github.com/flutter/flutter/wiki/Obfuscating-Dart-Code, it says Add the following flag to the build aot call in the <ProjectRoot>/packages/flutter_tools/bin/xcode_backend.sh file.

But I don't have the directory <ProjectRoot>/packages/ at all. Do I have to create it somehow? Thanks a lot.

like image 236
sgon00 Avatar asked Dec 15 '18 15:12

sgon00


2 Answers

I had same issue and I was able to fix this by adding Flutter SDK path in User-Defined Settings. Open Project Target and add User-Defined Setting with key name FLUTTER_ROOT with the value of your flutter SDK location. Image below for further reference.

enter image description here

like image 146
Usman Avatar answered Nov 13 '22 10:11

Usman


I guess there's a mistake on the official documentation.

UPDATE: the wiki page has now been corrected

It's not

<ProjectRoot>/packages/flutter_tools/bin/xcode_backend.sh

but should be (and it's)

<FlutterRoot>/packages/flutter_tools/bin/xcode_backend.sh

If you don't remember where you have installed flutter sdk try this command:

which flutter

it will show

<FlutterRoot>/bin/flutter

Then you will see your file in <FlutterRoot>

cd <FlutterRoot>
find . -name "xcode_backend.sh"
./packages/flutter_tools/bin/xcode_backend.sh

At least the official docs points out that this feature is

enter image description here

And point to this useful SO answer.

like image 6
shadowsheep Avatar answered Nov 13 '22 09:11

shadowsheep