NativeScript / NativeScript/firebase
[question] firebase-core function initializeAppWithPath(path) for Android
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 62
- Forks
- 53
- Avg merge
- 8d 4h
- Merged PRs (30d)
- 2
Description
Hello,
I am trying to load a different firebase configuration per environment. I figured that using the initializeAppWithPath() I could point to the Google Services config files for dev and prod for Android and iOS.
For iOS It worked out of the box using the path res://, it points to the App_Resource/iOS folder.
However, for android I do not seem to be able to load the google-services.json at all.
I tried with path res://, ~/ and resolving the path myself and I always get the error firebase.init error: Error: com.tns.NativeScriptException: Failed to find module: "/data/data/com.nativescript/files/app/firebase/dev/google-services.json", relative to: app/
Would you guys be so kind and provide some examples for Android on to which folder the paths res://, ~/ point in the code base?
I am using Angular flavor.
Best
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the initializeAppWithPath(path) entry point and how Android resolves google-services.json, then compare that behavior with the working iOS res:// path. Check whether the Android path examples can be determined from the project; done means providing verified Android path guidance or identifying a reproducible loading fix.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, angular, ios, typescript
- Domain
- mobile-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100