• 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
Question by mariomario · Jun 28, 2015 at 05:58 PM · androideditorbuildunity5editor-scripting

BCE0044 erro only shows when trying to build .apk

Hello there,

My problem is kinda weird. In the editor my game run fine but when I try to build the .apk it appears in the console:

Assets/Scripts/AnySwipe.js(322,1): BCE0044: expecting }, found ''.

My script is the following:

 #pragma strict
 
 public var minLenght     : int         = 50;            //the minimum length to be consider an swipe 
 
 @Range(0.0f, 1f)
 public var relevance     : float        = 0.9f;            //amount of relevance to take into account for checking
                                                     //if an swipe is swiped according to the desired direction
 
 #if UNITY_EDITOR
 public var touchEnabled : boolean;                    //useful if you would like to use touch input from the editor if using UNTIY REMOTE
 #endif
 
 private var    touchStart    : Vector2;                    //swipe starting position
 private    var    touchEnd    : Vector2;                    //swipe ending position
 private var    dir            : Vector2;                    //direction of swipe
 private var    isInit        : boolean;                    //determines if swipes can be check against
 private var    reset        : boolean;
 private var    isTouchDown : boolean;
 
 //JUMPS HANDLER
 public var jump :int;
 public var jump2 :int;
 
 //Get current swipe direction
 public function get Dir() : Vector2{ 
 
     return dir;
 }
 
 #if UNITY_EDITOR
 function OnEnable(){
 
     if(touchEnabled)
         Debug.Log ("AnySwipe : Tounch Input Enabled");
 }
 #endif
 //-------------------------
     
     
 //-------------------------
 public function CheckForSwipe (swipe : Vector2) : boolean {
 
 
     if(isInit){
 
         
         //compare current swipe to desired swipe direction
         var dot : float = Vector2.Dot(swipe, dir);
 
         //round to 2 decimal places
         dot = Mathf.Round(dot * 100)/100;
 
         //check if current swipe is wit$$anonymous$$n match to desired swipe direction
         if(dot >= relevance){
 
             return true;
         }
 
     }
     
     #if UNITY_EDITOR
     if(!isInit){
 
         //display error
         Debug.LogError("AnySwipe, Must call IsSwiped(), before you can use CheckForSwipe()");
     }
     #endif
 
 
     return false;
 
 }
 //-------------------------
 
     
 //-------------------------
 public function IsSwiped() : boolean{
 
     #if UNITY_EDITOR
 
         if(!touchEnabled){
 
             if(!isTouchDown){
 
                 if(Input.GetMouseButtonDown(0)){
                         
                     isInit = true;
                     isTouchDown = true;
                     touchStart = Input.mousePosition;
 
                 }
             }
             else{
 
                 if(Input.GetMouseButtonUp(0)){
 
 
                     isTouchDown = false;
 
                     touchEnd = Input.mousePosition;
                             
                     dir = touchEnd - touchStart;
 
                     reset = true;    
 
                     //check lenght
                     if(dir.sqrMagnitude >= minLenght * minLenght){
     
                         dir.Normalize();
                         return true;
                                 
                     }
 
                     else {Debug.Log("JUMP");
                     jump = 1;
                     jump2 = 1;
                     }
 
 
         
                 }
             }
 
 
         }
         else{
 
             if(Input.touchCount > 0){
                 
                 
                 var touch : Touch = Input.GetTouch(0);
                 
                 if(!isTouchDown){
 
                     isInit = true;
 
                     isTouchDown = true;
                     
                     touchStart = touch.position;
 
                     
                 }
                 else{
                     
                     touchEnd = touch.position;
 
                     
                 }
                 
 
             }
             else{
                 
                 
                 if(isTouchDown){
                     
                     isTouchDown = false;
 
                     dir = touchEnd - touchStart;
 
                     reset = true;
 
                     //check lenght
                     if(dir.sqrMagnitude >= (minLenght * minLenght)){
                         
                         dir.Normalize();
                         
 
                         return true;
                         
                     }
 
                 }
 
             }
 
         }
         #elif UNITY_WEBPLAYER || UNITY_STANDALONE
 
         if(!isTouchDown){
             
             if(Input.GetMouseButtonDown(0)){
                 
                 isInit = true;
                 isTouchDown = true;
                 touchStart = Input.mousePosition;
                 
                 
             }
         }
         else{
             
             if(Input.GetMouseButtonUp(0)){
                 
                 
                 isTouchDown = false;
                 
                 touchEnd = Input.mousePosition;
                 
                 dir = touchEnd - touchStart;
                 
                 reset = true;    
                 
                 //check lenght
                 if(dir.sqrMagnitude >= minLenght * minLenght){
                     
                     dir.Normalize();
                     
                     
                     return true;
                     
                 }
                 
                 else {Debug.Log("JUMP");
                 jump = 1;
                 jump2 = 1;
                 }
 
             }
         }
 
 
 
         #elif UNITY_IOS || UNITY_ANDROID
 
         if(Input.touchCount > 0){
             
             
             var touch : Touch = Input.GetTouch(0);
             
             if(!isTouchDown){
 
                 isInit = true;
 
                 isTouchDown = true;
                 
                 touchStart = touch.position;
                 
             }
             else{
                 
                 touchEnd = touch.position;
                 
             }
             
             
         }
         else{
             
             
             if(isTouchDown){
                 
                 isTouchDown = false;
                 
                 dir = touchEnd - touchStart;
 
                 reset = true; 
 
                 //check lenght
                 if(dir.sqrMagnitude >= minLenght * minLenght){
                     
                     dir.Normalize();
                     
                     
                     return true;
                     
                 }
                 
                 else {Debug.Log("JUMP");
                 jump = 1;
                 jump2 = 1;
             }
 
                 
             }
         }
 
         #endif
 
         if(reset){
 
             reset = false;
             isInit = false;
         }
         return false;
 }
 

Well, as you can see the referred line does not even exist. Can t$$anonymous$$s be related to the fact that I'm using an Editor extension?

Comment

People who like this

0 Show 1
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 tanoshimi · Jun 28, 2015 at 06:08 PM 0
Share

Please format your code properly so we can see the line numbers.

0 Replies

· Add your reply
  • Sort: 

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

2 People are following this question.

avatar image avatar image

Related Questions

Distribute terrain in zones 3 Answers

Fog not moving with camera on mobile build 0 Answers

How to exclude "Selection & Handles" and other editor-specific code in builds? 2 Answers

Automate exclusion of specific Android plugin from build? 0 Answers

Script works in editor, but does not work in build (Android) 1 Answer


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