Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UIToolkit doesn't work on Android. #98

Closed
AdamWorld opened this issue Apr 3, 2012 · 4 comments
Closed

UIToolkit doesn't work on Android. #98

AdamWorld opened this issue Apr 3, 2012 · 4 comments

Comments

@AdamWorld
Copy link

Hi!
I try to build & run any demo on Android but it fails with iphone related error.
I updated most up-to-date version of UIToolkit.
So I revert to old version but it works fine.
New version seems error on Android.

Thank you.
Adam.

@kruncher
Copy link

kruncher commented May 9, 2012

I too am experiencing the same problems:

Assets/Plugins/UIToolkit/UI.cs(79,58): error CS0103: The name `iPhone' does not exist in the current context
Assets/Plugins/UIToolkit/UI.cs(81,21): error CS0019: Operator `&&' cannot be applied to operands of type `bool' and `object'
Error building Player because scripts had compiler errors

@PapaWhiskey65
Copy link

change the code in ui.cs to the following

#if UNITY_EDITOR || UNITY_STANDALONE_OSX || UNITY_STANDALONE_WIN || UNITY_WEBPLAYER || UNITY_ANDROID
    var deviceAllowsHD = true;
#else
    var deviceAllowsHD = ( allowPod4GenHD && iPhone.generation == iPhoneGeneration.iPodTouch4Gen ) || iPhone.generation != iPhoneGeneration.iPodTouch4Gen;
#endif

or change the "#else" to "#elif UNITY_IPHONE" but then you'll need to define the var outside the #if block

@kruncher
Copy link

Cheers, this appears to solve the build issue for me.

Though I still can't test my game because the painfully slow Android emulator says that the game has stopped working (before anything has shown on screen)... I'm going to need an actual device sooner rather than later!

@prime31
Copy link
Contributor

prime31 commented May 17, 2012

latest push has android allowing HD now

@prime31 prime31 closed this as completed May 17, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants