Having problems with Deployment for ios


#1

I finished building my application for Android.

I succesfully managed to creat a Hello World application on iOS.
I managed to build the iOS application successfully.
I managed to deploy the iOS application also successfully.

I move then to my own project and i manage to build it sucessfully on iOS environment.
But when i try to deploy it on my emulator (not a physical emulator) it shows this error:
14

Any hints on how to overcome this? @jen.looper


#2

Anyone got any hint for me? still stuck @Pete.K


#3

I can’t be of much help with iOS related problems. Can you successfully deploy to a physical device? Do your application ids match? The one in package.json and in App_Resources/iOS/Info.plist ?


#4

I haven’t tried to deploy to a physical device. I am trying to deploy it to my own ios Simulator still.

My package.json:

{
  "description": "NativeScript Application",
  "license": "SEE LICENSE IN <your-license-filename>",
  "readme": "NativeScript Application",
  "repository": "<fill-your-repository-here>",
  "nativescript": {
    "id": "org.nativescript.FastCanteen",
    "tns-android": {
      "version": "3.1.1"
    },
    "tns-ios": {
      "version": "3.1.0"
    }
  },
  "dependencies": {
    "@angular/animations": "~4.0.0",
    "@angular/common": "~4.0.0",
    "@angular/compiler": "~4.0.0",
    "@angular/core": "~4.0.0",
    "@angular/forms": "~4.0.0",
    "@angular/http": "~4.0.0",
    "@angular/platform-browser": "~4.0.0",
    "@angular/platform-browser-dynamic": "~4.0.0",
    "@angular/router": "~4.0.0",
    "ios-deploy": "^1.9.1",
    "nativescript-angular": "^3.0.0",
    "nativescript-orientation": "^1.6.1",
    "nativescript-radiobutton": "^0.1.0",
    "nativescript-theme-core": "~1.0.4",
    "npm": "^5.3.0",
    "reflect-metadata": "~0.1.8",
    "rxjs": "~5.2.0",
    "tns-core-modules": "^3.1.0",
    "zone.js": "^0.8.16"
  },
  "devDependencies": {
    "@angular/cli": "^1.0.6",
    "babel-traverse": "6.4.5",
    "babel-types": "6.4.5",
    "babylon": "6.4.5",
    "lazy": "1.0.11",
    "nativescript-dev-typescript": "^0.4.0",
    "typescript": "~2.2.1"
  }
}

And my App_Resources/iOS/Info.plist:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>CFBundleDevelopmentRegion</key>
	<string>en</string>
	<key>CFBundleDisplayName</key>
	<string>FastCanteen</string>
	<key>CFBundleExecutable</key>
	<string>${EXECUTABLE_NAME}</string>
	<key>CFBundleInfoDictionaryVersion</key>
	<string>6.0</string>
	<key>CFBundleName</key>
	<string>${PRODUCT_NAME}</string>
	<key>CFBundlePackageType</key>
	<string>APPL</string>
	<key>CFBundleShortVersionString</key>
	<string>1.0</string>
	<key>CFBundleSignature</key>
	<string>????</string>
	<key>CFBundleVersion</key>
	<string>1.0</string>
	<key>LSRequiresIPhoneOS</key>
	<true/>
	<key>UILaunchStoryboardName</key>
	<string>LaunchScreen</string>
	<key>UIRequiresFullScreen</key>
	<true/>
	<key>UIRequiredDeviceCapabilities</key>
	<array>
		<string>armv7</string>
	</array>
	<key>UISupportedInterfaceOrientations</key>
	<array>
		<string>UIInterfaceOrientationPortrait</string>
		<string>UIInterfaceOrientationLandscapeLeft</string>
		<string>UIInterfaceOrientationLandscapeRight</string>
	</array>
	<key>UISupportedInterfaceOrientations~ipad</key>
	<array>
		<string>UIInterfaceOrientationPortrait</string>
		<string>UIInterfaceOrientationPortraitUpsideDown</string>
		<string>UIInterfaceOrientationLandscapeLeft</string>
		<string>UIInterfaceOrientationLandscapeRight</string>
	</array>
	<key>UIViewControllerBasedStatusBarAppearance</key>
	<false/>
</dict>
</plist>


#5

I think I have seen this before. You might need to blow away your /platform folders and try the emulation again. Let me know if this helps.


#6

Hello @jen.looper
I tried to delete the /platform folders like you said.
I didnt manage to deploy to ios still:

Error output:

I can’t really figure out this error.


