Nativescript 8.6 build error while building for Android
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 24/100
- Issue 类型
- 缺陷
- 描述清晰度
- 需要澄清
- 活跃度
- 停滞
- 技术栈
- android, javascript
- 领域
- build-system, cli, mobile-dev
调研方向
从生成的 platforms/android/app/build.gradle(约第589行)以及 package.json 中的 @nativescript/android 8.6.2 依赖项开始。使用列出的版本重现干净的 Android build,然后确定负责该问题的 build 配置或依赖项,并验证修复后 build 能够成功。
由索引模型根据 Issue 内容生成。
描述
Issue Description
After upgrading my project from 6.x to 8.x I can no longer build for Android. I get the following error:
Build file '/Users/user/Documents/project/platforms/android/app/build.gradle' line: 589
A problem occurred configuring project ':app'.
entry
Command ./gradlew failed with exit code 1
the offending line is this:
// Discover all jars and dynamically create tasks for the extraction of each of them
project.ext.allJars = []
allprojects {
afterEvaluate { project ->
def buildType = project.selectedBuildType
def jars = []
def artifactType = Attribute.of('artifactType', String)
android.applicationVariants.all { variant ->
if (variant.buildType.name == buildType) {
variant.getCompileClasspath().each { fileDependency -> // THIS IS IT
processJar(fileDependency, jars)
}
}
}
}
}
Here is my package.json:
{
"scripts": {
"prepare-ios": "ns clean; ns prepare ios --release",
"postinstall": "cp patches/firebase/firebase-release.aar node_modules/@nativescript/firebase/platforms/android"
},
"main": "./app/app.ts",
"description": "NativeScript Application",
"license": "SEE LICENSE IN <your-license-filename>",
"repository": "<fill-your-repository-here>",
"dependencies": {
"@nativescript/core": "^8.6.2",
"@nativescript/email": "^2.0.5",
"@nativescript/fingerprint-auth": "^8.1.0",
"@nativescript/firebase": "^11.1.3",
"@nativescript/iqkeyboardmanager": "^2.0.0",
"@nativescript/local-notifications": "^6.0.0",
"@nativescript/theme": "^3.0.2",
"@nstudio/nativescript-loading-indicator": "^4.1.2",
"@triniwiz/nativescript-image-zoom": "^4.1.3",
"moment": "^2.29.4",
"moment-timezone": "^0.5.31",
"nativescript-exit": "^1.0.1",
"nativescript-numeric-keyboard": "^5.0.2",
"nativescript-pdf-view": "^3.0.0-1",
"nativescript-phone": "^3.0.3",
"nativescript-ui-calendar": "^14.2.1",
"nativescript-webview-utils": "^4.0.0"
},
"devDependencies": {
"@nativescript/android": "8.6.2",
"@nativescript/ios": "^8.6.3",
"@nativescript/types": "~8.6.1",
"@nativescript/webpack": "~5.0.18",
"@types/node": "^20.11.16",
"typescript": "~5.3.2"
},
"gitHead": "",
"readme": "NativeScript Application"
}
Here is the output from ns doctor:
✔ Getting environment information
No issues were detected.
✔ Your ANDROID_HOME environment variable is set and points to correct directory.
✔ Your adb from the Android SDK is correctly installed.
✔ The Android SDK is installed.
✔ A compatible Android SDK for compilation is found.
✔ Javac is installed and is configured properly.
✔ The Java Development Kit (JDK) is installed and is configured properly.
✔ Xcode is installed and is configured properly.
✔ xcodeproj is installed and is configured properly.
✔ CocoaPods are installed.
✔ CocoaPods update is not required.
✔ CocoaPods are configured properly.
✔ Your current CocoaPods version is newer than 1.0.0.
✔ Python installed and configured correctly.
✔ The Python 'six' package is found.
✔ Xcode version 15.2.0 satisfies minimum required version 10.
✔ Getting NativeScript components versions information...
✔ Component nativescript has 8.6.5 version and is up to date.
✔ Component @nativescript/core has 8.6.2 version and is up to date.
✔ Component @nativescript/ios has 8.6.3 version and is up to date.
✔ Component @nativescript/android has 8.6.2 version and is up to date.
I have been stuck on this for 2 days. Tried cleaning the project, playing around with different adnroid build tool versions, etc. Nothing had worked so far.
Any ideas on what is going on?
Reproduction
No response
Relevant log output (if applicable)
No response
Environment
No response
Please accept these terms
- I have searched the existing issues as well as StackOverflow and this has not been posted before
- This is a bug report
- I agree to follow this project's Code of Conduct
- 主要语言
- JavaScript
- 星标
- 1.1k
- 派生
- 204
- 平均合并
- 1 天 9 小时
- 30 天内合并 PR
- 8
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
NativeScript/nativescript-cli 的其他 Issue
-
in-progress
NativeScript/nativescript-cli#6140 · 2 条评论 · 已指派 1 人 ·
-
NativeScript/nativescript-cli#6090 · 已指派 1 人 ·
-
in progress
NativeScript/nativescript-cli#6015 · 1 个 reaction · 已指派 1 人 ·
-
question
难度 4/5 3-5 天 新手友好度 48/100
NativeScript/nativescript-cli#5992 · 5 条评论 ·
-
feature-pending-triage
难度 4/5 3-5 天 新手友好度 35/100
NativeScript/nativescript-cli#5975 ·
查看 NativeScript/nativescript-cli 的全部 Issue
相似的 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 76/100
avniproject/avni-client#2135 ·
-
automated broken-link
难度 1/5 1 小时以内 新手友好度 85/100
-
agent/security hive/hosted-available-lke648397-260827-5n31 security
难度 2/5 1-3 小时 新手友好度 84/100
-
enhancement
难度 2/5 1-3 小时 新手友好度 70/100
babalae/bettergi-scripts-list#3674 ·
-
A-Release-Notes C-Editing D-Modest S-Ready-For-Implementation
难度 2/5 1-3 小时 新手友好度 72/100
bevyengine/bevy-website#2595 ·