ExpressionEvaluator.Evaluate when unity build apk - unity3d

im using a script in my project and in this script for solve a simple math equation same "1+2-2+1" from string input i use
ExpressionEvaluator.Evaluate
but this is in unityeditor class and when i build my project i reach an error that is say
"The name "ExpressionEvaluator" does not exist in the current context."
i handle this error with using Platform Dependent Compilation https://docs.unity3d.com/Manual/PlatformDependentCompilation.html but when i try to install apk i reach an error on android device and device say the application is not install.
now my question is that,is there any alternative for ExpressionEvaluator.Evaluate or any suggestion that you can helm me with.
thank you so much.

I doubt the installation failure has anything to do with conditional compilation. I can't say much about that, but regarding ExpressionEvaluator, there is a lot of code in UnityEngine. If you were to bundle all that code with your game, you'd get a multi-hundred megabyte apk on your hands; not to mention that most of the code is probably native and they don't/can't build it for all target platforms, only editor platforms (Windows, MacOS).
You really shouldn't use UnityEditor code in your game logic, not even in the editor. If you use UnityEditor it should only be in editor code. If something's in UnityEditor and you need to support it at runtime, you should find a library that does the same, or write it yourself. You can search for one online or on SO. Here's the first result from a Google search:
I need a fast runtime expression parser

Related

Platform.io - how to compile just library files, which are used in project

I'm using library ESP8266 audio, which contains lot of files. I'm using just a few of them, but when I want to build my project, platformio tryes to complie ewerything. It's quite issue, because unused filles has dependecies, which are not included in my project (eg. SD card library, file system library...). I can build my code with arduino IDE without any issues, but I'm not able to do the same thing in platformio. I tried to tweak src_filter flag, but it has no effect at all. I'm stucked on this for more than day and I wasn't able to find any relevant informations :/
Thank you for your answers.
Oh, I solved it myself! :D I have set 'lib_ldf_mode' to 'deep' on platformio.ini. It's now acts exactly as I need. It starts in 'src/' folder and then recursively compiles imports and imports of imports and so on.

Why can't I debug into UnityEngine.UI code?

I add the UnityEngine.UI.dll and UnityEditor.UI.dll to my assets folder with their mdb files . also i add the both project to my current project. i am sure all the unity engine ugui code build success, because i debug log in the event system, and it print message. when i want to step into the event system class, i always failed . I find unity will load the code from a build path ,rather than i original code. Why does it do this ? if i want to debug unity engine ugui code, what should i do ?
To debug code, you need two things:
Symbols, the list of all functions, classes, variables used throughout the module. When using C++ symbols are stored in special .pdb files on Windows (and you obviously are using Windows since you are talking about dlls). Symbols in C# (.NET in general) are stored in the .dll itself. Having symbols will let you see the name of functions on the call stack and possibly some variables but nothing more.
Source code of the module.
U3D's source code is proprietary - you need to spend a good amount of money to receive it. And if I am guess to - UnityEngine.UI.dll is a C++ module with stripped (removed) symbols removed.
Thus you have neither, so you can't debug U3D's code at all.
Why would you need to that anyway? If you want to see how the internals of a big game engine work, there are plenty of other options (for example UE4 and Lumberyard). If you are struggling with a problem and you'd like to be able to solve it through debugging...well though luck. Your best bet would be to ask in unity community.

What are these errors in BlackBerry 10 Mometics while trying to build LAME?