#7

Why the sudo install though?


#8

If i don’t run with sudo, it doesn’t have permissions to install the directorys. It constantly keeps throwing errors about not having permissions to install directorys and to rename and to remove folders.
Basically most of the folders have permission level root and i am a current administrator, and even being administrator i dont have permissions to touch root folders, therefore i must add sudo behind. This is what i think at least…

@jen.looper Could you provide me with any more helpfull hint?


#9

Hi there

I think you may have permission issues, and also, you may be complicating things a bit with sudo npm install…

I would create a new app, from template, then call:
tns prepare ios
then:
tns build ios
then, finally,
tns run ios

Do not use sudo anywhere. Make sure when you first create a template application that you don’t use sudo, otherwise it creates the folder owned by root, which could cause you problems down the road. You should have all the permissions if you’re inside your document root.

Once you have the template in the simulator, then add your own code and make all the modifications you want. To deploy, just run
tns run ios
it’s usually all you need.

Hope it works. If not, post the full command you’re using to deploy, give some more details, we’ll help you figure out.


#10

I have a HelloWorld Application on ios working. I’ll try to create a new app from a template and then run it and after this app is running i’ll import my own source code and i’ll give it a go. I’ll post as soon as i do it.

Ok so i created a new project. Imported all my project information into this one. And the error is a new one.

The commands used:

tns create Groceries --template nativescript-template-ng-groceries

tns build ios

tns run ios

Then i imported all my project folders: Pages, images, and information on app.component, app.routing, app.module etc…

And i did

tns build ios

After that i tried to do:

tns run ios and i encountered a new error.Posting new error:

I also added all the options when trying to do tns run ios.
i tried

 tns run ios --emulator --justlaunch --watch
tns run ios --justlaunch --watch
tns run ios --emulator
tns deploy ios --emulator --justlaunch

Reading the error in detail i think its related to “more than one layout child inside a ContentView”
But when i run on Android my application it works super fine.
What does this error mean…? Does it only mean i can have one layout per Screen?

Solution: it was missing a Parent Layout on my Login and Register Screen


#11

I managed to deploy to ios! My application is working on ios but its very poor because it can’t find any images.

i have a wallpaper for my created application but how do i include it in the app_resources ios so my wallpaper gets displayed in ios?
How do i do the same with icons?


#12

to see your images, you may need to rebuild fully


#13

Already tried to rebuild fully @jen.looper, still remains the same. Where do i need to include the images when deploying to ios?
Do i only need to include them under app_Resources -> iOS? or any more spot?


#14

You should be putting them into App_Resources/iOS if they are scaled - and then you refer to them as res://imagename - is that what you’re doing?


#15

are you having trouble seeing your icons or splash screens?


#16

My main problem is seeing my background image.
I placed my background image on app_resources/iOS and app_resources/Android
I went to a program called Gary’s hood resize PNG and i resized my original PNG to the 3 iOS formatts that exist and i placed them into app_Resources/ios and then i refered to them on ngOnInit() as res://imagename.


#17

hi, for a background image, I wouldn’t place it on the screen in ngInit, but rather use CSS - make it your Page background-image.


#18

Hello @jen.looper

I solved it. But i keep using the solution implemented on the tutorial. Throught the use of ngOnInit properties.
There are some changes i need to do from Android to iOS. Some titles are more to the right and others are more to the left than they are supposed to be. How do i tackle this problem?

Should i implement that idea,

if(iOS) labels more to the left
if(Android) labels more to the right
Like this?

Also i am using bottombar plugin from rhanb and it works fine on Android and it is giving me some connection issues on iOS. But it is best to redirect this subject to the owner of the plugin right?

Thanks for all the help anyways!


#19

hi, glad you solved some things! Regarding the other issues:

  • couple of ways to solve this - one is by using forked CSS (you would have a platform.ios.css file and a platform.android.css file and include it in your common css as platform…but the easier way is to do it in the XML:
<ActionBar title="Fetching">
        <StackLayout orientation="horizontal"
            ios:horizontalAlignment="center"
            android:horizontalAlignment="left">
            <Label text="{{ name }}" class="quicksandBold"></Label>
        </StackLayout>
        <ActionItem android.systemIcon="ic_menu_refresh" ios.systemIcon="13" ios.position="right" tap="onRefresh"/>

…that type of thing.

About the bottombar plugin - please contact Jean-Baptiste (the author) by either pinging him on Slack or posting an issue on the plugin’s repo.

:slight_smile: