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

Hook not executng. #18

Open
vegetablesalad opened this issue Dec 2, 2020 · 2 comments
Open

Hook not executng. #18

vegetablesalad opened this issue Dec 2, 2020 · 2 comments

Comments

@vegetablesalad
Copy link

I stumbled upon this weird issue where hook is not executing:

This wont execute the hook:

    <platform name="android">
        <hook type="after_prepare" src="apply.js" />
    </platform>

While this will work (removing platform marker)

    <hook type="after_prepare" src="apply.js" />

I don't have this issue with other plugins, this is weird as the syntax seems to be correct. My colleague has the same issue on the same project.
Cordova@10
cordova-android@9

@deedw
Copy link

deedw commented Aug 20, 2021

I am experiencing the same issue and removing the platform tag also works for me.
Cordova 10.0.0
cordova-android 10.1.0

@deedw
Copy link

deedw commented Aug 20, 2021

I have found the reason why this doesn't work when you run cordova prepare.

Hooks inside platform elements are only triggered when a platform-specific prepare is called, i.e. cordova prepare android.

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