Get Error in WebGL: ReferenceError: $ is not defined - unity3d

I have Unity project created in Unity 5.2.3. I open this project in Unity 5.3.3p3 and compile for WebGl and get error: Invoking error handler due to
ReferenceError: $ is not defined.

I find answer: in my code was line: Application.ExternalCall("$('#ViewerBox').data('unityViewer')." + method, values);
With symbol $

Related

How to fix Code Runner ReferenceError: function is not defined issue?

I've already installed node.js and i've done all the path stuff, but still Code Runner isn't working as expected, this is the output after running the code:
console.log(sum(5, 2))
^
ReferenceError: sum is not defined

i'm having this error with the flutter version for web each time i try to test it. But it works fine on mobile

Everything works fine and App is already in the play store but when i try to test for a web version it produces below error just for this particular App.
I want to know what is exactly wrong
lib/main.dart:15:8: Error: Error when reading
'lib/generated_plugin_registrant.dart': The system cannot find the
file specified.
import 'package:[NameOfApp goes
here]/generated_plugin_registrant.dart';
^ lib/main.dart:16:8: Error: Error when reading 'lib/generated_plugin_registrant.dart': The system cannot find the
file specified.
org-dartlang-app:/web_entrypoint.dart:11:3: Error: Method not found: 'registerPlugins'.
registerPlugins(webPluginRegistry);
^^^^^^^^^^^^^^^
Failed to compile application.

Unity Error: Unable to convert classes into dex format

I have created an Android Unity plugin (.aar file) which provides some custom positioning data to my Unity game. In my Unity script, I use,
var x = customClass.CallStatic<float>("getHeadX");
In order to get some location data. This method is called per frame to get the updated data (polling method) which makes it inefficient. Instead, I decided to call a C# method in my Unity script from my java code (plugin side) when the updated data is ready. To do this, in my java plugin, I wrote,
import com.unity3d.player.UnityPlayer;
...
UnityPlayer.UnitySendMessage("Manager", // gameObject name
"PluginCallback", // this is a callback in C#
"Hello from android plugin"); // msg which is not needed actually
However, the compiler complained that the package com.unity3d.player.UnityPlayer does not exist. So I copied classes.jar file from
C:\Program Files
(x86)\Unity\Editor\Data\PlaybackEngines\AndroidPlayer\Variations\mono\Release\Classes
\classes.jar
into the 'libs' folder of my android plugin's project. I built it successfully and copied the generated .aar file (mylibrary-release.aar) into Assets\Plugins\Android folder of my Unity project.
When I build the Unity project (Using 'Internal' build system), it gives me this error:
IOException: Failed to Move File / Directory from
'Temp/StagingArea\android-libraries\mylibrary-release\classes.jar' to
'Temp/StagingArea\android-libraries\mylibrary-release\libs\classes.jar'.
UnityEditor.Android.PostProcessor.Tasks.ProcessAAR.Execute
...
This error happens because the classes.jar dependency has name conflict with classes.jar (made by unity out of my plugin). So I changed the dependency name to unity_classes.jar and this resolved the issue but now I'm getting a new error when building my unity application:
CommandInvokationFailure: Unable to convert classes into dex format.
C:/Program Files/Java/jdk1.8.0_102\bin\java.exe -Xmx2048M
Dcom.android.sdkmanager.toolsdir="C:/Users/kamran.shamloo/AppData/Local/Android/Sdk\tools"
-Dfile.encoding=UTF8 -jar "C:\Program Files (x86)\Unity\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\sdktools.jar"
stderr[ Uncaught translation error:
java.lang.IllegalArgumentException: already added:
Lbitter/jnibridge/JNIBridge; Uncaught translation error:
java.lang.IllegalArgumentException: already added:
Lbitter/jnibridge/JNIBridge$a; Uncaught translation error:
java.lang.IllegalArgumentException: already added:
Lcom/unity3d/player/NativeLoader; Uncaught translation error:
java.lang.IllegalArgumentException: already added:
Lcom/unity3d/player/ReflectionHelper; Uncaught translation error:
java.lang.IllegalArgumentException: already added:
Lcom/unity3d/player/ReflectionHelper$1; Uncaught translation error:
java.lang.IllegalArgumentException: already added:
Lcom/unity3d/player/ReflectionHelper$a; Uncaught translation error:
java.lang.IllegalArgumentException: already added:
Lcom/unity3d/player/UnityPlayer; Uncaught translation error:
java.lang.IllegalArgumentException: already added:
Lcom/unity3d/player/UnityPlayer$1; Uncaught translation error:
java.lang.IllegalArgumentException: already added:
Lcom/unity3d/player/UnityPlayer$10;
...
The classes.jar (which you later renamed it to 'unity_classes.jar') gets automatically included into the built .apk by Unity, so you shouldn't include it yourself again (in your Android plugin), even under a different name.
In other words, first your android plugin "embeds" this .jar file inside itself. Then, when Unity adds your plugin into the game project, it also adds its own copy of that .jar file (it does that for all android projects). Consequently, Unity essentially ends up having 2 copies of the same .jar file in the project and complains by saying 'unable to convert classes into dex format'.
So although you have to use this library (.jar file) in your project but you should not bundle this library with your project. How to do that? If you're using Android studio, you can achieve this by marking the .jar file as a dependency with the provided scope.
To do this, you can:
1) Go to 'build.gradle' of your module and change this:
compile files('libs/jars/unity_classes.jar')
to this:
provided files('libs/jars/unity_classes.jar')
Or
2) you can right-click on the module (in Android pane) and choose Open Module Settings. Then go to Dependencies tab. Find the Unity module (which I renamed it to unity_classes.jar) and change its scope to Provided.

