[ 
https://issues.apache.org/jira/browse/CB-11794?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15887141#comment-15887141
 ] 

Shazron Abdullah commented on CB-11794:
---------------------------------------

hooks are run by the cli, and not the platform. Added it to Components

> Hook after_build not working on iOS
> -----------------------------------
>
>                 Key: CB-11794
>                 URL: https://issues.apache.org/jira/browse/CB-11794
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: CordovaLib, iOS
>         Environment: OS X 10.11.6
> Tools:
> node: v6.4.0
> npm: 3.10.6
> cordova: 6.3.1
> ionic: 2.0.0
> grunt: grunt-cli v1.2.0
> grunt v1.0.1
> bower: 1.7.9
> Installed platforms:
>   ios 4.2.1
> My app is written using ionic 1 and angularjs 1
>            Reporter: Radu Moian-Dusa
>
> I discovered the bug, by following this scenario:
> clean ionic project;
> open terminal at project root;
> 1. rm -rf plugins/ (remove the plugins folder)
> 2. cordova add platform ios
> 3. cordova build ios
> 4. ls -l platforms/ios/<PROJECT_NAME>/Images.xcassets/AppIcon.appiconset/ and 
> ls -l platforms/ios/<PROJECT_NAME>/Images.xcassets/LaunchImage.launchimage/
> 5. in both folders found above, we find the Contents.json file that tells 
> xcode which icon/splash screen goes to wich resolution
> 6. cordova platform rm ios
> 7. cordova platform add ios (add the platform again, but the plugins are 
> installed from plugins/ folder found in the root of the project)
> 8. cordova build ios
> 9. ls -l platforms/ios/<PROJECT_NAME>/Images.xcassets/AppIcon.appiconset/ and 
> ls -l platforms/ios/<PROJECT_NAME>/Images.xcassets/LaunchImage.launchimage/
> 10. in both folders found above is missing the Contents.json file, so, after 
> we open <PROJECT_NAME>.xcodeproj file in xcode, all the icons and launch 
> screens are unassigned, so the app starts on the iOS device at a wrong 
> resolution. (example: run app on iPhone 5C and the app starts at iPhone 4 
> resolution with black bars on top and bottom).
> I think this might be a cordova Bug but I am not sure.
> As a workaround, I copied the Contents.json files to another location in my 
> project and: 
> 1. added an after_build hook to copy these file into 
> platforms/ios/<PROJECT_NAME>/Images.xcassets/AppIcon.appiconset/ and 
> platforms/ios/<PROJECT_NAME>/Images.xcassets/LaunchImage.launchimage/ paths.
> 2. cordova platform rm ios
> 3. cordova platform add ios
> 4. cordova build ios
> 5. this should be the place where the after_build hook should run.
> If you run cordova build ios again the hook works.
> I have noticed that the first time you run cordova build ios the message "** 
> BUILD SUCCEEDED **" does not appear, sometimes only after the third time of 
> running cordova build ios this message appears. From what I can tell only 
> when the message ** BUILD SUCCEEDED ** appears the after_build hook is run. 
> This issue can be reproduced with the after_compile hook as well.
> What I have done in order to achieve this "workaround" is: I have made a 
> before_compile hook which copies the Contents.json file where it should be 
> copied and it works.
> I hope that I described the problem well. If there are any questions you can 
> ask me later



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org

Reply via email to