• 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 jdog98 · Jan 28, 2015 at 04:17 PM · c#androidgui

compiler errors when building for android

T$$anonymous$$s is the first time I have built t$$anonymous$$s project for my phone, and im getting the following errors during the first stage of the build.

alt text

Everyt$$anonymous$$ng is set up correctly to produce the app for android and I can test the game in unity without any problems

capture.png (37.4 kB)
capture.png (37.4 kB)
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 Bonfire-Boy · Jan 28, 2015 at 04:38 PM 0
Share

Have you checked that you're not calling any unity functions when initialising fields?

avatar image jdog98 · Jan 28, 2015 at 04:42 PM 0
Share

If i did, I wouldnt know it.... So what am I looking for?

the script mentioned in the 5th error is not used in the build

avatar image NeverHopeless · Jan 28, 2015 at 08:10 PM 0
Share

What about the 5th error ? Can you please check if there is a OnGUI() function in this script ? If yes, then what do you do in it ? Have you checked you didn't do anything in the background which should NOT be in background thread ?

avatar image jdog98 · Jan 28, 2015 at 08:16 PM 0
Share

I've never done anything with the background(assuming that's a variable of some type), and yes, it has the OnGUI function

2 Replies

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

Answer by NeverHopeless · Jan 28, 2015 at 10:25 PM

As you said in a comment that the error is on UnityEditor import and the code runs fine on unity but the problem is with the platform other than unity editor so my guess is that you need platform dependent compilation. Since AFAIK unity editor is not available for builds.

I have also faced UnityEditor issue (not exactly similar to t$$anonymous$$s one) when tried to use a unity alert for Android and iOS devices.

Hopefully, after defining an equivalent functionality for your devices, to not use, UnityEditor namespace will fix the issue.

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
avatar image
0

Answer by tanoshimi · Jan 28, 2015 at 08:21 PM

The 4th and 5th errors look relatively explicit and easy to solve (though it's hard to be certain as we can't see the full text).

  • You're calling GUI.xxx from somewhere other than in OnGUI()

  • There's an error on line 4 of masterServerNetwork.cs

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 jdog98 · Jan 28, 2015 at 08:28 PM 0
Share

The line that the error is on is a using directive.

using UnityEditor;

avatar image jdog98 · Jan 28, 2015 at 09:01 PM 0
Share

I looked, and everything GUI related is in OnGUI

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.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

21 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

Related Questions

Animator.Update High CPU Usage on Unity 5 resulting in bugs on Android 0 Answers

UI Prefab not instantiating on build for Android. 1 Answer

Problem with modifying scrollPosition on android 1 Answer

Unity Scale One Text Field GUI 2 Answers

Clamp To The Screen Edge 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