Cannot deploy new Liferay theme "The filename or extension is too long"

I'm new to Liferay and Eclipse, and I'm trying to do some simple theme development. However, once I right click my theme (which I just created) and go to Liferay->SDK->deploy I get the following error:
BUILD FAILED
C:\sdk6.2\build-common-plugin.xml:482: The following error occurred while executing this line:
C:\sdk6.2\build-common.xml:993: The following error occurred while executing this line:
C:\sdk6.2\build-common.xml:299: The following error occurred while executing this line:
C:\sdk6.2\build-common.xml:1783: The following error occurred while executing this line:
C:\sdk6.2\build-common.xml:175: java.io.IOException: Cannot run program "C:\jre7\bin\java.exe": CreateProcess error=206, The filename or extension is too long
I was using a longer path for my SDK and JRE7 but reduced it to what you see in the above error message (to no avail). Does anyone know how to fix this problem?
Reconfigure your SDK folder, try to use a label for it without any "." or special char.
For example:
C:\liferay\sdk621\
And tell us your results...it could be a windows/ant path problem...

Base SDK missing for PhoneGap-based iOS application

I have installed the PhoneGap library for iOS and created a new project, but when I run the application I get the error Base SDK missing. Why is this?
edit 1
230 errors after applying mAc reply these are some of the errors:
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFContext.h:60:23 /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFContext.h:60:23: error: expected function body after function declarator
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIView.h:250:91 /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIView.h:250:91: error: expected a type
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIView.h:256:86 /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIView.h:256:86: error: expected a type
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIView.h:258:114 /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIView.h:258:114: error: expected a type
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIApplication.h:187:31 /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIApplication.h:187:31: error: unknown type name 'UIApplicationState'
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIApplication.h:190:4 /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIApplication.h:190:4: error: expected a type
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIApplication.h:191:28 /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIApplication.h:191:28: error: expected a type
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIApplication.h:202:45 /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIApplication.h:202:45: error: expected a type
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIApplication.h:206:4 /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIApplication.h:206:4: error: expected a type
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UITextView.h:82:22 /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UITextView.h:82:22: error: unknown type name 'UIDataDetectorTypes'
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIWebView.h:54:22 /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIWebView.h:54:22: error: unknown type name 'UIDataDetectorTypes'
/Users/Ahmed/Documents/PhoneGapLib/Classes/Camera.h:56:10 /Users/Ahmed/Documents/PhoneGapLib/Classes/Camera.h:56:10: error: cannot find protocol declaration for 'UIPopoverControllerDelegate'; did you mean 'UITabBarControllerDelegate'?
/Users/Ahmed/Documents/PhoneGapLib/Classes/Camera.m:24:3 /Users/Ahmed/Documents/PhoneGapLib/Classes/Camera.m:24:3: error: use of undeclared identifier 'UIUserInterfaceIdiomPhone'; did you mean 'UIUserInterfaceIdiom'?
i think you have import a project...
see select your project and go its INFO -> there in build Tab -> Architectures -> In Base SDK select Latest iOS -> save n close. Now select the simulator (by default Device is selected).
And then run the app.
Edited :-
Might be a bug in Xcode 3.2.4 or the SDK configuration.
Try placing a line like one of these in your Build Settings Preprocessor Macros:
-D__IPHONE_OS_VERSION_MIN_REQUIRED=040100
or
-D__IPHONE_OS_VERSION_MIN_REQUIRED=030103
You can Check Here also regarding your problem.
Hope it Helps :) Adios
In the project.pbxproj file, I had to change this in a few places:
IPHONEOS_DEPLOYMENT_TARGET = 5.0;
to
IPHONEOS_DEPLOYMENT_TARGET = 6.1;