The android() method could not be located on the root project 'xyz' of type org.gradle.api.Project when passing [before_plugins_] as arguments

Encountering an issue while attempting to run the Nativescript Android application on my device. The error message states: Could not find method android() for arguments [before_plugins_d5qrcua3za3scd760qug60fz6$_run_closure1@5754ca71] on root project 'xyz' of type org.gradle.api.Project. How can I resolve this problem?

The code in before-plugins.gradle:

android {  
  project.ext {
      googlePlayServicesVersion = "15.0.0"
  }
} 

The package.json file contains:

{
  "name": "xyz",
  "main": "./src/main.ts",
  "version": "1.0.0",
  "private": true,
  // List of dependencies...
}

Error message screenshot: https://i.sstatic.net/9Hcdq.png

Answer №1

Encountering a similar problem, I sought solutions in the latest Nativescript documentation. By adjusting my before-plugins.gradle file as shown below, I was able to successfully build the project.

ext {
  googlePlayServicesVersion = "15.0.0"
}

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Guide to setting up an interface-only project (along with its dependent projects) on NPM

I'm encountering two problems with my TypeScript project. Imagine I have a interface-only TypeScript project called myproject-api. My plan is to implement the interfaces in two separate projects named myproject-impl1 and myroject-impl2. I am utilizin ...

Guide on accessing js file in an Angular application

I have a component where I need to create a function that can search for a specific string value in the provided JavaScript file. How can I achieve this? The file path is '../../../assets/beacons.js' (relative to my component) and it's named ...

What is the best way to convert JSON data from PHP into a ListView on an Android app?

Greetings! I am a novice programmer seeking assistance with parsing the following output into my Android listview. I have utilized PHP connected to MySQL to generate this data : {"id":"2","name":"Username : garrett","password":"Password : important"}{"id" ...

Is it possible to dynamically close the parent modal based on input from the child component?

As I follow a tutorial, I am working on importing the stripe function from two js files. The goal is to display my stripe payment in a modal. However, I am unsure how to close the modal once I receive a successful payment message in the child. Below are s ...

angular typescript does not support receiving a value in foreach loop

It seems that I'm facing an issue with retrieving the element value inside a typescript foreach loop. constructor(db: AngularFireDatabase) { } this.fbUserData = this.db.list('users/'+this.userid).valueChanges() this.fbUserData.forEa ...

The phasing out of Environment.getExternalStorageDirectory() and the new location for OBB files

Previously, I relied on the now deprecated Environment.getExternalStorageDirectory() method to access expansion (OBB) files. My code looked like this: Environment.getExternalStorageDirectory() + "/Android/obb/" + packageName + "/" This ...

Issue with ion-select default value not being applied

In my ion-select element, I have multiple options and I want to set a default value based on the CurrentNumber when the view is loaded. Here's the code snippet: <ion-select formControlName="Level"> <ion-option [value]="level.id" *n ...

Combining cells for certain entries in an Angular data table

Just starting to learn angular, and here's the scenario I'm dealing with: I have a table consisting of 10 columns. Let's say column 4 contains different status categories like children, teen, young, adult, and senior. When displaying all ...

Loading AngularJS multiple times

I'm facing a challenge while upgrading my angularJs Application to Webpack4. This is how I've set it up: vendor.ts import "angular"; import "angular-i18n/de-de"; import "angular-route"; and main.ts import {MyAppModule} from "./my-app.app"; ...

Utilizing JSON data within a separate TypeScript function or within the ngOnInit lifecycle hook after successfully retrieving the data

I'm new to Angular and have a simple question. In my code, I have the following: public jsonDataResult: any; private getUrl = "../assets/data_3.json"; getScoreList(){ this.http.get(this.getUrl).subscribe((res) => { this.jsonDat ...

What is the reason for my algorithm's inability to work with this specific number?

I'm currently working on creating an algorithm to compute the sum of prime numbers that are less than or equal to a specified number. Below is my attempt: function calculatePrimeSum(num) { // initialize an array with numbers up to the given num let ...

Guide to implementing an enum in an Angular Component

Having a global state (or "mode") in my Angular Components is leading me to look for more efficient ways to code. Here is what I have tried: @Component({ .... }) export class AbcComponent implements OnInit { enum State { init, view, edit, cre ...

Is it possible to define a shared function for enums in TypeScript?

I have created an enumeration called VideoCategoryEnum: enum VideoCategoryEnum { knowledge = 0, condition = 1, interview = 2, speech = 3, entertainment = 4, news = 5, advertisement = 6, others = 7, } I am looking to implement a shared met ...

Notifying users of updates in Xamarin C# without the need to restart the app

I have developed a set of methods that compare a locally downloaded json file with the json content from a specific URL. In case the downloaded file differs from the one on the URL, upon app restart, a notification is displayed on the main page indicating ...

Leveraging a shared library in Typescript

How can I efficiently share code between different codebases that are all written in TypeScript and constantly being developed? I am seeking a straightforward solution. Some of the methods I have attempted include: 1 Utilizing import statements with path ...

Extract pieces from a union type that includes a discriminator which is itself a union

My current type declaration looks like this: enum Type { A = 'A', B = 'B', C = 'C' } type Union = | { type: Type.A | Type.B; key1: string } | { t ...

The absence of color gradations in the TypeScript definition of MUI5 createTheme is worth noting

Seeking to personalize my theme colors in MUI5 using TypeScript, I am utilizing the createTheme function. This function requires a palette entry in its argument object, which TypeScript specifies should be of type PaletteOptions: https://i.stack.imgur.com ...

How to trigger a function in a separate component (Comp2) from the HTML of Comp1 using Angular 2

--- Component 1--------------- <div> <li><a href="#" (click)="getFactsCount()"> Instance 2 </a></li> However, the getFactsCount() function is located in another component. I am considering utilizing @output/emitter or some o ...

Security Exception in FileChooser on Android Q

Recently, I've been delving into Android programming and encountered an issue. I am trying to open a directory and gain persistent read access to it. To do this, I included the FLAG_GRANT_PERSISTABLE_URI_PERMISSION flag in my intent. Intent intent = ...

Using multiple where conditions in TypeORM

SELECT * FROM clients WHERE preferred_site = 'techonthenet.com' AND client_id > 6000; Is there a way to execute this in the typeorm query builder? ...