Mac M1上 Android开发使用protobuf报错处理

Posted cding1818

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Mac M1上 Android开发使用protobuf报错处理相关的知识,希望对你有一定的参考价值。

Mac M1笔记本上加载以前项目是,protobuf报错了:

因为Mac M1芯片是ARM架构的,在使用protobuf时就需要添加:osx-x86_64后缀 。

 这样问题就解决了。

markdown 在Mac上设置Android开发环境

Here is a high level overview for what you need to do to get most of an Android environment setup and maintained.

Prerequisites (for Homebrew at a minimum, lots of other tools need these too):
- XCode is installed (via the App Store)
- XCode command line tools are installed (`xcode-select --install` will prompt up a dialog)
- Java


Install Homebrew:

    ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"

Make sure the doctor is happy (do what it tells you):

    brew doctor
    brew tap caskroom/cask

Install Python 3:
    brew install python3

Use Homebrew to install Android dev tools:

    brew install ant
    brew install maven
    brew install gradle
    brew cask install android-sdk
    brew cask install android-ndk
    
  **NB: Make sure you have Java version 8 installed**

Install all of the Android SDK components (you will be prompted to agree to license info and then this will take a while to run):

    sdkmanager "platform-tools" "platforms;android-23"
    sdkmanager "build-tools;23.0.1"
    
Install HAXM for blazing fast emulators.  Check out the "Configuring VM Acceleration on Mac" section here: http://developer.android.com/tools/devices/emulator.html
    
    brew cask install intel-haxm // this might not work on high sierra.

*Edit:* You can download the dmg and install manually from Intel's site

Finally update your environment variables:

    export ANT_HOME=/usr/local/opt/ant
    export MAVEN_HOME=/usr/local/opt/maven
    export GRADLE_HOME=/usr/local/opt/gradle
    export ANDROID_HOME=/usr/local/share/android-sdk
    export ANDROID_NDK_HOME=/usr/local/share/android-ndk
    export INTEL_HAXM_HOME=/usr/local/Caskroom/intel-haxm
    
Update your paths (bonus points to a better solution to the hardcoded build tools version):

    export PATH=$ANT_HOME/bin:$PATH
    export PATH=$MAVEN_HOME/bin:$PATH
    export PATH=$GRADLE_HOME/bin:$PATH
    export PATH=$ANDROID_HOME/tools:$PATH
    export PATH=$ANDROID_HOME/platform-tools:$PATH
    export PATH=$ANDROID_HOME/build-tools/23.0.1:$PATH
    
Optional: You will have to add the ANDROID_HOME to the profile configuration settings either on .zshrc, .bashrc or .bash_profile ( suggested )

以上是关于Mac M1上 Android开发使用protobuf报错处理的主要内容,如果未能解决你的问题,请参考以下文章

在Mac M1芯片下使用Android Studio模拟器

(M1 Mac) Android Studio 未检测到 Android 模拟器

Android Emulator 在 M1 mac/Apple Silicon 上卡住了加载屏幕

在M1芯片的Macbook pro上高效开发Android的正确姿势

在M1芯片的Macbook pro上高效开发Android的正确姿势

M1 mac 上的 Android 平台工具