Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Can't sideload app on phone

Hi,

 

I tried to sideload the development version of my app today to continue development, but the sideload of the phone part is not working anymore. The sideload to the simulator works as expect and the app itself too.

 

I tried to delete the FITBIT app and reinstall it after a phone restart but still get the same error. Any ideas how to fix it?

 

hjochman@T540p:~/git/fitbit-schedule-hape/src$ npx fitbit
Logged in as Hanspeter Jochmann <xxxx@xxx.de>
fitbit$ build

> @ build /home/hjochman/git/fitbit-schedule-hape/src
> fitbit-build

[14:27:59][info][app] Building app for Fitbit Versa
[14:28:00][info][app] Building app for Fitbit Ionic
[14:28:00][info][companion] Building companion
[14:28:00][info][settings] Building settings
[14:28:01][info][build] App UUID: e7246ff0-37c9-4709-9ecb-20c322137295, BuildID: 0x0c5ebb7d4ef0c559
fitbit$ connect phone
? Which phone do you wish to sideload to? Blackberry STV100-4
fitbit$ connect device
? Which device do you wish to sideload to? Ionic
fitbit$ install
No app package specified. Using default ./build/app.fba.
Loaded appID:e7246ff0-37c9-4709-9ecb-20c322137295 buildID:0x0c5ebb7d4ef0c559
Sideloading app: 100% completed
Install failed: Internal Error
fitbit$

Best Answer
0 Votes
9 REPLIES 9

Try removing all sideloaded apps/clocks, then try again.

Best Answer
0 Votes

Hi,

 

I do not have any other sideloded apps. Also tried to remove and reinstall the fitbit app on my phone. No difference.

 

Hanspeter

Best Answer
0 Votes

Hi Jon,

 

I tried to install the CLI from scatch by removing build folder, node_module folder, package-lock.json and the .npm folder in my home directory.

The reinstalled the CLI, but the problem is the same. I Also tried to chane the app-id without any result.

How to get the sideloading working again?


hjochman@T540p:~/git/fitbit-schedule-hape/src$ npm add --dev @Fitbit/sdk
npm WARN install Usage of the `--dev` option is deprecated. Use `--only=dev` instead.
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN src No description
npm WARN src No repository field.
npm WARN src No license field.

+ @Fitbit/sdk@3.1.0
added 499 packages from 304 contributors and audited 3636 packages in 30.676s
found 0 vulnerabilities

hjochman@T540p:~/git/fitbit-schedule-hape/src$ npm add --dev @Fitbit/sdk-cli
npm WARN install Usage of the `--dev` option is deprecated. Use `--only=dev` instead.

> keytar@4.4.1 install /home/hjochman/git/fitbit-schedule-hape/src/node_modules/keytar
> prebuild-install || node-gyp rebuild

npm WARN src No description
npm WARN src No repository field.
npm WARN src No license field.

+ @Fitbit/sdk-cli@1.6.0
added 146 packages from 136 contributors and audited 4087 packages in 13.971s
found 2 vulnerabilities (1 low, 1 moderate)
  run `npm audit fix` to fix them, or `npm audit` for details
hjochman@T540p:~/git/fitbit-schedule-hape/src$ npm add fitbit-google-analytics
npm WARN src No description
npm WARN src No repository field.
npm WARN src No license field.

+ fitbit-google-analytics@1.2.0
added 1 package from 1 contributor and audited 4539 packages in 4.43s
found 4 vulnerabilities (2 low, 2 moderate)
  run `npm audit fix` to fix them, or `npm audit` for details
hjochman@T540p:~/git/fitbit-schedule-hape/src$ npx fitbit
Logged in as Hanspeter Jochmann <hanspeter@hp-jochmann.de>
fitbit$ build

> @ build /home/hjochman/git/fitbit-schedule-hape/src
> fitbit-build

[11:26:02][info][app] Building app for Fitbit Versa
[11:26:04][info][app] Building app for Fitbit Ionic
[11:26:05][info][companion] Building companion
[11:26:05][info][settings] Building settings
[11:26:05][info][build] App UUID: 6a43b3a7-8b1d-4668-8173-7b69ea3d9584, BuildID: 0x0172b9169123c4e4
fitbit$ connect phone
Auto-connecting only known phone: Blackberry STV100-4
fitbit$ connect device
No devices are connected and available
fitbit$ connect device
Auto-connecting only known device: Ionic
fitbit$ install
No app package specified. Using default ./build/app.fba.
Loaded appID:6a43b3a7-8b1d-4668-8173-7b69ea3d9584 buildID:0x0172b9169123c4e4
Sideloading app: 100% completed
Install failed: Internal Error
Device 'Ionic' disconnected
fitbit$ 

 

Hanspeter

Best Answer
0 Votes

I checked the install code inside fitbit-schedule-hape/src/node_modules/@fitbit/sdk-cli/lib/commands

