mean-expert-official/fireloop.io

fireloop and nativeapp client errors when running android

davexs2020 opened this issue · 4 comments

What type of issue are you creating?

  • Bug
  • Enhancement
  • Question

What version of this module are you using?

  • 2.1.0-beta.n (2.1 Beta n)
  • Other

Write other if any:

Please add a description for your issue:

Here are the steps I used:
$ fireloop
Generate FireLoop > fireloop > 3.x > api-server

$ fireloop
Generate Angular2 Client > Angular 2 {N}ative > nativeapp

$ cd nativeapp
$ tns run android

Error 1:
app/main.ts(2,39): error TS2305: Module '"~/fireloop/nativeapp/node_modules/nativescript-angular/platform"' has no exported member 'NativeScriptModule'.

Workaround 1:
in nativeapp/app/main.ts, line below:
import { platformNativeScriptDynamic, NativeScriptModule } from "nativescript-angular/platform";
change to:
import { platformNativeScriptDynamic } from "nativescript-angular/platform";
import { NativeScriptModule } from "nativescript-angular/nativescript.module";

Error 2:
app/main.ts(6,10): error TS2305: Module '"~/fireloop/nativeapp/app/shared/sdk/index"' has no exported member 'SDKNativeModule'.

Workaround 2:
$ cd fireloop
$ ./node_modules/.bin/lb-sdk server/server ../nativeapp/app/shared/sdk -d ng2native -i enabled

Error 3: app/shared/sdk/sockets/socket.native.ts(2,27): error TS2307: Cannot find module 'nativescript-socket.io'.

Workaround 3:
$ cd nativeapp
$ tns plugin add nativescript-socket.io

Error 4:
:compileF0F0F2DebugJavaWithJavac
~/fireloop/nativeapp/platforms/android/build/generated/source/buildConfig/F0F0F2/debug/org/nativescript/nativeapp/BuildConfig.java:14: error: variable FLAVOR_nativescriptsocketio is already defined in class BuildConfig
public static final String FLAVOR_nativescriptsocketio = "F0";
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details. 1 error
:compileF0F0F2DebugJavaWithJavac FAILED
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':compileF0F0F2DebugJavaWithJavac'.
Compilation failed; see the compiler error output for details.
BUILD FAILED

Workaround 4: can't think of one...

Please check if you experienced the same error and hopefully resolve them. Thanks.

b3nab commented

I has the same problem.
I might think that the problem is inside the package.json of your nativescript folder (something like fireloop/nativeapp).

"nativescript-socket.io": "^0.7.1",
"nativescript-socketio": "^2.4.0",

My suggested solution is to do these steps:

  1. Remove nativescript-socketio with npm uninstall --save nativescript-socketio
  2. Delete the folder platform/android
  3. Rebuild the platform folder with tns build android

I think that the "nativescript-socketio" is in conflict with "nativescript-socket.io" and this definitely break the building process.
I don't know why there are two package that do the same thing, but this might result in bug like this.

@jonathan-casarrubias however I think that this bug need to be fixed, maybe could be inside one of the yeoman configuration's files.

b3nab commented

I am writing a fix for all errors in this issue.
Soon a PR.

UPDATE: I send a Pull Request to this repo. #125 Waiting the boss 🤓

I was also facing the same issues. But I have resolved them by following above suggestions.
but still REST API working and Real time not working.
any solution.
I really Love Fireloop and Loopback and working on loopback from two years.

Hi guys

Hey so, I really want to apologize for saying this but I'm stopping the support for FireLoop or any LoopBack module I built.

I'm working on a new project from scratch that of course is not built on top of LoopBack or anything else, this new project will also provide a SDK but now it won't be FrameWork specific, therefore you should be able to use it in Angular 5, React, Vue or even plain JavaScript projects

I apologize if you started a project on FireLoop, here I give a more detailed explanation:
#137