Эта проблема была проблемой при переносе приложения с NativeScript 5.4.0
на NativeScript 6.3.3
. Сейчас я использую webpack.config.js
в сочетании с nativescript-worker-loader
(рабочие).
Я выполнил необходимые шаги в файле веб-пакета, и код, который разбивается на tns build android
, работает при запуске на устройстве с tns run android
.
Ошибка на tns build android
:
+ adding aar plugin dependency: C:\Dev\node_modules\tns-core-modules-widgets\platforms\android\widgets-release.aar
Warning: there already is an extend called com.tns.FragmentClass.
Warning: The static binding generator will generate extend from:vendor.js implementation
Exception in thread "main" java.io.IOException: File already exists. This may lead to undesired behavior.
Please change the name of one of the extended classes.
File:C:\Dev\platforms\android\app\src\main\java\com\tns\FragmentClass.java Class: com.tns.FragmentClass
at org.nativescript.staticbindinggenerator.Generator.writeBindings(Generator.java:112)
at org.nativescript.staticbindinggenerator.Main.main(Main.java:50)
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:runSbg'.
> Process 'command 'C:\Program Files\Java\jdk1.8.0_211\bin\java.exe'' finished with non-zero exit value 1
пакет. json:
{
"description": "xx",
"license": "SEE LICENSE IN <your-license-filename>",
"readme": "NativeScript Application",
"repository": "<fill-your-repository-here>",
"nativescript": {
"id": "xx.xx.xx.xx",
"tns-ios": {
"version": "6.0.1"
},
"tns-android": {
"version": "6.0.0"
}
},
"dependencies": {
"@nstudio/nativescript-checkbox": "^1.0.0",
"@nstudio/nativescript-floatingactionbutton": "^2.0.0",
"base-64": "^0.1.0",
"chokidar": "^3.3.1",
"currency-formatter": "^1.3.2",
"is-json": "^2.0.1",
"lodash": "^4.17.15",
"md5": "^2.2.1",
"moment": "^2.24.0",
"nativescript-activity-detection": "^0.1.1",
"nativescript-android-utils": "^1.0.2",
"nativescript-bitmap-factory": "^1.7.1",
"nativescript-camera": "4.5.0",
"nativescript-couchbase": "^1.0.18",
"nativescript-dialog": "^0.1.0",
"nativescript-drawingpad": "^3.0.3",
"nativescript-drop-down": "^4.0.1",
"nativescript-exit": "^1.0.1",
"nativescript-geolocation": "^5.1.0",
"nativescript-google-maps-sdk": "^2.7.0",
"nativescript-gradient": "^2.0.1",
"nativescript-imagepicker": "6.2.0",
"nativescript-insomnia": "^1.2.2",
"nativescript-localstorage": "^2.0.0",
"nativescript-maskedinput": "0.0.3",
"nativescript-permissions": "^1.3.6",
"nativescript-phone": "^1.3.1",
"nativescript-sqlite": "^2.3.3",
"nativescript-sqlite-commercial": "file:custom_plugins/nativescript-sqlite-commercial-1.3.2-plugin.tgz",
"nativescript-sqlite-encrypted": "file:custom_plugins/nativescript-sqlite-encrypted-1.4.0-plugin.tgz",
"nativescript-statusbar": "^3.0.1",
"nativescript-theme-core": "^1.0.4",
"nativescript-toast": "^1.4.6",
"nativescript-ui-autocomplete": "^6.0.0",
"nativescript-ui-calendar": "^6.0.0",
"nativescript-ui-chart": "^7.1.1",
"nativescript-ui-dataform": "^6.0.0",
"nativescript-ui-gauge": "^6.0.0",
"nativescript-ui-listview": "7.0.0",
"nativescript-ui-sidedrawer": "^8.0.0",
"nativescript-unit-test-runner": "0.7.0",
"node-stopwatch": "0.0.1",
"semver": "^5.4.1",
"stopwatch": "^0.2.0",
"stopwatch.js": "^1.1.1",
"timer-stopwatch": "^0.2.0",
"tns-core-modules": "6.3.0",
"utf8": "^2.1.2"
},
"devDependencies": {
"add": "^2.0.6",
"babel-traverse": "6.25.0",
"babel-types": "6.25.0",
"babylon": "6.17.4",
"chai": "^4.1.0",
"karma": "4.1.0",
"karma-chai": "^0.1.0",
"karma-mocha": "^1.3.0",
"karma-nativescript-launcher": "^0.4.0",
"karma-webpack": "3.0.5",
"lazy": "1.0.11",
"mocha": "^7.0.1",
"nativescript-dev-webpack": "1.0.1",
"nativescript-worker-loader": "^0.10.0",
"serialize-javascript": "^2.1.2",
"tns-platform-declarations": "6.0.1",
"typescript": "3.4.5"
}
}
Я много раз удалял и обновлял node_modules, platform, hooks, и единственный способ, который я могу собрать, - это удалить все ссылки на моих работников. чтобы они не входили в комплект.
Я также ходил на форумы с похожими проблемами Дело 1 и Дело 2 и другие безрезультатно.
Пожалуйста, дайте мне знать, если что-то еще должно быть включено в текст вопроса. Заранее спасибо.