PDA

View Full Version : Can not select App in Application Loader



Caspar
16 Mar 2012, 8:39 AM
Hello!

I tried to follow this Thread on the forum here: http://www.sencha.com/forum/showthread.php?186165-Upload-application-to-app-store

But i run into a problem - if i open up the Application Loader to deliver my App to Apple the Appname.app is greyed out, so i can not choose my app in the "Deliver your App" window...

I followed the Getting started with Sencha Touch 2 Guide and changed my packager.json to "iOS" and "Release", put the Appname and ID in it and set the certificateAlias to "iPhone Distribution". I tried to codesign my App manually too using the help from the thread above and got no errors, but my App file stays grey and not pickable from the Application Loader. Any suggestions, where i did something wrong? Its my first iOS App btw, so i _did_ something wrong somewhere i guess.

Cheers

Caspar

Caspar
16 Mar 2012, 9:40 AM
Okay, after i manually zipped the App the Application Loader will load it, but generates a handfull of errors:

- The binary being analyzed must be an executable: /var/folders/p1/xxxxxxxxxxxxxxxxx/T/Appname.zip/Appname.app/stbuildtemplate

- Icon specified in the Info.plist not found under the top level app wrapper: resources/icons/Icon~ipad.png

- iPad: Icon.png: icon dimensions (57 x 57) don't meet the size requirements. The icon file must be 72x72 pixels, in .png format

- Application failed codesign verification. The signature was invalid, contains disallowed entitlements, or it was not sigend with an iPhone Distribution Certificate

- Required file not found directly under the app wrapper: embedded.mobileprovision

I openend the .app file to have a look in it and found that all the png are in the file root and not in te resources/icons subfolder and again in the webapp/resources/icons folder, so they do not get found... the Info.plist points to resources/icons - should i fix this by hand? My app.js is basicly 99% identical to the Getting started with sencha Touch 2 guide and for excample points the icon: to the resources/icons subfolder.

I would be glad to get a _real_ step by step guide to build my first iOS app and submit it to the store, as long as i follow the Getting startet guide all is working well, i can test the app in the simulator and drag&drop it on a device in itunes and its working on my ipad as well. But the native iOS packaging tab isn't very helpfull in my situation because i already have a packager.json file (from the getting started guide) and its confusing that on one hand i should use "sencha app build native" and on the other hand "sencha package build" - which one is the right one? They are giving me the same errors btw...

Can someone provide some insight and help please?

Caspar
17 Mar 2012, 8:53 AM
Okay here we go, maybe this helps others with the same problems i had, there are some holes in the sencha documentation regarding the building and distribution of iOS apps.

1) Follow the Getting started Guide (Video) (http://docs.sencha.com/touch/2-0/#!/guide/getting_started) - you will build an app from scratch by using the "sencha" command from the terminal and at the end of the guide you will be able to test your app in the iOSSimulator and on your personal developing device by editing the packager.json

2) make sure you edit your packager.json to build your app for release:

"applicationName":"APPNAME", = APPNAME from the Provisioning Portal -> App IDs
"applicationId":"com.COMPANY.APPNAME", = from the Provisioning Portal -> App IDs, without
the numbers before!
"configuration":"Release",
"platform":"iOS",
"certificatePath":"resources/Zertifikate.p12", = where you exported your p12 certificate from your keyring, i did put it into the resource tree, you can put it anywhere
"certificateAlias":"iPhone Distribution: NAME", = your distribution certificate, you will find it in your keyring (there are normally at least 2, one "iPhone Developer: XXX" = Developer certificate and "iPhone Distribution: XXX" = Distribution certificate

3) Build your app:
sencha app build native in the terminal from the root directory of your app, like you did before in die guide to try your app in the simulator or on your device, forget about the "Native iOS Packaging" guide in the documentation, the "sencha package xxx.json" command will not work, maybe its from the beta and not changed? I don't trust this guide because of this...

4) Navigate in your Finder to the /build/native folder and press "ctrl" while clicking on your app (or rightclick) and choose "Paketinhalt anzeigen" (german.... "Show content" or so) to open the folder with all the stuff from your app. Look for the "Info.plist" file and open it in your favorite editor (TextWrangler or such), search for the line
<string>resources/icons/Icon~ipad.png</string> and delete the path info (the png is in the app root now) ->
<string>Icon~ipad.png</string>, save the file.

