Задача bundleReleaseJsAndAssets не найдена в корневом проекте - PullRequest
0 голосов
/ 28 июня 2019

Я не могу получить успешную сборку с проектом React Native в Дженкинсе. Я получаю эту ошибку:

14: 41: 59 СБОЙ: Сборка не удалась, исключение. 14:41:59 14:41:59 * Что пошло не так: 14:41:59 Не удалось выполнить задачу ': Приложение: bundleDevReleaseJsAndAssets. 14:41:59> Обработка команды 'узел' 'завершен с ненулевым значением выхода 1 14: 41: 59

Я нашел ответ здесь:

React-Native assemblyRelease завершается с ошибкой для задачи ': app: bundleReleaseJsAndAssets'

Проблема в том, когда пора строить, второй шаг:

./gradlew assembleRelease -x bundleReleaseJsAndAssets

Я получаю эту ошибку:

FAILURE: Build failed with an exception.

* What went wrong:
Task 'bundleReleaseJsAndAssets' not found in root project 'engage-application.mobile'.

* Try:
Run gradlew tasks to get a list of available tasks. Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

Запуск gradlew tasks не дает мне никакой информации:

✗ gradle tasks

> Task :tasks

------------------------------------------------------------
Tasks runnable from root project
------------------------------------------------------------

Build Setup tasks
-----------------
init - Initializes a new Gradle build.
wrapper - Generates Gradle wrapper files.

Help tasks
----------
buildEnvironment - Displays all buildscript dependencies declared in root project 'engage-application.mobile'.
components - Displays the components produced by root project 'engage-application.mobile'. [incubating]
dependencies - Displays all dependencies declared in root project 'engage-application.mobile'.
dependencyInsight - Displays the insight into a specific dependency in root project 'engage-application.mobile'.
dependentComponents - Displays the dependent components of components in root project 'engage-application.mobile'. [incubating]
help - Displays a help message.
model - Displays the configuration model of root project 'engage-application.mobile'. [incubating]
projects - Displays the sub-projects of root project 'engage-application.mobile'.
properties - Displays the properties of root project 'engage-application.mobile'.
tasks - Displays the tasks runnable from root project 'engage-application.mobile'.

To see all tasks and more detail, run gradle tasks --all

To see more detail about a task, run gradle help --task <task>

BUILD SUCCESSFUL in 0s
1 actionable task: 1 executed

Кроме того, обратите внимание, что я должен был запустить gradle tasks.

Немногим связанным статьям по SO от 3 до 5 лет, и они говорят о версиях

buildscript {
    ext {
        buildToolsVersion = "27.0.3"
        minSdkVersion = 16
        compileSdkVersion = 27
        targetSdkVersion = 26
        supportLibVersion = "27.1.1"
    }

внутри build.gradle, которые не подходят для моей версии RN:

System:
  OS: macOS High Sierra 10.13.6
  CPU: (8) x64 Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz
  Memory: 609.73 MB / 16.00 GB
  Shell: 5.3 - /bin/zsh
Binaries:
  Node: 11.10.1 - /usr/local/bin/node
  Yarn: 1.10.1 - /usr/local/bin/yarn
  npm: 6.7.0 - /usr/local/bin/npm
  Watchman: 4.7.0 - /usr/local/bin/watchman
SDKs:
  iOS SDK:
    Platforms: iOS 12.1, macOS 10.14, tvOS 12.1, watchOS 5.1
  Android SDK:
    API Levels: 23, 25, 26, 27, 28
    Build Tools: 23.0.1, 26.0.2, 27.0.3, 28.0.3
    System Images: android-28 | Google Play Intel x86 Atom
IDEs:
  Android Studio: 3.4 AI-183.5429.30.34.5452501
  Xcode: 10.1/10B61 - /usr/bin/xcodebuild
npmPackages:
  react: 16.6.3 => 16.6.3
  react-native: 0.57.8 => 0.57.8
npmGlobalPackages:
  react-native-cli: 2.0.1
  react-native-git-upgrade: 0.2.7

Я недавно обновился до версии 0.57.8 и следовал этому руководству: https://reactnative.thenativebits.com/courses/upgrading-react-native/upgrade-to-react-native-0.57/

Мне объяснили, что мне нужно бежать:

✗ ./gradlew assembleRelease -x bundleDevReleaseJsAndAssets

и я сделал, и я продолжаю получать ошибку.

FAILURE: Build failed with an exception.

* What went wrong:
Task 'bundleDevReleaseJsAndAssets' not found in root project 'engage-application.mobile'.

* Try:
Run gradlew tasks to get a list of available tasks. Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

Если я тогда попытаюсь следовать шагу Картика Шаха: React-Native assemblyRelease завершается неудачей для задачи ': app: bundleReleaseJsAndAssets'

Я получаю эту ошибку:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':react-native-sentry:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 7s
208 actionable tasks: 195 executed, 13 up-to-date

Я столкнулся с этой проблемой три дня назад и подумал, что с обновлением она будет решена:

https://github.com/getsentry/react-native-sentry/issues/610

Итак, я обновил React Native Sentry, и теперь я получаю следующие ошибки:

The TaskInternal.executer property has been deprecated and is scheduled to be removed in Gradle 5.0. There are better ways to re-use task logic, see https://docs.gradle.org/4.4/userguide/custom_tasks.html#sec:reusing_task_logic.
        at sentry_c79fxbhuascug468f001tukcq$_run_closure1$_closure6.doCall(/Users/danale/Projects/engage-application.mobile/node_modules/react-native-sentry/sentry.gradle:19)
        (Run with --stacktrace to get the full stack trace of this deprecation warning.)
error: resource android:style/TextAppearance.Material.Widget.Button.Borderless.Colored not found.
error: resource android:style/TextAppearance.Material.Widget.Button.Colored not found.
/Users/danale/.gradle/caches/transforms-1/files-1.1/appcompat-v7-27.1.1.aar/478ea8d2caa80bc12b39e3960167e1f6/res/values/values.xml:251:5-69: AAPT: error: resource android:attr/fontStyle not found.

/Users/danale/.gradle/caches/transforms-1/files-1.1/appcompat-v7-27.1.1.aar/478ea8d2caa80bc12b39e3960167e1f6/res/values/values.xml:251:5-69: AAPT: error: resource android:attr/font not found.

/Users/danale/.gradle/caches/transforms-1/files-1.1/appcompat-v7-27.1.1.aar/478ea8d2caa80bc12b39e3960167e1f6/res/values/values.xml:251:5-69: AAPT: error: resource android:attr/fontWeight not found.

error: failed linking references.

Кажется, что здесь есть код ошибки:

def bundleTasks = tasks.findAll { task -> task.name.startsWith("bundle") && task.name.endsWith("JsAndAssets") && !task.name.contains("Debug")}
    bundleTasks.each { bundleTask ->
        def shouldCleanUp
        def sourcemapOutput
        def bundleOutput
        def props = bundleTask.getProperties()
        def reactRoot = props.get("workingDir")

Есть ли у кого-нибудь решение или опыт с этим для React Native Sentry?

1 Ответ

0 голосов
/ 28 июня 2019

Единственное отличие, которое я вижу, состоит в том, что ваша первоначальная ошибка относится к задаче bundleDevReleaseJsAndAssets, а не к задаче bundleReleaseJsAndAssets, которая завершилась ошибкой в ​​другом сообщении, на которое вы ссылались.Поэтому, возможно, попробуйте выполнить это вместо:

./gradlew assembleRelease -x bundleDevReleaseJsAndAssets

По сути, вы сказали, что вы исключаете задачу, которая может не входить в ваш проект.Вы должны указать правильный.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...