Nativescript 任务';的执行失败:应用程序:transformClassesWithMultidexlistForDebug';。(INotificationSideChannel$Stub$Proxy?)

Nativescript 任务';的执行失败:应用程序:transformClassesWithMultidexlistForDebug';。(INotificationSideChannel$Stub$Proxy?),nativescript,nativescript-vue,Nativescript,Nativescript Vue,我的Nativescript Vue项目无缘无故停止工作,我不知道为什么。 gradle生成因以下错误而崩溃: D8: Program type already present: android.support.v4.app.INotificationSideChannel$Stub$Proxy FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':app:transfo

我的Nativescript Vue项目无缘无故停止工作,我不知道为什么。 gradle生成因以下错误而崩溃:

D8: Program type already present: android.support.v4.app.INotificationSideChannel$Stub$Proxy

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:transformClassesWithMultidexlistForDebug'.
> com.android.build.api.transform.TransformException: Error while generating the main dex list:
  Error while merging dex archives:
  Learn how to resolve the issue at https://developer.android.com/studio/build/dependencies#duplicate_classes.
  Program type already present: android.support.v4.app.INotificationSideChannel$Stub$Proxy
我对用java开发原生android一无所知,所以我一直在努力解决这个错误,因为已经有好几个小时了

这是我的应用程序

apply plugin: "com.android.application"
apply plugin: "com.google.gms.google-services"
dependencies {
    configurations.all {
        resolutionStrategy.eachDependency { DependencyResolveDetails details ->
            def requested = details.requested
            if (requested.group == 'com.android.support' && requested.name != 'multidex' ) {
                details.useVersion '27.1.1'
            }
        }
    }
}

dependencies {
  implementation 'org.slf4j:slf4j-nop:1.7.25'

}

android {
  defaultConfig {
    multiDexEnabled true
    generatedDensities = []
    applicationId = "org.nativescript.application"
    project.ext {
      googlePlayServicesVersion = "+"
    }
  }
  aaptOptions {
    additionalParameters "--no-version-vectors"
  }
}
如果出现此错误,我的package.json是由一个nativescript插件引起的,我认为:

{
  "name": "app",
  "version": "1.21",
  "license": "MIT",
  "nativescript": {
    "id": "org.nativescript.application",
    "tns-ios": {
      "version": "5.3.1"
    },
    "tns-android": {
      "version": "5.3.1"
    }
  },
  "scripts": {
    "dev:android": "tns debug android --bundle",
    "dev:ios": "tns debug ios --bundle",
    "lint": "eslint --ext .js,.vue .",
    "run:android": "tns run android --bundle",
    "run:ios": "tns run ios --bundle",
    "clean": "tns platform clean ios; tns platform clean android"
  },
  "dependencies": {
    "axios": "^0.18.0",
    "dotenv-webpack": "^1.7.0",
    "nativescript": "^5.2.4",
    "nativescript-applozic-chat": "^1.2.4",
    "nativescript-appversion": "^1.4.1",
    "nativescript-barcodescanner": "^3.0.3",
    "nativescript-camera": "^4.2.0",
    "nativescript-cardview": "^3.1.1",
    "nativescript-checkbox": "^3.0.3",
    "nativescript-floatingactionbutton": "^5.0.0",
    "nativescript-geolocation": "^4.4.2",
    "nativescript-google-maps-sdk": "^2.7.0",
    "nativescript-google-places-autocomplete": "^1.0.3",
    "nativescript-iqkeyboardmanager": "^1.4.0",
    "nativescript-keyboard-toolbar": "^1.0.4",
    "nativescript-laravel-echo": "^1.0.1",
    "nativescript-lottie": "^3.0.2",
    "nativescript-modal-datetimepicker": "^1.1.12",
    "nativescript-oauth2": "^1.4.1",
    "nativescript-pager": "^9.3.14",
    "nativescript-phone": "^1.4.0",
    "nativescript-plugin-firebase": "^8.1.1",
    "nativescript-plugin-gplaces": "^2.4.6",
    "nativescript-vue": "^2.0.0",
    "nativescript-websockets": "^1.5.3",
    "nativescript-windowed-modal": "^5.0.6",
    "promise.prototype.finally": "^3.1.0",
    "pusher-nativescript": "^1.0.0",
    "tns-android": "^5.2.1",
    "tns-core-modules": "^5.2.2",
    "tns-ios": "^5.2.0",
    "ts-loader": "^5.3.3",
    "vue-i18n": "^8.9.0",
    "vuelidate": "^0.7.4",
    "vuex": "^3.0.1"
  },
  "devDependencies": {
    "@babel/core": "^7.0.0",
    "@babel/plugin-proposal-class-properties": "^7.4.4",
    "@babel/preset-env": "^7.0.0",
    "@vue/eslint-config-prettier": "^4.0.1",
    "babel-eslint": "^10.0.1",
    "babel-loader": "^8.0.2",
    "babel-traverse": "6.26.0",
    "babel-types": "6.26.0",
    "babylon": "6.18.0",
    "base-64": "^0.1.0",
    "clean-webpack-plugin": "^1.0.1",
    "copy-webpack-plugin": "^4.5.2",
    "css-loader": "^1.0.0",
    "date-fns": "^1.30.1",
    "eslint": "^5.12.1",
    "eslint-config-prettier": "^4.1.0",
    "eslint-plugin-prettier": "^3.0.1",
    "eslint-plugin-vue": "^5.1.0",
    "lazy": "1.0.11",
    "lodash": "^4.17.11",
    "nativescript-dev-typescript": "^0.9.0",
    "nativescript-dev-webpack": "^0.21.0-next-2019-02-15-084520-01",
    "nativescript-image-cache-it": "^4.1.2",
    "nativescript-vue-template-compiler": "^2.0.0",
    "node-sass": "^4.9.2",
    "prettier": "^1.16.1",
    "sass-loader": "^7.1.0",
    "terser-webpack-plugin": "^1.1.0",
    "tns-platform-declarations": "^5.2.2",
    "utf8": "^3.0.0",
    "vue-loader": "^15.2.6",
    "webpack": "^4.16.4",
    "webpack-bundle-analyzer": "~3.0.4",
    "webpack-cli": "^3.1.0"
  }
}
我尝试了多种方法:

  • rm-rf hooks/platforms/node_modules/package-lock.json并重新编译整个项目
  • 删除C:/Users/username/中的整个.gradle目录,然后重新编译
  • 卸载java,以及全局安装、重新安装和重新编译的nativescript cli(tns)
  • 按照nativescript文档中的要求,卸载安装了C:/android巧克力的android sdk,然后重新编译
  • tns平台清洁安卓
  • 重新整理我的项目并尝试重新编译
  • 我非常绝望,我还为nativescript vue和android创建了一个docker映像,以确保错误与我的计算机配置/环境无关,并且错误仍然存在
我试图编译一个空白项目,创建时使用:

vue init nativescript-vue/vue-cli-template
它正在工作。
另外,我的同事可以编译这个项目,所以它是不可理解的。我的项目与他们的项目相同,我重新控制了项目以确保他们没有未提交的文件…

我发现错误是由以下软件包引起的:“nativescript google maps sdk”。也许是唯一一个我没有卸载的软件,看看它是否应该对此错误负责

无论如何,您可以在这里找到我是如何解决此问题的:

这并不能解决错误