Skip to content
This repository has been archived by the owner on Apr 4, 2023. It is now read-only.

Purpose of copyMetadata task injection in build.gradle? #695

Open
lambourn opened this issue May 4, 2018 · 2 comments
Open

Purpose of copyMetadata task injection in build.gradle? #695

lambourn opened this issue May 4, 2018 · 2 comments

Comments

@lambourn
Copy link
Collaborator

lambourn commented May 4, 2018

While debugging an issue with Firebase Analytics not sending events on Android, I stumbled across this: in the after-prepare hook script firebase-build-gradle.js, the {N} build.gradle file is patched/modified and the task copyMetadata is created.

What is the purpose here? The default {N} build.gradle does emit metadata to src/main/assets/metadata and the injected copyMetadatatask copies them to either /build/intermediates/assets/debug/metadata or /build/intermediates/assets/release/metadata

I have an issue here as I use flavors for my build and this somehow breaks the above.

TNS 4.0.0, nativescript-plugin-firebase 5.3.1

@EddyVerbruggen
Copy link
Owner

Tip: open that file on GHithub and hit the 'blame' button and scroll to the lines that copy the metadata. That should indicate which issue lead to this change.

Note that it wasn't tested with falvors so I'm not surprised if there's an issue. Feel free to share a repo reproducing the issue.

@lambourn
Copy link
Collaborator Author

lambourn commented May 7, 2018

Thanks. I followed the thread on #549 and your comment on it. Still not sure why the files explicitely need to get copied there but anyways.

As for flavors: once flavors (e.g. dev and prod) are defined, the folder structure below android/app/build/intermediates/assets will have these flavors as subfolders, like android/app/build/intermediates/assets/dev and android/app/build/intermediates/assets/prod with debug / release subfolders as per the selected build type.

I'll see if I can fix it and open a PR.

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