转载

macOS Mojave(10.14.2)系统上编译LunarG/VulkanTools工程的Android版本

$ git clone https://github.com/LunarG/VulkanTools.git
 
$ cd VulkanTools
 
$ cd build-android
 
$ export ANDROID_SDK_HOME=~/Library/Android/sdk
 
$ export ANDROID_NDK_HOME=~/Library/Android/sdk/ndk-bundle
 
# 当前的版本需要Android SDK 23.0.0,但是需要Java 11以下版本的Java才能执行SDK里面的sdkmanager
 
# 显示可以安装的Java版本号信息,需要检出这个内容
$ brew tap caskroom/versions
 
$ brew search "java*"
==> Formulae
app-engine-java            javarepl                   libreadline-java
google-java-format         jslint4java
 
==> Casks
charles-applejava          java-beta                  netbeans-java-se
eclipse-java               java6                      oracle-jdk-javadoc
eclipse-javascript         java8                      yourkit-java-profiler
java                       netbeans-java-ee
==> Did you mean to perform a regular expression search?
Surround your query wit
 
# 可以看到上面存在Java8可以安装,我们安装Java8
$ brew cask install java8
 
# 指定默认的Java版本
$ export JAVA_HOME=`/usr/libexec/java_home -v 1.8`
 
$ $ANDROID_SDK_HOME/tools/bin/sdkmanager --update
 
$ $ANDROID_SDK_HOME/tools/bin/sdkmanager "platforms;android-23"
 
$ $ANDROID_SDK_HOME/tools/bin/sdkmanager "platforms;android-24"
 
$ $ANDROID_SDK_HOME/tools/bin/sdkmanager "build-tools;24.0.3"
 
# 可选安装
# sdkmanager "platform-tools" "platforms;24.0.3"
 
# 需要Android 7.0以上才支持Vulkan,因此,我们需要更高版本的编译工具
$ export PATH=$ANDROID_NDK_HOME:$ANDROID_SDK_HOME/build-tools/24.0.3/:$PATH
 
$ bash build_all.sh

参考链接

  • Failed to install android-sdk: “java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema”
  • 使用新版android sdk tool 的 sdkmanager 安装 android sdk 组件
  • Failed to run sdkmanager --list (Android SDK) with Java 9
  • How to resolve java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException in Java 9
  • Android SDK is not installed or is not configured properly, environment looks ok #3139
  • Installing specific major Java JDK versions on OS X via Homebrew
原文  http://www.mobibrw.com/2019/16575
正文到此结束
Loading...