Open casamia918 opened 8 years ago
@casamia918, this one might be tough to debug...
@superkhau or @gunjpan, can you guys both try the install?
$ git clone git@github.com:strongloop/loopback-sdk-xamarin.git
$ cd loopback-sdk-xamarin
$ npm install
If either of you see similar failures, please let me know and I will figure out how to move forward from there.
Nobody here?
Sorry, I talked to @gunjpan in person and he said he had some issues too although they were different.
I'm on windows and I had issues building edge
when trying to install.
@casamia918, will keep you updated as we figure this out.
Do you know when this bug will be fixed?
@xnramx, the issue isn't actually with this repo, it's with dependencies. Whenever we have an issue with 3rd party dependencies, it's difficult to put a timeline on it.
Your best bet is to try and figure out what's going on with the dependency and see if you can get that built, then this repo should work fine.
For what its worth, I got it working on my machine by manually upgrading edge. First, I followed the install instructions for edge. For me it was the following commands:
$ brew tap aspnet/dnx
$ brew update
$ brew install dnvm
$ source dnvm.sh
$ dnvm install latest -r coreclr -alias edge-coreclr
$ brew install pkg-config
$ dnvm use edge-coreclr
At this point I restarted the terminal.
$ git clone https://github.com/strongloop/loopback-sdk-xamarin.git
$ cd loopback-sdk-xamarin/
$ vim package.json
I removed the line for edge, I believe the version was ^0.10.1
$ npm install
$ npm install edge --save
$ node bin/lb-xm ~/projectroot/server/server.js check
And everything seems to work just fine. I won't pretend that I know why this works because I'm just getting started with Node but here it is.
The edge version that gets installed is ^5.0.0
Thanks @jpflueger! I'm going to keep this issue open so that people can find your solution. I don't want to update the package.json to ^5.0.0
until we really get the chance to dive into this (not quite sure when that will be as we currently have quite a few open issue within the LoopBack-core.
Thanks @jpflueger . I followed your advise, removed currently installed edge version(^0.10.1) and installed latest edge version (^5.0.0). After that, I ran the lb-xm code, and got new error.
$ node ./bin/lb-xm ~/path/to/server/server.js
>> SDK Generator.
dyld: lazy symbol binding failed: Symbol not found: _mono_config_parse
Referenced from: ~/dev/loopback.io/loopback-sdk-xamarin/node_modules/edge/build/Release/edge_nativeclr.node
Expected in: dynamic lookup
dyld: Symbol not found: _mono_config_parse
Referenced from: ~/dev/loopback.io/loopback-sdk-xamarin/node_modules/edge/build/Release/edge_nativeclr.node
Expected in: dynamic lookup
Trace/BPT trap: 5
By reading https://github.com/tjanczuk/edge, it seems to need to use core_clr variable. So I declare EDGE_USE_CORECLR variable, and got new error
$ EDGE_USE_CORECLR=1 node ./bin/lb-xm ~/path/to/server/server.js
>> SDK Generator.
>> Server parsed, templating code...
undefined:1
(function (f, ctx) { return function (d, cb) { return f(d, cb, ctx); }; })
^
Error: Could not load type 'System.Console' from assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e'.
at Error (native)
at <anonymous>:1:55
at Object.<anonymous> (/Users/HiChoi/dev/loopback.io/loopback-sdk-xamarin/bin/lb-xm.js:50:4)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Function.Module.runMain (module.js:441:10)
at startup (node.js:139:18)
at node.js:968:3
I read lb-xm.js line 50 and found it’s the edge function that calling LBXamarinSDKGenerator.dll. Refer to the readme, this is builded library for the C# part of the SDKgenerator. I presumed that the error is due to the system library loading. So I opened the the LBXamarinSDK.sln (C# project) to observe C# source code. Actually, I installed Xamarin Studio for my project to develop client side. At first, I updated the packages used in SDKgenerator (RestSharp or Newtonsoft.json) and tried to build but failed. Error message is
Build FAILED.
Errors:
~/loopback-sdk-xamarin/C#/LBXamarinSDK/LBXamarinSDKGenerator.csproj (Build) ->
/Library/Frameworks/Mono.framework/Versions/4.2.3/lib/mono/4.5/Microsoft.CSharp.targets (CoreCompile target) ->
CSC: error CS2001: Source file `DynamicModels.cs' could not be found
CSC: error CS2001: Source file `DynamicRepos.cs' could not be found
CSC: error CS2001: Source file `HardcodedModels.cs' could not be found
0 Warning(s)
3 Error(s)
Time Elapsed 00:00:00.2575230
---------------------- Done ----------------------
Build: 3 errors, 0 warnings
Hmm… I blocked in every step by step. Anyway, can someone find the cause of System.console problem? Thanks.
At last, I made it. Just do jpflueger's bash command. After various trial, my loopback-sdk-xamarin project folder looks like somewhat twisted. So I removed the whole folder, uninstalled the every related products (mono, edge), and only follow the jpflueger's step.
Do not install mono by yourself from the mono homepage. When you execute
$ dnvm install latest -r coreclr -alias edge-coreclr
the mono is installed automatically during the coreclr installation step. I guess that that my error 'cannot load type System.Console' is due to the complict of 2 mono version. (I'm not sure).
Thanks
Hi @casamia918 is your issue fixed? I mean was it just the version conflict or you are still running into other issues?
@loay See my last comment. I fixed all isssues. What problems do you have?
All my issues were fixed by replacing the requirement for edge into edge-js, in lb-xm.js
, L14 (var edge = require ('edge');
) -> (var edge = require ('edge-js');
)
[Environment]
I'm following the installation guid step by step.
Clone the git repositories and executed
Then, the error message is
I found that loopback-sdk-generator needs mono64, and the brew install link in the install script is broken. So I installed mono64 by official homepage. http://www.mono-project.com/download/ -> Download Mono Universal Installer
After install mono64(Wait. when I command mono --version, its architecture shows x86, not x64.Is this important?) I execute the lb-xm command
Then the error message is
I followed the edge build guide from https://github.com/tjanczuk/edge.
$npm install edge -> Error
I searched the problem and it needs to set path PKG_CONFIG_PATH. So I executed
And then, again
I totally lost the way at this stage. What's the problem?