I'm trying to build with the LAME files but I'm getting these errors on the machine.h file
What's going on?
Short answer : your defines are not what they are supposed to be. The BB10 SDK provides stdlib.h and string.h so you should either :
add a #define STDC_HEADERS 1 somewhere in the include path (inside version.h maybe, because it's seems to be included by everyone else)
add DEFINES += STDC_HEADERS to your .pro file.
You are trying to build your library inside Momentics.
That's usually the fastest way to go.
The issue is that you are skipping the whole configure part of Lame compilation, which was supposed to gather insight about the system you're trying to compile on by trial and error.
I haven't looked at Lame specificaly, but usually configure either creates an header file with all the right defines or add them in the Makefile it creates as arguments to the compiler.
Momentics, on the other way, compiles all .c|.cpp file and link them all together using qmake to handle all Qt specific bits. Momentics sets the right environment, and then there is a lot of scripts to handle all the BB10 processes (package, sign, ..).
So you'll have to provide the missing parts. Usually it's faster to create a new config.h from scratch, but sometimes you may want to use a console with the BB10 SDK environment and do a ./configure manually. Don't forget that the simulator is x86 and the real thing is ARM, so you will have take care of that too (Endianness/optimization issues).

WebRTC in iPhone (gas-preprocessor issues)

I'm trying compile the lastest WebRTC version for iPhone. I not need to compile the entire solution, I only need to compile the VAD module.
To do that, I have created a Xcode project and I have tried to compile the source necessary, but I have a problem with the *.s files and its assembler.
Like in the FFMPEG library, I know that I must "translate" the assembler code to an assembler code that the gcc for iPhone understand, but I don't know how I do this manually.
I have tried to create a configure file and set in it "as=gas-preprocessor.pl" (like in FFMPEG), but does not work.
Any idea? How do I run the gas-preprocessor.pl manually?
Thanks.
I'm just finishing it on iOS and has built standalone static libraries of NS/VAD/AECM and AGC, here's some tips for you, and hope you success:
1. Source File List
for standalone VAD build, you should make sure your project has all of these files(no .s file needed), and I'm not listed the header files here, you will get some header file can not be found errors, just fixing it and things will be done.)
webrtc_vad.c
vad_core.c
vad_filterbank.c
vad_gmm.c
vad_sp.c
real_fft.c
division_operations.c
complex_bit_reverse.c
cross_correlation.c
complex_fft.c
downsample_fast.c
vector_scaling_operations.c
get_scaling_square.c
energy.c
min_max_operations.c
spl_init.c
2. Adding a macro called WEBRTC_MAC
I'm not sure why the Xcode environment does not provide this macro, but it should be defined to ensure that WEBRTC_POSIX is enabled. To define this macro, adding it to a new header file or just define it in the webrtc-header-files.
3. Following these steps to build and setup a static library of WebRTC-VAD module on iOS
notice, do not use LLVM 2.0 to compile the VAD module(use GCC or LLVM GCC). cus' it can throw you lots of errors when compiling some webrtc variable declarations.
4. Using the libwebrtc_vad.a
if you got this far, things are easy to go, just include webrtc_vad.h and using the API provided by this module. and vad is working fine in my case.
hope i helped.
try to check this link https://groups.google.com/forum/?fromgroups=#!topic/discuss-webrtc/VJg-fk2-i_0 i believe you have to set inline assembly correctly. I am also onto this so let me know if you want to switch emails or something.

I seek library project for iOs built with makefile

I am looking for a simple library ( and/or app - eventually want both ) example ( like a math library or whatever) for iOS which has a makefile for it that I can use as a template to make other makefiles from and learn. Static of course, (and dynamic if iOS supports it so I can have 2+ apps that share common code)
There is lots of incomplete and cryptic info out there but so far I havn't found any nice concise "with these source files" you create a makefile this way to build an iOS "fat" library I can import into other projects.
This would be on a Mac with the ios4 sdk installed.
It is always great to start with something that basically works.
I have created complex makefiles before for unix and windows and for other devices.
thanks.
The first link pictorially represents the process step by step that you've asked then the second link contains a package that allows a programmer to compile a make file based project
click me
click me
If you want to build a static library using a make file and link against it every time you build your Xcode project, you can add a "run script" build phase in your project before all the others, which runs this make file, and then add the built library to your linking phase. If you want a make file that builds the entire iOS project, I don't think it's posible (you can use the command line to compile the project without Xcode opened though).