NativeScript / NativeScript/nativescript-cli

Nativescript 8.6 build error while building for Android

Aperta
#5,789 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

bug-pending-triage
Lingua principale
JavaScript
Stelle
1.1k
Fork
204
Merge medio
1g 9h
PR unite (30g)
8

Descrizione

Issue Description

After upgrading my project from 6.x to 8.x I can no longer build for Android. I get the following error:

Build file '/Users/user/Documents/project/platforms/android/app/build.gradle' line: 589
A problem occurred configuring project ':app'.
entry

Command ./gradlew failed with exit code 1

the offending line is this:

// Discover all jars and dynamically create tasks for the extraction of each of them
project.ext.allJars = []
allprojects {
    afterEvaluate { project ->
        def buildType = project.selectedBuildType
        def jars = []
        def artifactType = Attribute.of('artifactType', String)
        android.applicationVariants.all { variant ->
            if (variant.buildType.name == buildType) {
                variant.getCompileClasspath().each { fileDependency ->  // THIS IS IT
                    processJar(fileDependency, jars)
                }
            }
        }
    }
}

Here is my package.json:

{
  "scripts": {
    "prepare-ios": "ns clean; ns prepare ios --release",
    "postinstall": "cp patches/firebase/firebase-release.aar node_modules/@nativescript/firebase/platforms/android"
  },
  "main": "./app/app.ts",
  "description": "NativeScript Application",
  "license": "SEE LICENSE IN <your-license-filename>",
  "repository": "<fill-your-repository-here>",
  "dependencies": {
    "@nativescript/core": "^8.6.2",
    "@nativescript/email": "^2.0.5",
    "@nativescript/fingerprint-auth": "^8.1.0",
    "@nativescript/firebase": "^11.1.3",
    "@nativescript/iqkeyboardmanager": "^2.0.0",
    "@nativescript/local-notifications": "^6.0.0",
    "@nativescript/theme": "^3.0.2",
    "@nstudio/nativescript-loading-indicator": "^4.1.2",
    "@triniwiz/nativescript-image-zoom": "^4.1.3",
    "moment": "^2.29.4",
    "moment-timezone": "^0.5.31",
    "nativescript-exit": "^1.0.1",
    "nativescript-numeric-keyboard": "^5.0.2",
    "nativescript-pdf-view": "^3.0.0-1",
    "nativescript-phone": "^3.0.3",
    "nativescript-ui-calendar": "^14.2.1",
    "nativescript-webview-utils": "^4.0.0"
  },
  "devDependencies": {
    "@nativescript/android": "8.6.2",
    "@nativescript/ios": "^8.6.3",
    "@nativescript/types": "~8.6.1",
    "@nativescript/webpack": "~5.0.18",
    "@types/node": "^20.11.16",
    "typescript": "~5.3.2"
  },
  "gitHead": "",
  "readme": "NativeScript Application"
}

Here is the output from ns doctor:

✔ Getting environment information 

No issues were detected.
✔ Your ANDROID_HOME environment variable is set and points to correct directory.
✔ Your adb from the Android SDK is correctly installed.
✔ The Android SDK is installed.
✔ A compatible Android SDK for compilation is found.
✔ Javac is installed and is configured properly.
✔ The Java Development Kit (JDK) is installed and is configured properly.
✔ Xcode is installed and is configured properly.
✔ xcodeproj is installed and is configured properly.
✔ CocoaPods are installed.
✔ CocoaPods update is not required.
✔ CocoaPods are configured properly.
✔ Your current CocoaPods version is newer than 1.0.0.
✔ Python installed and configured correctly.
✔ The Python 'six' package is found.
✔ Xcode version 15.2.0 satisfies minimum required version 10.
✔ Getting NativeScript components versions information...
✔ Component nativescript has 8.6.5 version and is up to date.
✔ Component @nativescript/core has 8.6.2 version and is up to date.
✔ Component @nativescript/ios has 8.6.3 version and is up to date.
✔ Component @nativescript/android has 8.6.2 version and is up to date.

I have been stuck on this for 2 days. Tried cleaning the project, playing around with different adnroid build tool versions, etc. Nothing had worked so far.

Any ideas on what is going on?

Reproduction

No response

Relevant log output (if applicable)

No response

Environment

No response

Please accept these terms

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia dal platforms/android/app/build.gradle generato, intorno alla riga 589, e dalla dipendenza @nativescript/android 8.6.2 in package.json. Riproduci la build Android pulita usando le versioni elencate, quindi individua la configurazione di build o la dipendenza responsabile e verifica che la build abbia esito positivo dopo la correzione.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
android, javascript
Ambito
build-system, cli, mobile-dev
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
24/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.