Library missing with GoMobile build - go

I get the following error while trying to build with Go mobile, fresh install with fresh NDK install. ANDROID_NDK_HOME is set, but it seems to not find a particular library.
Running on Mac.
gomobile: /Users/xxxx/Library/Android/sdk/ndk/23.0.7599858/toolchains/llvm/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-nm /var/folders/zc/4fqpckd56nz59k253rcj66380000gn/T/gomobile-work-456128244/lib/armeabi-v7a/libbasic.so: fork/exec /Users/xxxxx/Library/Android/sdk/ndk/23.0.7599858/toolchains/llvm/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-nm: no such file or directory

Related

How do I build and run React Native Project on new MacBook in Xcode?

I am having issues attempting to run my React Native project on my new MacBook Pro. I transferred the project from my old MacBook and downloaded Xcode but I get the following error when trying to run the project.
"%HOME_DIRECTORY%/node_modules/react-native/scripts/generate-specs.sh: No such file or directory
Command PhaseScriptExecution failed with a nonzero exit code"
I have installed Homebrew, Watchman and ran pod install but the project is not launching in Xcode.
Can someone please assist?
Thanks.
Look at your package.json file. There are a lot of dependencies in there. They must be installed. If there is no node_modules folder, where your package.json is located, they are not installed.
Installing the dependencies can be done by running yarn install or npm install, depending what package manager you use. Make sure you are in the folder where your package.json is located. Clean your Build Folder from Xcode and run it again. It should work.

no Android NDK found in $ANDROID_HOME/ndk-bundle nor in $ANDROID_NDK_HOME in Windows 10

I'm following the official guide to install gomobile. I have Android Studio installed and via the Android Studio SDK manage installed NDK (side by side) and all the SDK packages. Android Studio has no problem compiling and deploying my normal Android apps to me device.
I ran successfully (by which I mean without any errors):
go env -w GO111MODULE=auto
gomobile init
go get -d golang.org/x/mobile/example/basic
Then I ran:
gomobile build -target=android golang.org/x/mobile/example/basic
And got the error:
gomobile: no Android NDK found in $ANDROID_HOME/ndk-bundle nor in $ANDROID_NDK_HOME
When I run as suggested in the answer to another older thread:
gomobile init -ndk C:\Users\Christian\AppData\Local\Android\Sdk\ndk-bundle
I get:
flag provided but not defined: -ndk
usage: gomobile init [-openal dir]
What do I need to do to fix this?
Solution for linux/mac users
I had the same problem on Linux, and I solved it by making the environment variable like this:
export ANDROID_HOME=$HOME/Android/Sdk
in this path I have the ndk-bundle folder which can also be downloaded from here
after that i could simply run
gomobile bind -x -v .
in my project directory and I get the .aar file that I want.

Homebrew doesn't install GCC correctly

I recently upgraded xcode command line tools to version 2384. After this I decided to reinstall gcc which was installed with homebrew. Installation completed with no errors but when I tried to compile a simple code with iostream library, it gave an error saying:
/usr/local/Cellar/gcc/10.2.0/include/c++/10.2.0/cwchar:44:10: fatal error: wchar.h: No such file or directory
Later, I checked the library folder and there were multiple files missing such as assert.h. I want to ask is there any way to fix this other than installing every file one by one? I already tried updating homebrew and xcode command line tools.

How to integrate react-native-text-detector successfully?

The documentation for this library's install has been followed step for step.
npm install react-native-text-detector --save
added pod "RNTextDetector", path: '../node_modules/react-native-text-detector/ios to pod file
did not manually link binary or add file to library in Xcode
However the build continually fails. it fails in the same way when trying to integrate react-native-tesseract-ocr, one of the dependencies for this library.
the build error:
-weak_library and -bitcode_bundle (Xcode setting ENABLE_BITCODE=YES) cannot be used together
I was having the same problem...
After some more research, I looked into a few things regarding tesseract-ocr for iOS that helped get everything up and running as expected.
Install react-native-text-detector per the repo's README
Added the linker flag -lstdc++ in Xcode build settings
Set the build setting Enable Bitcode to NO in Xcode build settings
Followed the README in this repo, https://github.com/Kila2/libstdc-.6.0.9.tbd/blob/master/README.md
After that I was able to build and run both on the iOS simulator and on a test device.
I have 11.3, the latest stable version.

Flutter desktop embedding

Following these instructions
I tried to run a new project on macOS(desktop) using Android Studio.
I get the following error:
Launching lib/main.dart on macOS in release mode... Finished with
error: Unable to get Xcode project information: xcodebuild: error:
The directory
/Users/current.user/Work/Playground/testout/flutter_app2/macos does
not contain an Xcode project, workspace or package.
I get the same issue if I run in the terminal flutter run --release -d macOS
Running on a simulator/device, works fine.
It doesn't sound like you followed the instructions for running a project other than the FDE example. A newly created Flutter project doesn't have support for running on desktop; you need to add that.
See also flutter.dev/desktop#create for information on the state of create and run for desktop.

Resources