In the install.js it looks like it is failing when sending the package to fitbit to be installed on the phone:

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const chalk_1 = tslib_1.__importDefault(require("chalk"));
const lodash_1 = tslib_1.__importDefault(require("lodash"));
const sideload = tslib_1.__importStar(require("../models/sideload"));
const connect_1 = require("./connect");
const setAppPackage_1 = require("./setAppPackage");
exports.installAction = async (cli, stores, args) => {
    const makeProgressCallback = (componentType) => {
        cli.ui.redraw(`Sideloading ${componentType}: starting...`);
        return (sent, total) => {
            const percentComplete = Math.round((sent / total) * 100);
            cli.ui.redraw(`Sideloading ${componentType}: ${percentComplete}% completed`);
        };
    };
    const printCompletionStatus = (componentType) => (result) => {
        if (result) {
            cli.ui.redraw(`${componentType} install complete (${result.installType})`);
        }
        else {
            cli.ui.redraw(`${componentType} is already installed`);
        }
        cli.ui.redraw.done();
    };
    const { appContext, hostConnections } = stores;
    const appPackage = await setAppPackage_1.setAppPackageAction(cli, appContext, args.packagePath);
    if (!appPackage)
        return false;
    const hasApp = Object.keys(lodash_1.default.get(appPackage, 'components.device') || {}).length > 0;
    const hasCompanion = !!lodash_1.default.get(appPackage, 'components.companion');
    if (!hasApp) {
        if (!hasCompanion) {
            cli.activeCommand.log('Nothing to do: app contains neither a device nor a companion component');
            return false;
        }
        cli.activeCommand.log(chalk_1.default.keyword('orange')('This app does not contain a device component'));
    }
    if (hasApp && (!hostConnections.appHost || hostConnections.appHost.host.rpc.ended)) {
        cli.activeCommand.log('App requires a device, connecting...');
        const result = await connect_1.connectAction(cli, 'device', hostConnections);
        if (!result)
            return false;
    }
    if (hasCompanion
        && (!hostConnections.companionHost || hostConnections.companionHost.host.rpc.ended)) {
        cli.activeCommand.log('App requires a phone, connecting...');
        const result = await connect_1.connectAction(cli, 'phone', hostConnections);
        if (!result)
            return false;
    }
    const { appHost, companionHost } = hostConnections;
    try {
        if (hasApp && appHost) {
            await sideload.app(appHost.host, appPackage, makeProgressCallback('app')).then(printCompletionStatus('App'));
        }
        if (hasCompanion && companionHost) {
            await sideload.companion(companionHost.host, appPackage, makeProgressCallback('companion')).then(printCompletionStatus('Companion'));
        }
    }
    catch (ex) {
        cli.activeCommand.log(`Install failed: ${ex.message}`);
        return false;
    }
    if (hasApp && appHost) {
        if (appHost.host.hasCapability('appHost.launch.appComponent')
            && appHost.host.info.capabilities.appHost.launch.appComponent.canLaunch) {
            cli.activeCommand.log('Launching app');
            await appHost.host.launchAppComponent({
                uuid: appPackage.uuid,
                component: 'app',
            });
        }
        else {
            cli.activeCommand.log('Device does not support launching app remotely');
        }
    }
    return true;
};
function install(stores) {
    return (cli) => {
        cli
            .command('install [packagePath]', 'Install an app package')
            .types({ string: ['packagePath'] })
            .action(async (args) => exports.installAction(cli, stores, args));
    };
}
exports.default = install;
//# sourceMappingURL=install.js.map

 

I expect the I got the "Sideloading app: 100% completed" message from the command:

        if (hasApp && appHost) {
            await sideload.app(appHost.host, appPackage, makeProgressCallback('app')).then(printCompletionStatus('App'));
        }

Then the code tries to install the Companion part

        if (hasCompanion && companionHost) {
            await sideload.companion(companionHost.host, appPackage, makeProgressCallback('companion')).then(printCompletionStatus('Companion'));
        }

This fails and I get the error massage from the catch function

  catch (ex) {
        cli.activeCommand.log(`Install failed: ${ex.message}`);
        return false;
    }

 

Hope that helps to find the base problem. Perhaps something with my account data on your server is gone wrong?

I also tried to delete The fitbit app, reboot the phone, and reinstall it. No change.

 

Hanspeter

 

Best Answer
0 Votes

I just had the same sort of issue (with the same error) when attempting to sideload a development version of my app. I had had the same app installed from gam.fitbit.com previously - then I removed it from the device.

 

I had to restart the device to be able to sideload successfully.

Best Answer
0 Votes

Hi, thanks for the tip. I tried this without luck.

I even changed the appid and the name to make it a new app.The problem is still the same 😞

Best Answer
0 Votes

Next test. I uploaded the src into a new FitBit Studio project.

https://studio.fitbit.com/projects/nkm8xV/editor

 

Same problem. Installation fails after some seconds.

 

Also I tried to install a other app from the Fitbit Studio that has a Companion part. The installation fails also. To me it looks like I have a general problem to install apps that have a Companion part.

 

Hanspeter

Best Answer
0 Votes

@JonFitbit wrote:

Try removing all sideloaded apps/clocks, then try again.


Hi Jon,

 

any other ideas? The problem still exists and I diden't found a solution until now.

The Ionic is a new Replacement where I never sideloded apps.

 

To me it looks like I'm also not able to install any apps that has a compenien part. So I expected some problem on the phone app side. For that I delete the FITBIT app, removed all setup folders, rebootoed the phone and reinstalled the FITBIT app. No change, still the same Problem.

 

Could it be that there is a problem with my FITBIT account? Can you check that? Same email as my forum account.

 

Thanks, Hanspeter

Best Answer
0 Votes

Running into the same problem. Studio shows successful, but phone is not getting the app.

 

[4:37:57 PM]Sideload successful!
[HOST][4:37:57 PM]App Closed
[HOST][4:37:58 PM]App Started
 
Sideloading icon spins, but no apps are loaded.
 
Msg: No sideloaded apps reload to refresh
Best Answer
0 Votes