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 /
  • Help Room /
avatar image
1
Question by gretty · Jun 03, 2014 at 04:15 AM · monodevelopcompiling

Compiler Warnings Are Now Errors

Hello

All of the sudden my Unity project is confusing compile warnings for compile errors. For example; I am unable to run my game because of the following 'compile error':

Internal compiler error. See the console log for more information. output was:Assets/MainScripts/MenuManager.cs(88,34): warning CS0219: The variable inputMovement' is assigned but its value is never used Assets/MainScripts/MenuManager.cs(110,26): warning CS0219: The variable inputMovement' is assigned but its value is never used

This is a simple compile warning that has been there for a while (the class MenuManager is not fleshed out yet). Is there a way to make Unity3d or MonoDevelop not make a warning an error?

I have cleaned my Monodevelop project and rebuilt it. But still no luck. Any ideas whats gone wrong (why warnings are now errors) and how I can fix it?

Comment
Add comment · Show 2
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 Owen-Reynolds · Jun 03, 2014 at 01:28 PM 0
Share

That does seem disturbing. But, comment out input$$anonymous$$ovement until you eventually use it?

I mean, many new warnings really do tell about things you should fix, right away, and old warnings just clutter it up.

avatar image greyforest · Aug 30, 2017 at 10:38 AM 0
Share

In my case: catch(Exception e) { //you shoud use e Debug.log(e); } OR catch(Exception) {}

4 Replies

· Add your reply
  • Sort: 
avatar image
3

Answer by Archie888 · Aug 30, 2015 at 06:00 PM

I had an issue like this, with threaded stuff, tasks involved etc, using Parse with unity. In my case, I had one error line, in which it seemed that warning messages were written on. If you have a scenario like mine, scroll down the whole message, and you will see that this is not only about warnings turning into errors, but there is an actual error message there in the end, with a long stack trace.

My specific error message was: "Unhandled Exception: System.ArgumentException: Trying to emit a local from a different ILGenerator."

I had a try-catch block in my code. Removing that try-catch block removed my specific issue.

Very weird. I'll repeat this post in all threads on the issue I can find, perhaps it can help someone.

Comment
Add comment · Show 4 · 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 pingFromHeaven · Oct 15, 2015 at 08:55 AM 0
Share

This. Though, removing the whole try-catch block wasn't necessary. What I did was: "catch(Exception e)" to "catch" and it compiled.

After fiddling around a little, I found out that actualling using "e" in the catch block also fixes the issue for me.

avatar image JamesACoote · Nov 08, 2016 at 12:26 PM 0
Share

I got this error when I changed a method to be run as a coroutine ins$$anonymous$$d of just being run normally off the main thread. The method had a try-catch in it, so I presume Unity coroutines simply don't like try-catch in them. Removing the try-catch or making the method not run inside a coroutine solved the problem.

avatar image mrpmorris · Jan 13, 2017 at 01:22 PM 0
Share

Excellent tip, thank you! Beneath my sea of warnings was an error about a not being able to compile a specific line of code. I took out the named parameters and it worked.

avatar image ThomLaurent · Feb 13, 2017 at 08:15 PM 0
Share

Thanks, for me the problem was the use of the params keyword in an attribute constructor. I'm still not sure why it's throwing a $$anonymous$$ono.CSharp.InternalErrorException though :/

(I love the exception message making no sense: VerifyArgumentsCompat didn't find any problem with rejected candidate ConstructorBuilder ['$$anonymous$$yCustomAttribute'])

avatar image
1

Answer by Fornoreason1000 · Jun 03, 2014 at 04:31 AM

Oh oh.. "internal Compiler Error" is bad news, how ever could you post lines 110,88 and 34 of your Menu Manager script? that way i can guide you top a way of hopefully fixing your compiling errors.

Internal Compiler are bad news for one reason: your are likely not at fault and some internal glitch has messed up the compiler... basically unity's compiler is having major issues with MenuManager script for whatever reason and is getting unhanded errors in the compiler itself.

Now to fix it is not easy... try importing MenuManaer.cs to a new project and see if it still does it. then try backing up and removing MenuManager.cs. Sometimes i have notice that projects just go kapoot... other times is when the error is so bad that unity doesn't even know what it is... any rate your warning are "converting themselves into errors" but warning can cause them.

your warning says "variable is assigned but never used" this usually does not cause an error, its more of a performance thing.

Cleaning your MonoDevelop project will do nothing if you haven't cleaned the unity, remember unity is the one with the error not MonoDevelop.

Also i strongly suggest you contact Unity support, they are trained to deal with these cases. you know "internal Compiler Errors"... only they can fix it since the error is in Unity itself.

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
1

Answer by Kurius · Nov 30, 2016 at 10:51 PM

I had what seemed to be several warnings appearing as errors! When I scrolled down through the warnings, I noticed there truly was an error listed at the very end.

ERROR... "Unhandled Exception: System.ArgumentException: Trying to emit a local from a different ILGenerator"

CAUSE... The error occurred because I had just put a TRY CATCH statement inside a COROUTINE. Unity doesn't like that!

SOLUTION... I resolved the error be removing all Try Catch statements from all Coroutines.

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 alok-kr-029 · Feb 13, 2015 at 04:20 AM

I solved it by removing the warnings one after the other and all of the sudden the compile error disappeared though there was many warning If you have this problem just start solving the warning save the code check it in unity do this till your error disappear

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

32 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

Related Questions

How to enable 'unsafe' code option when debugging using Monodevelop 1 Answer

Problems debugging with Monodevelop 0 Answers

I can't type ANYTHING in monodevelop after upgrade a project from unity 4.6.8f1 to 5.3.1f1 1 Answer

Why does UnityEngine not exist in the current context? 0 Answers

Why does MonoDevelop crash on startup when it's run by a second user on my computer? 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