在Android上运行nativescript应用程序时出错

在Android上运行nativescript应用程序时出错,nativescript,nativescript-cli,Nativescript,Nativescript Cli,线程“main”java.io.IOException中存在异常:文件已存在。这可能会导致不良行为。 请更改其中一个扩展类的名称 这里我使用的是使用javascript的nativescript。当我运行tns运行android时get error File:E:\project\mobile application\ngasceapp\platforms\android\app\sr lete\AutoCompleteAdapter_autocomplete_63_32_AutoComple

线程“main”java.io.IOException中存在异常:文件已存在。这可能会导致不良行为。
请更改其中一个扩展类的名称

这里我使用的是使用javascript的nativescript。当我运行
tns运行android时
get error

File:E:\project\mobile application\ngasceapp\platforms\android\app\sr
lete\AutoCompleteAdapter_autocomplete_63_32_AutoCompleteAdapter.java
我移除了钩子、节点模块和平台文件夹,并尝试仍然得到相同的错误

下面是package.json文件

 {
      "description": "Application",
      "license": "SEE LICENSE IN <your-license-filename>",
      "readme": "NativeScript Application",
      "repository": "<fill-your-repository-here>",
      "nativescript": {
        "id": "com.max.sagar",
        "tns-ios": {
          "version": "5.0.0-rc-2018-10-11-110051-01"
        },
        "tns-android": {
          "version": "4.2.0"
        }
      },
      "scripts": {
        "lint": "eslint \"app/**/*.js\""
      },
      "dependencies": {
        "moment": "2.22.2",
        "moment-timezone": "^0.5.21",
        "nativescript-accordion": "^5.0.4",
        "nativescript-appavailability": "^1.3.1",
        "nativescript-appversion": "^1.4.1",
        "nativescript-calendar": "^2.0.0",
        "nativescript-cardview": "3.1.1",
        "nativescript-cfalert-dialog": "^1.0.11",
        "nativescript-checkbox": "^3.0.3",
        "nativescript-dev-sass": "^1.6.0",
        "nativescript-email": "1.5.3",
        "nativescript-exoplayer": "^3.4.1",
        "nativescript-fancyalert": "2.0.0",
        "nativescript-floatingactionbutton": "4.1.4",
        "nativescript-fresco": "5.0.0",
        "nativescript-image-cache-it": "^4.0.4",
        "nativescript-insomnia": "1.2.2",
        "nativescript-iqkeyboardmanager": "^1.3.0",
        "nativescript-loading-indicator": "^2.4.0",
        "nativescript-local-notifications": "^2.0.3",
        "nativescript-openfile": "0.0.11",
        "nativescript-orientation": "2.2.1",
        "nativescript-pdf-view": "^2.0.1",
        "nativescript-permissions": "^1.2.3",
        "nativescript-phone": "^1.3.1",
        "nativescript-screen-orientation": "^2.0.0",
        "nativescript-sqlite": "2.2.3",
        "nativescript-theme-core": "^1.0.4",
        "nativescript-ui-autocomplete": "^3.9.0",
        "nativescript-ui-calendar": "^3.6.0",
        "nativescript-ui-dataform": "3.7.3",
        "nativescript-ui-listview": "^3.7.2",
        "tns-platform-declarations": "^4.2.1"
      },
      "devDependencies": {
        "awesome-typescript-loader": "~5.2.1",
        "babel-traverse": "^6.26.0",
        "babel-types": "^6.26.0",
        "babylon": "6.18.0",
        "clean-webpack-plugin": "~0.1.19",
        "copy-webpack-plugin": "~4.5.3",
        "css-loader": "~1.0.0",
        "eslint": "~5.7.0",
        "extract-text-webpack-plugin": "~3.0.2",
        "fs-extra": "^7.0.0",
        "grunt-cache-bust": "^1.7.0",
        "lazy": "1.0.11",
        "nativescript-dev-typescript": "^0.7.4",
        "nativescript-dev-webpack": "^0.16.2",
        "nativescript-worker-loader": "~0.9.1",
        "raw-loader": "~0.5.1",
        "resolve-url-loader": "~3.0.0",
        "sass-loader": "7.1.0",
        "typescript": "^2.8.3",
        "uglifyjs-webpack-plugin": "2.0.1",
        "webpack": "^4.20.2",
        "webpack-bundle-analyzer": "3.0.2",
        "webpack-sources": "1.3.0"
      }
    }
{
“说明”:“应用程序”,
“许可证”:“请参阅中的许可证”,
“自述文件”:“NativeScript应用程序”,
“存储库”:“,
“nativescript”:{
“id”:“com.max.sagar”,
“tns ios”:{
“版本”:“5.0.0-rc-2018-10-11-110051-01”
},
“tns安卓”:{
“版本”:“4.2.0”
}
},
“脚本”:{
“lint”:“eslint\”app/***.js\“
},
“依赖项”:{
“时刻”:“2.22.2”,
“时刻时区”:“^0.5.21”,
“nativescript手风琴”:“^5.0.4”,
“nativescript appavailability”:“^1.3.1”,
“nativescript应用程序版本”:“^1.4.1”,
“nativescript日历”:“^2.0.0”,
“nativescript cardview”:“3.1.1”,
“nativescript cfalert对话框”:“^1.0.11”,
“nativescript复选框”:“^3.0.3”,
“nativescript开发sass”:“^1.6.0”,
“nativescript电子邮件”:“1.5.3”,
“nativescript exoplayer”:“^3.4.1”,
“nativescript fancyalert”:“2.0.0”,
“nativescript浮动操作按钮”:“4.1.4”,
“nativescript壁画”:“5.0.0”,
“nativescript映像缓存它”:“^4.0.4”,
“nativescript”:“1.2.2”,
“nativescript iqkeyboardmanager”:“^1.3.0”,
“nativescript加载指示器”:“^2.4.0”,
“nativescript本地通知”:“^2.0.3”,
“nativescript openfile”:“0.0.11”,
“nativescript方向”:“2.2.1”,
“nativescript pdf视图”:“^2.0.1”,
“nativescript权限”:“^1.2.3”,
“nativescript电话”:“^1.3.1”,
“nativescript屏幕方向”:“^2.0.0”,
“nativescript sqlite”:“2.2.3”,
“nativescript主题核心”:“^1.0.4”,
“nativescript ui自动完成”:“^3.9.0”,
“nativescript ui日历”:“^3.6.0”,
“nativescript ui数据表单”:“3.7.3”,
“nativescript ui列表视图”:“^3.7.2”,
“tns平台声明”:“^4.2.1”
},
“依赖性”:{
“很棒的类型脚本加载程序”:“~5.2.1”,
“巴别塔穿越”:“^6.26.0”,
“巴别塔类型”:“^6.26.0”,
“巴比伦”:“6.18.0”,
“清理网页包插件”:“~0.1.19”,
“复制网页包插件”:“~4.5.3”,
“css加载器”:“~1.0.0”,
“eslint”:“~5.7.0”,
“提取文本网页包插件”:“~3.0.2”,
“fs额外”:“^7.0.0”,
“grunt缓存半身像”:“^1.7.0”,
“懒惰”:“1.0.11”,
“nativescript开发人员类型脚本”:“^0.7.4”,
“nativescript开发人员网页包”:“^0.16.2”,
“nativescript工作加载程序”:“~0.9.1”,
“原始装载机”:“~0.5.1”,
“解析url加载程序”:“~3.0.0”,
“sass加载器”:“7.1.0”,
“类型脚本”:“^2.8.3”,
“uglifyjs网页包插件”:“2.0.1”,
“网页包”:“^4.20.2”,
“网页包包分析器”:“3.0.2”,
“网页来源”:“1.3.0”
}
}

nativescript ui数据表单
插件本身具有
nativescript ui-autocomplete@3.9.0
作为依赖项。您的
包中有
nativescript ui autocomplete
作为依赖项。带有
^
符号的json
将安装最新的主要版本,即
3.10.1
。因此,您将有两个版本的相同插件,这就是问题的原因

尝试删除该
^
符号,并将其保持为
3.9.0


来源:

检查节点模块文件夹

nativescript ui dataform和nativescript ui listview也有节点单元模块。 删除它们并再次运行tns运行android


由于这两个组件都具有autocomplete的依赖项,因此您有多个相同的副本。

我可以知道您的
包.json中有什么吗
?我上传了package.json文件作为答案,因为StackOverflow无法使用大型代码。在这种情况下,您可以使用问题中的编辑选项。将其作为答案发布不是一个正确的选择。