NativeScript / android

NativeScript for Android using v8
https://docs.nativescript.org/guide/android-marshalling
Apache License 2.0
523 stars 134 forks source link

The app crashes with build.gradle error, line: 575 #1711

Closed Z28ILOPE closed 2 years ago

Z28ILOPE commented 2 years ago

Environment

- CLI: nativescript:8.2.3
 - Cross-platform modules:
    "@nativescript/core": "~8.1.1",
    "@nativescript/android": "8.2.2",
    "@nativescript/ios": "8.2.0",
    "@nativescript/types": "~8.1.1",
 - Plugin(s):
  "dependencies": {
    "@klippa/nativescript-http": "^3.0.2",
    "@nativescript-community/algolia": "^2.0.2",
    "@nativescript/core": "~8.2.3",
    "@nativescript/firebase-core": "^1.2.2",
    "@nativescript/firebase-remote-config": "^1.2.2",
    "@nativescript/mlkit-barcode-scanning": "^1.0.4",
    "@nativescript/mlkit-core": "^1.0.4",
    "@nativescript/theme": "~3.0.1",
    "@plmservices/nativescript-sha": "^2.0.2",
    "assert": "^2.0.0",
    "axios": "^0.21.2",
    "browserify-zlib": "^0.2.0",
    "buffer": "^6.0.3",
    "constants-browserify": "^1.0.0",
    "crypto-browserify": "^3.12.0",
    "fs-extra": "^10.1.0",
    "https-browserify": "^1.0.0",
    "install": "^0.13.0",
    "moment": "^2.29.3",
    "nativescript-dna-deviceinfo": "^3.7.3",
    "nativescript-iadvize": "^1.0.3",
    "nativescript-rater": "file:plugins/nativescript-rater",
    "nativescript-vue": "~2.9.0",
    "npm": "^8.7.0",
    "os-browserify": "^0.3.0",
    "path-browserify": "^1.0.1",
    "search-insights": "^1.6.2",
    "stream-browserify": "^3.0.0",
    "stream-http": "^3.2.0",
    "tty-browserify": "0.0.1",
    "util": "^0.12.4",
    "vue-class-component": "^7.2.6",
    "vue-property-decorator": "^9.1.2"
  },
  "devDependencies": {
    "@nativescript/android": "~8.2.2",
    "@nativescript/ios": "~8.2.3",
    "@nativescript/types": "~8.1.1",
    "@nativescript/webpack": "~5.0.0",
    "@types/node": "~14.6.2",
    "nativescript-vue-template-compiler": "~2.9.0",
    "resolve-url-loader": "^5.0.0",
    "typescript": "~4.3.5",
    "vue": "~2.6.12"
  },

app.gradle

project.ext.useAndroidX = true
project.ext.enableJetifier=true

android {
  compileSdkVersion 31

  defaultConfig {
    minSdkVersion 26
    targetSdkVersion 31
    multiDexEnabled true
    generatedDensities = []
  }
  aaptOptions {
    additionalParameters "--no-version-vectors"
  }

   viewBinding {
    enabled = true
  }
}

Describe the bug When I build the app (ns run android) and the Gradle build the plugin nativescript-iadvize, it crashes with this message:

+ adding aar plugin dependency: /Users/*****/*****/prueba/node_modules/nativescript-iadvize/platforms/android/nativescript_iadvize.aar

Build file '/Users/*****/*****//prueba/platforms/android/app/build.gradle' line: 575
A problem occurred configuring project ':app'.
entry

Unable to apply changes on device: emulator-5554. Error is: Command ./gradlew failed with exit code 1.

build.gradle

        android.applicationVariants.all { variant ->
            if (variant.buildType.name == buildType) {
575           variant.getCompileClasspath().each { fileDependency ->
                    processJar(fileDependency, jars)
                }
            }
        }

trace message:

Error: Command ./gradlew failed with exit code 1
  name: 'Exception',
  errorCode: 127,
  suggestCommandHelp: false,
  proxyAuthenticationRequired: false,
  printOnStdout: undefined
}
triniwiz commented 2 years ago

What does that line (575) contain ?

NathanWalker commented 2 years ago

@Z28ILOPE youll want these updates for iadvize plugin: https://github.com/Essent/nativescript-iadvize/pull/12

I’ll contact author about publishing those but can try to ping back with a .tgz download of the updates you could use in meantime after awhile. You can also pull those updates and build/pack them there.

NathanWalker commented 2 years ago

@Z28ILOPE you can download the iadvize updates here: https://drive.google.com/file/d/1SUFcXYivbHsWfYKrJiCUEp-t1hpsyQjq/view?usp=sharing Place the downloaded essent-nativescript-iadvize-2.0.0-android-fix.tgz file anywhere in your project (for example the root dir of the project) and reference in package.json as follows:

"@essent/nativescript-iadvize": "file:essent-nativescript-iadvize-2.0.0-android-fix.tgz",

Then ns clean and make sure you're using the proper imports, eg:

import { IAdvize } from '@essent/nativescript-iadvize';
Z28ILOPE commented 2 years ago

@NathanWalker, Thank you very much for your help, now the plugin loads perfectly.