Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
4
Question by s2quinnh · Jan 28, 2015 at 10:31 PM · iospluginxcode

iOS - Disable ARC on XCode Projects

Is there a way to disable Automatic Reference Counting (arc) when Unity builds the XCode project? When I open the XCode project, I see that Objective-C Automatic Reference Counting is set to "Yes" in Build Settings. But having this on is breaking a plugin that I have. I want to know how to change this when it builds the project so I don't have to remember to switch it every time I make a new build.

I'm using Unity 5 Beta v18 on a Mac. Trying to build with default iOS Settings.

Thanks in advance for any help.

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
22
Best Answer

Answer by s2quinnh · Jan 28, 2015 at 11:31 PM

I figured it out! For others out there that might run into this issue, here's how to fix it.

I didn't realize Unity allowed you to add custom Compile flags to individual plugins. Simply find your plugin code in the Assets/Plugins/iOS/ folder, select the file that's giving you problems. In the Inspector you should see "Compile flags" towards the bottom. Add -fno-objc-arc to this and hit "Apply." Now Unity will compile the XCode project with ARC turned off for this file. Pretty neat!

Comment
Add comment · Show 5 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Hotshot10101 · Mar 13, 2015 at 01:02 AM 0
Share

I tried to do this and still get the compiler errors on using the release method. Any idea what I might have missed? I did hit apply.

avatar image Hotshot10101 · Mar 13, 2015 at 01:16 AM 0
Share

turns out I had to Replace the project when I built it. Just doing the Append option didn't seem to update the compiler flags for the file.

avatar image s2quinnh · Mar 20, 2015 at 12:13 AM 0
Share

Glad you got it to work! And thanks for posting an answer for the future people who have the same problem.

avatar image ickydime · Nov 13, 2015 at 07:01 AM 0
Share

Hmm. I do not see compile flags in the inspector in 4.6.x. Is it just 5? The patch notes do mention that compile flags were added to 4.6... Just not sure where. Anyone?

avatar image Propagant · Jan 20, 2021 at 02:12 AM 0
Share

Hey thanks! You saved me a bunch of hours googling... God bless u

avatar image
1

Answer by ickydime · Nov 13, 2015 at 07:26 AM

If you have 4.6.x you can do it via a Post Process build script. See this as an example:

https://gist.github.com/keijiro/25bab1bb04de432f709f

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

6 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Creating a native photo picker screen on iOS 2 Answers

iOS Plugin - Possible to Register 2 subclasses of UnityAppController with IMPL_APP_CONTROLLER_SUBCLASS 0 Answers

Have to "Replace" iOS project every build because of Linker Errors 0 Answers

How to add Google Admob SDK for iOS in Unity editor (instead to do it manually in XCode)? 0 Answers

Heart rate Bluetooth PLUGIN IOS 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges