Skip to content
This repository was archived by the owner on Aug 7, 2021. It is now read-only.

Cannot copy files to platforms/android folder during the build phase #144

Closed
codeback opened this issue May 5, 2017 · 3 comments
Closed

Comments

@codeback
Copy link

codeback commented May 5, 2017

My project uses Firebase and we need to copy google-services.json to platforms/android.

The problem is that this file is deleted since the ns-bundle command removes the platform folder and adds it again later.

So that, the build process fails with the following error:

Execution failed for task ':processF0F1F2F3F4DebugGoogleServices'.
> File google-services.json is missing. The Google Services Plugin cannot function without it.

Is there a way to have this file copied during the build phase?
Thanks.

@codeback codeback changed the title google-services.json not found Cannot copy files to platforms/android folder during the build phase May 10, 2017
@codeback
Copy link
Author

@sis0k0 could you please help us with this? We are blocked with this issue :(

Thanks in advanced.

@sis0k0
Copy link
Contributor

sis0k0 commented May 10, 2017

Hey @codeback,

There's a tracking issue #145 for removing the 'platform remove/add' workaround. Meanwhile, you can try to build your app using the following commands instead of npm run start-[android/ios]-bundle:

  1. Clean-up the previous builds
tns platform remove android/ios
tns platform add android/ios
  1. Copy the google-services.json file to your platform's folder.

  2. Bundle your app with webpack.
    For android:

./node_modules/.bin/webpack --config=webpack.android.js --progress

For ios:

./node_modules/.bin/webpack --config=webpack.ios.js --progress
  1. Build your project with NativeScript cli.
tns build android/ios

@codeback
Copy link
Author

With your workaround I can now build the project correctly.

I've just subscribed to the issue #145.

Thank you very much!!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants