До 9 июля проект собирался без каких-либо проблем. В тот же день после фиксации сборка перестала работать.
Чтобы убедиться, что ошибка не вызвана новым кодом, мы отменили изменения, и сборка была все еще не работает.
После детального анализа журналов выяснилось, что когда tns обрабатывает плагин Firebase, ему необходимо загрузить gradle.
Когда это происходит, он загружает gradle 8.4, и с этой версией сборка не работает. В журналах рабочей сборки в тот же день загружаемая версия Gradle была 7.6.
Похоже, что один из упомянутых компонентов, такой как Nativescript-plugin-firebase, кажется, пытается использовать несовместимую версию gradle.
Это отрывок из журнала компиляции рабочей сборки:
Код: Выделить всё
Entrypoint bundle = runtime.js vendor.js bundle.js
[../$$_lazy_route_resource lazy recursive] ../$$_lazy_route_resource lazy namespace object 160 bytes {bundle} [built]
[./app.css] 10.8 KiB {bundle} [built]
[./app/app-routing.module.ts] 1.13 KiB {bundle} [built]
[./app/app.component.ts] 13 KiB {bundle} [built]
[./app/app.module.ts] 27.1 KiB {bundle} [built]
[./app/classes/custom-translate-loader.ts] 438 bytes {bundle} [built]
[./app/classes/modal-helper/modal-dialog-parameters.ts] 967 bytes {bundle} [built]
[./app/customPipe/backer-transform.ts] 1.1 KiB {bundle} [built]
[./app/customPipe/budged-order-id.pipe.ts] 1.38 KiB {bundle} [built]
[./app/customPipe/labels-transform.ts] 1.16 KiB {bundle} [built]
[./app/customPipe/url-transform.ts] 1.45 KiB {bundle} [built]
[./app/services/auth/token.interceptor.ts] 6.42 KiB {bundle} [built]
[./app/services/localstorage-budget-order/localstorage-budget-order.service.ts] 10 KiB {bundle} [built]
[./environments/environment.ts] 1.3 KiB {bundle} [built]
[./main.ts] 2.71 KiB {bundle} [built]
+ 1367 hidden modules
Webpack compilation complete.
nativescript-plugin-firebase: /var/lib/jenkins/workspace/ript_Application_Android_develop/platforms/android/.pluginfirebaseinfo not found, forcing prepare!
nativescript-plugin-firebase: running release build or change in environment detected, forcing prepare!
Downloading https://services.gradle.org/distributions/gradle-7.6-bin.zip
Код: Выделить всё
Entrypoint bundle = runtime.js vendor.js bundle.js
[../$$_lazy_route_resource lazy recursive] ../$$_lazy_route_resource lazy namespace object 160 bytes {bundle} [built]
[./app.css] 10.8 KiB {bundle} [built]
[./app/app-routing.module.ts] 1.13 KiB {bundle} [built]
[./app/app.component.ts] 13 KiB {bundle} [built]
[./app/app.module.ts] 27.1 KiB {bundle} [built]
[./app/classes/custom-translate-loader.ts] 438 bytes {bundle} [built]
[./app/classes/modal-helper/modal-dialog-parameters.ts] 967 bytes {bundle} [built]
[./app/customPipe/backer-transform.ts] 1.1 KiB {bundle} [built]
[./app/customPipe/budged-order-id.pipe.ts] 1.38 KiB {bundle} [built]
[./app/customPipe/labels-transform.ts] 1.16 KiB {bundle} [built]
[./app/customPipe/url-transform.ts] 1.45 KiB {bundle} [built]
[./app/services/auth/token.interceptor.ts] 6.42 KiB {bundle} [built]
[./app/services/localstorage-budget-order/localstorage-budget-order.service.ts] 10 KiB {bundle} [built]
[./environments/environment.ts] 1.3 KiB {bundle} [built]
[./main.ts] 2.71 KiB {bundle} [built]
+ 1367 hidden modules
Webpack compilation complete.
nativescript-plugin-firebase: /var/lib/jenkins/workspace/ript_Application_Android_develop/platforms/android/.pluginfirebaseinfo not found, forcing prepare!
nativescript-plugin-firebase: running release build or change in environment detected, forcing prepare!
Downloading https://services.gradle.org/distributions/gradle-8.4-bin.zip
Как мне убедиться, что я загружаю придерживаться версии 7.6?
Когда возникает эта ошибка, сначала происходит сбой сборки, поскольку для сборки требуется Java 17 вместо 11. Если мы установим эту версию, последующая ошибка сборки:< /p>
Код: Выделить всё
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'background_http'.
> Failed to notify project evaluation listener.
> Could not create an instance of type com.android.build.api.variant.impl.LibraryVariantBuilderImpl.
> Namespace not specified. Specify a namespace in the module's build file. See https://d.android.com/r/tools/upgrade-assistant/set-namespace for information about setting the namespace.
If you've specified the package attribute in the source AndroidManifest.xml, you can use the AGP Upgrade Assistant to migrate to the namespace value in the build file. Refer to https://d.android.com/r/tools/upgrade-assistant/agp-upgrade-assistant for general information about using the AGP Upgrade Assistant.
> Could not get unknown property 'generateReleaseBuildConfig' for root project 'background_http' of type org.gradle.api.Project.
Код: Выделить всё
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
Код: Выделить всё
* What went wrong:
A problem occurred evaluating root project 'background_http'.
> Failed to apply plugin 'com.android.internal.version-check'.
> Minimum supported Gradle version is 8.4. Current version is 7.6. If using the gradle wrapper, try editing the distributionUrl in platforms/tempPlugin/background_http/gradle/wrapper/gradle-wrapper.properties to gradle-8.4-all.zip
Подробнее здесь: https://stackoverflow.com/questions/787 ... ion-change
Мобильная версия