0

Problem

After building, my NativeScript (NS) app runs successfully on my Android phone; however, when I try to run it on the NS developer app, it crashes, presumably because a dependency can't be found.

The documentation mentions a list of custom npm modules you can use by adding them as dependencies in package.json. Am I correct in assuming that it is impossible to use the NS developer app for testing projects that rely on other modules, not defined in that list?

If not, what is causing this problem?

Possibly related

This question looks like it might be related; however, their problem persists even if they run on their device directly, using tns run. My problem can only be reproduced in the NativeScript developer app.

Motivation

The reason I want to run it in the companion app is because I need to run it on a colleague's iPhone and I don't want to have to pay for an Apple account or go through the hassle of setting up an Ad-Hoc provisioning profile and adding my colleagues' devices one by one.

Since I don't have an iPhone, I am testing the process of deploying to a companion app by using my Android phone.

Steps to reproduce

The project was initially created as follows, per this guide. The dependency on nativescript-floatingactionbutton was added according to documentation here.

tns create Mcve --template typescript
cd Mcve/
tns platform add android
npm install --save nativescript-floatingactionbutton

This is the code. Note that when building this MCVE, it might complain that the icon resource doesn't exist, but this is not likely the cause of the problem.

<!-- main-page.xml -->
<Page xmlns="http://schemas.nativescript.org/tns.xsd" 
      xmlns:FAB="nativescript-floatingactionbutton">
  <StackLayout>
    <FAB:fab icon="res://ic_add_white" rippleColor="#f1f1f1" class="fab-button" />
  </StackLayout>
</Page>

/* app.css */
.fab-button {
    height: 70;
    margin: 15;
    background-color: #ff4081; 
    horizontal-align: right; 
    vertical-align: bottom; 
}

At this point, I added the project to appbuilder using:

appbuilder init

If I build the project in the following way, it runs as expected:

appbuilder build android

However, if I try to deploy it to my companion app, it crashes:

appbuilder build android --companion

I could not figure out how to extract the callstack as plain text, but here is a screenshot of my NS companion app:

Incomplete error call stack.

My setup

  • Development machine: Windows 10 Pro, 64-bit
  • Android phone: ALE-L21 Huawei running Android 5.0.1. It has both the Telerik companion app and the NativeScript developer app installed.
  • nativeScript version 2.3.0
  • appbuilder version 3.5.2
  • nativescript-floatingactionbutton version 2.2.5
Community
  • 1
  • 1
Reinstate Monica
  • 2,767
  • 3
  • 31
  • 40
  • If you have an Apple account test flight is a good option for testing on devices, still have to sign and upload to iTunes but it's a solid route for testing. I've not used the companion app enough to provide an answer. Just another alternative :) – Brad Martin Nov 15 '16 at 14:12
  • 1
    @BradMartin Thank you, I'll take it into consideration in case the companion app doesn't work out. – Reinstate Monica Nov 15 '16 at 14:15

0 Answers0