Skip to content

Android build fails with Cannot get property 'dependencies' on null object #104

@dlcole

Description

@dlcole

I created a new JavaScript Hello World project, added the Android platform, and built the project successfully.

I ran tns plugin add nativescript-contacts and now the build fails with these messages:

FAILURE: Build failed with an exception.

* Where:
Build file '/Users/david/Documents/NativeScriptProjects/tester/platforms/tempPlugin/nativescript_contacts/build.gradle' line: 40

* What went wrong:
A problem occurred evaluating root project 'nativescript_contacts'.
> Cannot get property 'dependencies' on null object

The problem is that nativescript-contacts is not being added to the file /platforms/android/dependencies.json. Here's the complete file:

[
    {
        "name": "@nativescript/core",
        "directory": "../../node_modules/@nativescript/core",
        "dependencies": []
    },
    {
        "name": "@nativescript/theme",
        "directory": "../../node_modules/@nativescript/theme",
        "dependencies": []
    }
]

and here's package.json, from which dependencies.json is presumably built:

  "name": "tester",
  "main": "app/app.js",
  "version": "1.0.0",
  "private": true,
  "dependencies": {
    "@nativescript/core": "~8.2.0",
    "@nativescript/theme": "~3.0.2",
    "nativescript-contacts": "^1.6.4"
  },
  "devDependencies": {
    "@nativescript/android": "8.2.2",
    "@nativescript/webpack": "~5.0.6"
  }
}

Has anyone else hit this problem, or have any insights as to why the plugin is missing from dependencies.json? This wasn't a problem until recently, when I upgraded NS to 8.2 because Xcode was updated unexpectedly and introduced build errors on iOS. All the other plugins in my main project are included in dependencies.json and compile OK.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions