Skip to content

Can not build for android #4

@jackiszhp

Description

@jackiszhp

I got the following exception:

at new Api (/home/jack/ws/cordova/001/ct3/node_modules/cordova-android/lib/Api.js:65:30)
at patchTargetPlatform (/home/jack/ws/cordova/001/ct3/plugins/nodejs-mobile-cordova/install/hooks/both/after-prepare-patch-npm-packages.js:57:29)

class Api {
constructor(platform, platformRootDir, events) {
this.platform = PLATFORM;
this.root = platformRootDir;
setupEvents(events);
const appMain = path.join(this.root, 'app', 'src', 'main'); //line 65: this.root is needed, which means the 2nd parameter is needed.

but the caller at line 57 is:
var platformAPI = require(path.join(platformPath, 'cordova', 'Api'));
var platformAPIInstance = new platformAPI(); //line 57: pass nothing.

versions:
cordova-android@12.0.1
├── cordova-plugin-console@1.1.0
└── nodejs-mobile-cordova@0.4.3

anyone encounter the same issue? any idea on how to solve this.
If I change the caller to pass the right info, then another place happened again. i don't know how many there will be.

By the way, the above issue is only for CLI. if I build inside android studio, then I don't have such a problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions