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
0
Question by mgeorgoulopoulos · Oct 18, 2013 at 12:27 PM · iosxcodepluginsunity 4

UnityAppController.mm copied in

Hello there,

We recently upgraded to Unity 4.2, however after following the upgrade notes regarding the Assets/Plugins/iOS folder, my custom UnityAppController.mm file is being copied to Libraries instead of Classes folder! Of course this causes duplicate symbol definitions in XCode 5.

Is there a workaround this?

Thank you in advance

Comment
Add comment · Show 4
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 MattPicioccio · Nov 07, 2013 at 06:54 AM 0
Share

I am working on the same problem. Did you find a solution?

avatar image feiting · Nov 07, 2013 at 08:00 AM 0
Share

I am unsure about the porting, but in XCode, if you click on the project name (the upper-left) you'll see the settings for the project. Off towards the right side tabs is the Build Phases, and Copy Build Phase has a bunch of include/don't include options usually. However I realize this may be more with your initial import than the phases it uses. Otherwise, you can just hit delete on a file in XCode and when it asks, say "Delete reference only" and the file will stay, but the 2 references will no longer exist, you'll only have one reference to it. Should give you something to toy with at least, but unsure about solving.

avatar image MattPicioccio · Nov 07, 2013 at 05:35 PM 0
Share

Thanks, feiting, but unfortunately that doesn't help my situation (or likely alkisbkn either). I use an automated build process that creates a new XCode project every time, so I can't modify the XCode project in this way.

avatar image AndyMartin458 · Nov 13, 2013 at 09:35 PM 0
Share

$$anonymous$$ind of the reason they made UnityAppController.mm was to keep you from having conflicts with your own AppController. $$anonymous$$aybe you can solve the problem by making your AppController an extension of UnityAppController. https://developer.apple.com/library/ios/documentation/cocoa/conceptual/Program$$anonymous$$gWithObjectiveC/CustomizingExistingClasses/CustomizingExistingClasses.html

2 Replies

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

Answer by vladimirg · Nov 13, 2013 at 04:57 PM

We solved this problem using a different approach: we subclass UnityAppController and patch main.mm to use our own class. Unity 4.2 makes this even simpler with the IMPL_APP_CONTROLLER_SUBCLASS macro.

Comment
Add comment · Show 2 · 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 mgeorgoulopoulos · Nov 13, 2013 at 06:58 PM 0
Share

It's a nice idea, however our automated build system IIRC, uses Replace build. main.mm would be replaced, so it's not really working in this case. Unless I am missing something?

avatar image vladimirg · Nov 14, 2013 at 08:54 AM 0
Share

There's no problem with Replace builds. Unity's post-build script runs after all the files are in place, so our changes are the last to happen and don't get overwritten. But that's one way. And again I suggest you to take a look at the I$$anonymous$$PL_APP_CONTROLLER_SUBCLASS macro. It allows subclassing UnityAppController without changing any Unity code. However, this will only work for Unity 4.2 and up (thus we're sticking to our post-build script).

avatar image
0

Answer by eppz · May 12, 2017 at 03:11 PM

Just made a writeup on how to deal to deal with UnityAppController:
Override app delegate in Unity for iOS and OSX (1/4) Plugin workflow.

Basically two approach, one is doing with Notification Center, the other uses Method swizzling. Also there is an alternative for OSX.

Comment
Add comment · Show 1 · 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 Hellium · May 26, 2018 at 12:24 PM 0
Share

Hello eppz, I read your blog post. I have an issue with two plugins which have bot overriden the AppControllerClassName constant using the I$$anonymous$$PL_APP_CONTROLLER_SUBCLASS, and obviously, this produces an error at startup.


$$anonymous$$aybe, you can give a hand ?


$$anonymous$$y question is here:

https://answers.unity.com/questions/1510598/appcontrollerclassname-override-conflict-between-t.html

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

20 People are following this question.

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

Related Questions

BuildPlayer and Plugins on Ios 1 Answer

plugins folder & .dll 0 Answers

You must specify |clientID| for |GIDSignIn| error when trying to sign in with Google 0 Answers

iOS build is including Mac OSX .bundle files into Xcode Project 2 Answers

iOS Launch Options 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