NativeScript:more 比一个包名称为 'com.google.android.gms.license' 的库

NativeScript:more than one library with package name 'com.google.android.gms.license'

我尝试使用 nativescript 在 android 中构建项目。它扔 这样的错误不止一个包名的库 'com.google.android.gms.license'.

package.json

  "tns-android": {
  "version": "3.3.1"
}

   "nativescript-onesignal": "^1.0.7",   
"nativescript-push-notifications": "0.0.19",

App.gradle

   dependencies {
    compile 'com.onesignal:OneSignal:3.+@aar'   
    compile 'com.google.android.gms:play-services-gcm:+'    
   compile 'com.google.android.gms:play-services-location:+'     
   compile "com.android.support:multidex:1.0.0"
    compile 'com.android.volley:volley:1.0.0' 
    compile 'com.google.code.gson:gson:2.2.4' }

如何解决这个问题?

从项目和平台中删除 node_modules 和 hooks 文件夹。 re-install 他们 "npm install" 然后尝试 "tns platform remove android" "tns platform add android@3.4"

删除 node_modules 文件夹。

1.npm 安装 tns-core-modules@latest --save 2.uinstall & 更新 tns 版本/(npm install -g nativescript) 3.update node/npm 4.npm缓存清理-f

通过使用此评论我解决了问题