Проблема с лицензиями React Native и Android Studio - PullRequest
1 голос
/ 30 мая 2020

У меня проблема с лицензиями React Native и Android.

Мои Android знания устарели, я пишу React, но не имею опыта работы с React Native. Вот почему я нанял кого-то, чтобы превратить созданное мною прогрессивное веб-приложение в нативное. Но в силу обстоятельств я теперь должен сам закончить sh последнюю вещь.

Приложение было создано на ma c, я пытаюсь запустить его на p c. Приложение выполняет сборку для IOS и Android из Microsoft Appcenter. Итак, я знаю, что это работает, но я хочу, чтобы он запускался и локально.

После выполнения всей установки и запуска react-native run-android сборка запускается, но останавливается из-за неподтвержденных лицензий.

Я уже была установлена ​​Android Studio. Я проверил SDK Manager на предмет правильных версий пакета (с «Показать детали пакета»). Обновил все, что мог придумать, включая переустановку Android Studio в энный раз. После первого удаления / переустановки он поместит его в каталог с суффиксом «1», вероятно, потому что исходный каталог не может быть удален. Тем не менее, переменные среды по-прежнему указывали на тот без суффикса. количество непринятых пакетов, которые я получил из-за ошибки react-native run-android, и впоследствии ошибка осталась прежней (хотя я забыл обратить внимание на то, какие пакеты я принимал).

Две любопытные вещи: - ошибка кажется ищу лицензии в папке licenses, но моя папка Android Studio содержит только папку license - сообщение об ошибке Using Android SDK: C:\Program Files\Android\Android Studio, но во время установки Android Studio я поместил свою в C:\AndroidSDK, потому что она ныла насчет пробелов.

Вот ошибка, которую я получаю после запуска react-native run-android

info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 905 file(s) to forward-jetify. Using 8 workers...
info Starting JS server...
info Installing the app...

> Configure project :app
Checking the license for package Android SDK Platform-Tools in C:\Program Files\Android\Android Studio\licenses
Warning: License for package Android SDK Platform-Tools not accepted.
Checking the license for package SDK Patch Applier v4 in C:\Program Files\Android\Android Studio\licenses
Warning: License for package SDK Patch Applier v4 not accepted.
Checking the license for package Android Emulator in C:\Program Files\Android\Android Studio\licenses
Warning: License for package Android Emulator not accepted.
Checking the license for package Android SDK Tools in C:\Program Files\Android\Android Studio\licenses
Warning: License for package Android SDK Tools not accepted.
Checking the license for package Android SDK Build-Tools 28.0.3 in C:\Program Files\Android\Android Studio\licenses
Warning: License for package Android SDK Build-Tools 28.0.3 not accepted.
Checking the license for package Android SDK Platform 28 in C:\Program Files\Android\Android Studio\licenses
Warning: License for package Android SDK Platform 28 not accepted.

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':app'.
> Failed to install the following Android SDK packages as some licences have not been accepted.
     patcher;v4 SDK Patch Applier v4
     build-tools;28.0.3 Android SDK Build-Tools 28.0.3
     emulator Android Emulator
     tools Android SDK Tools
     platforms;android-28 Android SDK Platform 28
     platform-tools Android SDK Platform-Tools
  To build this project, accept the SDK license agreements and install the missing components using the Android Studio SDK Manager.
  Alternatively, to transfer the license agreements from one workstation to another, see http://d.android.com/r/studio-ui/export-licenses.html

  Using Android SDK: C:\Program Files\Android\Android Studio

* 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 4s
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF8

error Failed to install the app. Please accept all necessary SDK licenses using SDK Manager: "$ANDROID_HOME/tools/bin/sdkmanager --licenses". Run CLI with --verbo
se flag for more details.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':app'.
> Failed to install the following Android SDK packages as some licences have not been accepted.
     patcher;v4 SDK Patch Applier v4
     build-tools;28.0.3 Android SDK Build-Tools 28.0.3
     emulator Android Emulator
     tools Android SDK Tools
     platforms;android-28 Android SDK Platform 28
     platform-tools Android SDK Platform-Tools
  To build this project, accept the SDK license agreements and install the missing components using the Android Studio SDK Manager.
  Alternatively, to transfer the license agreements from one workstation to another, see http://d.android.com/r/studio-ui/export-licenses.html

  Using Android SDK: C:\Program Files\Android\Android Studio

* 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 4s
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF8

    at checkExecSyncError (child_process.js:611:11)
    at execFileSync (child_process.js:629:15)
    at runOnAllDevices (C:\Users\foo\bar\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAl
lDevices.js:74:39)
    at buildAndRun (C:\Users\foo\bar\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\index.js:15
8:41)
    at C:\Users\foo\bar\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\index.js:125:12
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async Command.handleAction (C:\Users\foo\bar\node_modules\@react-native-community\cli\build\cliEntry.js:160:7)

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