5) Get the yourappname_appstore.mobileprovision (thats how i name it, you may use a different name) file from the Provisional Portal -> Provisioning -> Distribution -> Download (you need a provisioning profile for the app store not the adhoc one) and put it into the /build/native directory. Now copy it into the app folder, in the terminal go to the build/native folder and use
cp yourappname_appstore.mobileprovision "APPNAME.app/embedded.mobileprovision"

6) while we are here make the "stbuild_template" executable -> in the terminal (still in build/native)
chmod a+x "APPNAME.app/stbuild_template", else you will get a error while uploading to the app store

7) Now its time to sign the app with your Distribution certificate by hand and add the Entitlements.plist to your app. Make a new file, called "Entitlements.plist" and put it into the "build/native" folder, edit it with TextWrangler or similar and paste this into it:

<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>application-identifier</key>
<string>NUMBER.com.COMPANY.APPNAME</string>
<key>get-task-allow</key>
<false/>
</dict>
</plist>
replace the "NUMBER.com.COMPANY.APPNAME" with the complete ID from the Provisioning Portal -> App IDs -> click configure to see the hole ID and copy&paste it. Now run from the terminal (still in build/native)
codesign -f -dvvv -s "iPhone Distribution: NAME" --entitlements "Entitlements.plist" "APPNAME.app" - replace the "iPhone Distribution: NAME" with your distribution certificate name and the APPNAME ofcourse with the Name of your app.

8) Zip the APPNAME.app (rightclick or hold ctrl + click on it and choose "compress"

9) Open Application Loader and Deliver your App, choose the zip file we created to upload

10) Congratulation! Wait for Apple to approve your app

I hope all of my information is correct, if i made some error somewhere please tell me and i will change/add it, thank you!

fokkezb
4 Apr 2012, 3:59 AM
Your solution worked great, but... not anymore with the new 2.0.0-beta2 SDK Tools it seems. I now get the following error, already upon building the native app with 'Debug' and 'iOS' setting in my packager.json:


[INFO] The application was successfully packaged
Bundle Seed ID is missing from config file
Failed to package application

The new SDK Tools also now seem to generate a 'Entitlements.entitlements' file?

If you figure out, please update your instructions ;)

Caspar
4 Apr 2012, 4:24 AM
Interesting - i haven't looked into it because you need Sencha Touch 2.0.1 RC for it and i am not a big fan of using Release Candidates on my productions system. I will have a look into this evening maybe, but if you find a solution before me just post it here and i will intigrate it into the guide.

fokkezb
4 Apr 2012, 4:41 AM
I see it has been reported as bug already:

http://www.sencha.com/forum/showthread.php?192946-2.0.1RC-Native-build-seem-to-be-broken&p=771364

voloshyn
13 Apr 2012, 11:45 AM
This problem has been fixed yesterday, the updated packager is here: http://dl.dropbox.com/u/8793605/stbuild.pkg

moin4u
28 Jul 2012, 12:57 AM
hi,

what is the latest package to install on windows, I download the one you provided but unable to run that on windows OS
Please guide on this.

Thanks

DJFliX
13 Aug 2012, 6:35 AM
With the latest packager that has been released the onResumeApplication function is called, but I cannot build an iOS app for a device. The entitlements are not correct. With the stbuild provided by voloshyn I can build, but the onResumeApplication and onPauseApplication functions are not called. Is there a (testing) version of stbuild that does both of these?

tnickl
29 Jan 2013, 1:41 AM
Thank you, Caspar!

Without your help, I'd spend another (the first one: http://www.sencha.com/forum/showthread.php?247408) week fighting with Sencha.

In case of a sencha person reading this (and no, your .pkg is not helping me), I'm using:
- Windows 7
- SenchaSDKTools-2.0.0-beta3-windows.exe
- sencha-touch-2.0.1.1
which, by the way, is the only way to build a binary for an iPhone 3G (using cmd3 itunes says "is not compatible with this iPhone", see http://www.sencha.com/forum/showthread.php?250292 ).