我第一次使用 react-native run-android 时遇到了困难.错误如下所示 [英] I am having a difficulty with first time react-native run-android. The Error looks like this following
问题描述
FAILURE:构建失败,出现异常.
FAILURE: Build failed with an exception.
出了什么问题:出现问题
What went wrong: A problem occurred
正在配置项目:app".未能通知项目评估侦听器.javax/xml/bind/annotation/XmlSchema
configuring project ':app'. Failed to notify project evaluation listener. javax/xml/bind/annotation/XmlSchema
推荐答案
FIX:
确保您的系统上安装了 java.或者使用 linux 命令安装:
Make sure that java is installed on your system. Or install using linux command:
$sudo apt-get install openjdk-8-jdk
设置 JAVA_HOME 环境变量.对于 Linux
Set JAVA_HOME environment variable. For linux
JAVA_HOME="/usr/lib/jvm/java-1.8.0-openjdk-amd64"
到/etc/environment 文件新行.
to /etc/environment file new line.
在 ~/.bashrc
文件中导出 ANDROID_HOME.
Export ANDROID_HOME in ~/.bashrc
file.
导出 ANDROID_HOME="$HOME/Android/Sdk"导出 PATH="$PATH:$ANDROID_HOME/工具"出口 PATH="$PATH:$ANDROID_HOME/platform-tools"source/etc/environment
最后提示:如果每次关闭(ctrl+c)并打开 JS 服务器时都会出现 watchman 错误.运行以下命令.
Last tip: if you get watchman error everytime you close(ctrl+c) and open the JS server. run the following command.
echo 999999 |须藤 tee -a/proc/sys/fs/inotify/max_user_watches &&回声 999999 |须藤 tee -a/proc/sys/fs/inotify/max_queued_events &&回声 999999 |须藤 tee -a/proc/sys/fs/inotify/max_user_instances &&守望者关闭服务器
这篇关于我第一次使用 react-native run-android 时遇到了困难.错误如下所示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!