logankoester / grunt-phonegap

A Grunt plugin to provide local build tasks for Phonegap applications
MIT License
173 stars 61 forks source link

grunt phonegap:build places platforms and plugins in wrong directories #81

Open jcwilson opened 10 years ago

jcwilson commented 10 years ago

When running this command it adds the plugins and platforms to:

<project-root>/plugins
<project-platform>/plugins

not to

<project-root>/<config:path>/plugins
<project-root>/<config:path>/plugins

This causes the "phonegap build" step to fail with: Fatal error: Unable to read "phonegap/platforms/android/AndroidManifest.xml" file (Error code: ENOENT).

However, the file is present at "platforms/android/AndroidManifest.xml".

Relevant version info: grunt@0.4.4 grunt-cli@0.1.13 grunt-phonegap@0.13.3 cordova@3.4.1 phonegap@3.4.0

    grunt.initConfig({

        phonegap: {
            config: {
                path: 'phonegap',
                plugins: ['org.apache.cordova.console', 'org.apache.cordova.device', 'org.apache.cordova.statusbar'],
                platforms: ['android'],
            }
        }
    });
wszymaniak commented 10 years ago

I have encountered the same issue. The temporary workaround is to downgrade phonegap to version 3.3, because with older version everything works fine.

npm uninstalll phonegap
npm install phonegap@3.3
simontseng commented 10 years ago

i am facing the same issue

jlebrijo commented 10 years ago

Thx @wszymaniak , I also had to remove the build directory:

npm -g uninstall phonegap
npm -g install phonegap@3.3 --save-dev
rm -r phonegap
OlgaBielkina commented 10 years ago

I have the same issue but downgrating to 3.3 version doesn't help. Does anybody has any solutions to fix it?

jlebrijo commented 10 years ago

did you remove phonegap directory ??

OlgaBielkina commented 10 years ago

I made: npm -g uninstall phonegap npm -g install phonegap@3.3 For now phonegap version is 3.3 and during teamCity build 3.3 version is used and reconfigure phonegap to another user folder I'm running this tasks on TeamCity image

OlgaBielkina commented 10 years ago

Issue resolved. It was problem with android-sdk

cburyta commented 10 years ago

I had a very similar issue, but it was ios and android related. It turned out to be related to how cordova-cli detects the parent dir, which was forcing the phonegap local build call to use app/platforms rather than app/config.path/platforms (same with pugins.)

While I don't know that it's backwards compatible (I'm very new to the cordova world) this change fixed the issue for me.

https://github.com/streamlinesocial/grunt-phonegap/commit/15e43bbcdcc797e3a7188bfc228ac6da0406c8d0

(I made a 2nd commit to update the tests per contrib instructions - and could even work to help make this backwards compatible if it helps.)

levexis commented 9 years ago

@OlgaBielkina I have now investigated and fixed this issue so you can use latest phonegap. There is an existence check that looks for config.xml in the phonegap directory and then recurses upwards until it finds a better match. You can fix by copying it manually or by using my fork, which also includes all of the unmerged pull requests. There are a couple of tests failing but these are for code I've not updated. I will submit a pull request with my changes now.