Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 Hellium · May 25, 2018 at 02:38 PM · iosplugin

Conflict between two iOS plugins overriding AppControllerClassName

I am developping an iOS application using two plugins.


These two plugins try to override the AppControllerClassName constant as soon as they get loaded, using the IMPL_APP_CONTROLLER_SUBCLASS macro defined in the UnityAppController.mm. However, this causes a conflict when running the app. The latter crashes when it starts, and throws the following error :


Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[XXX setGameObjectName:]: unrecognized selector sent to instance YYY'


Has anyone faced the same problem and found a solution to prevent this?


Someone on Github suggested to do the following without giving more information.


Try to move all the implementation block of the 1st plugin into the 2nd one, or change the 1st plugin .mm file to be a category of 2nd plugin's app controller instead of being a subclass of the unity app controller.


@eppz : I saw your blog post here but I was unable to apply this to the existing plugins I currently use.

Comment
Add comment · Show 3
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 EvOxOPTICSx · Jun 25, 2018 at 07:31 AM 0
Share

If you don't have experience in a field then you should learn it and gain experience before flooding the knowledge base.

avatar image Hellium EvOxOPTICSx · Jun 25, 2018 at 07:35 AM 1
Share

Haha, nice try @EvOxOPTICSx. I did try to do the job by myself, I can't post the things I tried because the plugins I use are paid. And on the contrary of you, it's not a trivial question about how many arguments I have to put when calling a function. I was trying to merge two native iOS plugins because the creators of the plugins did not do their job correctly.

avatar image Vemassa · Sep 28, 2020 at 02:24 PM 0
Share

Hello,

Have you been able to understand how to solve this by yourself since then?

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by eppz · May 26, 2018 at 03:01 PM

@Hellium I think you can hook them up serially. Just make PluginA a subclass of UnityAppController, then make PluginB a subclass of PluginA (also, override PluginA methods by calling superclass implementations at the start of each method), then use PluginB only. You cannot work this around without modding the plugins themselves. This is why I think the current plugin architecture is broken.

Comment
Add comment · Show 3 · 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 27, 2018 at 06:11 AM 1
Share

Thanks a lot for your quick answer eppz ! I don't have any experience with native mobile development, but I will give it any try tomorrow and I will let you know. Thanks again !

avatar image eppz Hellium · May 27, 2018 at 11:23 AM 0
Share

Well, subclassing is all the same in Objective-C as well.

avatar image Hellium eppz · May 29, 2018 at 07:12 PM 0
Share

@eppz : I haven't been able to merge the two plugins.... Objective-C is such an horrible language..... But I have contacted someone fluent with this language to help me.

Thanks again eppz for your help!

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

120 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 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 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 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 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 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

What does Texture.GetNativeTexturePtr() return when using Metal? 1 Answer

Writing unity ios plugin in Swift 1 Answer

Native plugin problems with varargs on iOS (Opus) 0 Answers

Memory problem with UIImagePickerViewController 0 Answers

Docs say managed-to-unmanaged calls are very slow on iOS. Why? Will it be fixed? 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