7

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?

halfer
  • 19,824
  • 17
  • 99
  • 186
sgon00
  • 4,879
  • 1
  • 43
  • 59

2 Answers2

23

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

Usman
  • 2,547
  • 31
  • 35
7

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.

Westy92
  • 19,087
  • 4
  • 72
  • 54
shadowsheep
  • 14,048
  • 3
  • 67
  • 77
  • yeah, you are right. The official doc is wrong. Thank you very much for the detail answer. – sgon00 Dec 16 '18 at 05:33
  • Thanks for the info. Actually I found that issue about 6 hours ago and subscribed it. ^_^ Cheers. – sgon00 Dec 19 '18 at 13:46
  • Ahah! I've also spoken Italian! (too much multitasking...) ^^. Glad to know you have found my issue! Gunter has already put it on a milestone. C'ya! \(ᵔᵕᵔ)/ – shadowsheep Dec 19 '18 at 15:27