ARC enabling (DEF-3352) (SOLVED)

I’m making an extension for ios.but the code need ARC, and I get the following error:
image
and my code is:
image

How to enable ARC in defold?

1 Like

I try to add platforms to ext.manifest.But get the following error:

Well, that’s not an obvious one: There’s a missing space between “flags:” and the value:

flags: ["-fobjc-arc"]

Note however that this flag isn’t whitelisted yet (I can do that today and you should get it in the next release scheduled for monday). But isn’t ARC enabled by default? (I mean, the arc-exceptions should be enabled by default according to this)

2 Likes

In my defold project, ARC is not enabled by default, how to enable it?

No I meant by the compiler (clang)

In my project, only one .m has #if !__has_feature(objc_arc)
How can I solve this build error?

As I mentioned, you have to wait for the next release to get access to the “-fobjc-arc” flag.

Also, be aware that we are currently using “clang++” to compile the code (as C++/Objective-C++". We have a ticket for this: DEF-3084

Are you adding the entire AFNetworking source code to the project, or prebuilt lib files (.a) ?
You could try to create the library files locally (with arc), and add them instead?

The -fobjc-arc, -fno-objc-arc, -fobjc-arc-exceptions and -fno-objc-arc-exceptions are now added to the SDK in release 1.2.132.

4 Likes