Build app in AppCenter that uses Carthage - mobile

I've inherited a project that builds with Carthage. Using Xcode 12, I was faced with this error:
fatal error: /Applications/Xcode_12.3.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo: /Users/runner/Library/Caches/org.carthage.CarthageKit/DerivedData/12.3_12C33/AEXML/4.6.0/Build/Intermediates.noindex/ArchiveIntermediates/AEXML iOS/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/AEXML.framework/AEXML and /Users/runner/Library/Caches/org.carthage.CarthageKit/DerivedData/12.3_12C33/AEXML/4.6.0/Build/Products/Release-iphonesimulator/AEXML.framework/AEXML have the same architectures (arm64) and can't be in the same fat output file
Building universal frameworks with common architectures is not possible. The device and simulator slices for "AEXML" both build for: arm64
Rebuild with --use-xcframeworks to create an xcframework bundle instead.
Quick Google search brought me to this which works for my local machine.
Using AppCenter for the first time, I created a Pre-Build script with the following:
#!/usr/bin/env bash
# Pre-build
# See: https://learn.microsoft.com/en-us/appcenter/build/custom/scripts/#pre-build
echo "Pre-build has started."
sh ./carthage.sh update --use-submodules
echo "Pre-build has ended."
I assume Carthage should be used to build this? I get the error in AppCenter:
*** Building scheme "AEXML iOS" in AEXML.xcodeproj
A shell task (/usr/bin/xcrun lipo -create /Users/runner/Library/Caches/org.carthage.CarthageKit/DerivedData/12.3_12C33/AEXML/4.6.0/Build/Intermediates.noindex/ArchiveIntermediates/AEXML\ iOS/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/AEXML.framework/AEXML /Users/runner/Library/Caches/org.carthage.CarthageKit/DerivedData/12.3_12C33/AEXML/4.6.0/Build/Products/Release-iphonesimulator/AEXML.framework/AEXML -output /Users/runner/work/1/s/Carthage/Build/iOS/AEXML.framework/AEXML) failed with exit code 1:
fatal error: /Applications/Xcode_12.3.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo: /Users/runner/Library/Caches/org.carthage.CarthageKit/DerivedData/12.3_12C33/AEXML/4.6.0/Build/Intermediates.noindex/ArchiveIntermediates/AEXML iOS/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/AEXML.framework/AEXML and /Users/runner/Library/Caches/org.carthage.CarthageKit/DerivedData/12.3_12C33/AEXML/4.6.0/Build/Products/Release-iphonesimulator/AEXML.framework/AEXML have the same architectures (arm64) and can't be in the same fat output file
Building universal frameworks with common architectures is not possible. The device and simulator slices for "AEXML" both build for: arm64
Rebuild with --use-xcframeworks to create an xcframework bundle instead.
How to build in AppCenter?

--use-xcframeworks
This option is only available from Carthage 0.37.0. The appcenter's carthage version is 0.36.0. They need to update the carthage used in appcenter projects.
Can you look at the logs and see if this script is being run? Or is it that appcenter is running the carthage binary?
EDIT
The good news is that appcenter identifies carthage 0.37.0! I added a appcenter-post-clone.sh in my project directory:
#!/usr/bin/env bash
set -e
set -x
carthage update --cache-builds --use-xcframeworks --platform ios
carthage version
echo "" > Cartfile
echo "" > Cartfile.resolved
appcenter recognises that --use-xcframeworks is used and therefore 0.37.0 is required.
NOTE: I'm emptying the Cartfile* so that appcenter doesn't run its native carthage command (which it does on noticing Cartfile and Cartfile.resolved).
EDIT 2
I'm now considering using something like carthage_cache in appcenter as the carthage checkout and build ends up taking a lot of time.

Try this one (you may need to upgrade your Carthage first)
carthage update --no-use-binaries --use-xcframeworks --platform iOS

Related

How to configure build input packages/dependencies within Nix development shells?

I'm not using NixOS but I wrote a flake that I'm using to generate a dev shell to build a Rust project (this is essentially just the audio example from the Bevy repository). My issue is that I encounter the following error when attempting to run the project in the dev shell:
$ nix --extra-experimental-features nix-command --extra-experimental-features flakes develop
bash-4.4$ cargo run
Finished dev [unoptimized + debuginfo] target(s) in 6.62s
Running `target/debug/audio`
ALSA lib pcm_dmix.c:1075:(snd_pcm_dmix_open) unable to open slave
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: NoDevice', /home/a/.cargo/registry/src/github.com-1ecc6299db9ec823/bevy_audio
-0.5.0/src/audio_output.rs:22:67
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
bash-4.4
One of the dependencies of the project is the Bevy crate which requires ALSA, so I'm assuming the issue is because the ALSA package exposed by the dev shell is probably misconfigured. I use PipeWire on my actual system (I think it also uses ALSA as a backend) and I tried adding ALSA and PipeWire as one of the buildInputs for the flake, but I'm not sure how I'm supposed to configure these within the dev shell. According to this issue on the Bevy repository, the usual fix for this issue, at least for Arch-based distros, is to install the pipewire-alsa package. I'm not sure what the equivalent of doing that is in the context of a Nix dev shell is though, since there is no pipewire-alsa package in nixpkgs that I can add to my flake. So with that said, how should I go about configuring ALSA or PipeWire in the dev shell?

VOLTTRON install on rasbian buster

Can I get a tip for installing on rasp buster? Im hung up on the install directions to check the status of the rabbitMQ server. Traceback of bash console:
(volttron) pi#raspberry:~/Desktop/volttron $ echo 'export RABBITMQ_HOME=$HOME/rabbitmq_server/rabbitmq_server-3.7.7'|sudo tee --append ~/.bashrc
export RABBITMQ_HOME=$HOME/rabbitmq_server/rabbitmq_server-3.7.7
(volttron) pi#raspberry:~/Desktop/volttron $ source ~/.bashrc
pi#raspberry:~/Desktop/volttron $ RABBITMQ_HOME/sbin/rabbitmqctl status
bash: RABBITMQ_HOME/sbin/rabbitmqctl: No such file or directory
There are a few tracebacks earlier on the installation...
If it makes a difference or not here is the entire bash console process. The git gist link I just created the name install.py even though its just bash commands copied pasted per install directions...
`pi#raspberry:~/Desktop $ git clone https://github.com/VOLTTRON/volttron --branch releases/7.x`
It looks like there are a couple of different issues going on here:
The issue you quote above (RABBITMQ_HOME/sbin/rabbitmqctl: No such file or directory) is that your shell isn't finding the rabbitmqctl command. It looks like you added the RABBITMQ_HOME environment variable to your .bashrc, but used the string RABBITMQ_HOME instead of the variable expansion $RABBITMQ_HOME when you tried to run the command. Try running it as $RABBITMQ_HOME/sbin/rabbitmqctl status instead.
The rabbitmqctl status command will check the status of the rabbitmq application, but I don't think you've done anything to start it yet (that happens when you bootstrap the platform and/or start the platform configured to use the RMQ broker)
I think that the traces earlier in the installation process are problematic (appears to be the same error hit two different ways), but you just haven't run into them yet. I haven't seen any issues building gevent on the RPi 4 with buster (though it is pretty slow), but the ctypes error makes me wonder if there's an issue with the underlying c library it is trying to build on top of. I did notice that you're getting amd64 erlang packages, are you running Raspbian on an x86 processor? (if so this isn't a permutation we've tried and you may be hitting some package compatibility edge case we haven't seen)
One thing to try is to manually install cython into your virtualenvironment and then try running the bootstrap script again with the virtualenvironment activated. You could also try and pip install gevent==20.6.1 directly in that virtualenvironment (this is what the bootstrap script was doing at the failure point). VOLTTRON depends on gevent, so if that isn't installing the platform won't be able to run.

Unable to run the first time react-native app for android on mac

I'm trying to run the react-native application on the macbook for android version.So I have followed all the step for setting up the environment on the machine from here :
https://facebook.github.io/react-native/docs/getting-started.html
And I have successfully install Android Studio,Android SDK, JDK, Node, NPM, Watchman, Homebrew
javac -version : 9
node -v : v8.9.1
npm -v: 5.5.1
watchman version: 4.9.0
When I tried to run the application with the command
react-native run-android
I got this error :
Starting JS server...
Building and installing the app on the device (cd android && ./gradlew installDebug)...
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.gradle.internal.reflect.JavaMethod (file:/Users/aman/.gradle/wrapper/dists/gradle-2.14.1-all/8bnwg5hd3w55iofp58khbp6yv/gradle-2.14.1/lib/gradle-base-services-2.14.1.jar) to method java.lang.ClassLoader.getPackages()
WARNING: Please consider reporting this to the maintainers of org.gradle.internal.reflect.JavaMethod
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':app'.
> Failed to notify project evaluation listener.
> javax/xml/bind/annotation/XmlSchema
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 9.925 secs
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/android-setup.html
According to this GitHub issue, this issue has to do with JDK version. Make sure you're using v8, not v9, then the error should not occur.
Yes, according to #Sam Hanley it's an issue with the java version update. So, with worrying about the version update/downgrade, we can pass on with this issue by the following process;
First, update the distributionUrl in gradle-wrapper.properties
ie: located in this path;
PROJECT_PATH/android/gradle/wrapper/gradle-wrapper.properties
distributionUrl=https\://services.gradle.org/distributions/gradle-4.3-rc-2-all.zip
Set $JAVA_HOME environment variable using the installed android studio app path (Android studio should be installed)
export JAVA_HOME="/Applications/Android
Studio.app/Contents/jre/jdk/Contents/Home"
(PS: solution for macOS )
Hope this help!
I was able to get past this particular problem by doing the following:
Edit path_to_your_project/android/gradlew
Change DEFAULT_JVM_OPTS="" to DEFAULT_JVM_OPTS="--add-modules java.se.ee"

What are dronekit-python dependencies?

The dronekit Getting Started page suggests installing WinPython to use dronekit-Python on Windows because it includes the dependencies. I already have a working Python installation and I prefer not to risk messing it up with WinPython. What are the dependencies I need to install?
As of DKPY 2.0 this is outdated. Also, I might move to making a MavProxy module depending on whether or not the unpaid devs decide to stay when 3DR stops funding Dronekit
I've written a procedure to help with this problem which I've pasted. 3DR claims they're going to fix it, but in the mean time I hope this will help.
This setup is for Windows 64-bit systems only, although similar procedures will work with 32-bit.
Install MAVProxy and run it once before reaching step 5.
Install Notepad++.
Install Python v2.7.
Inside the Python folder, run WinPython Control Panel and select Advanced->Register Python.
Inside the same folder, run WinPython Command Prompt and input the following four commands:
• pip uninstall python-dateutil
• pip install droneapi
• pip install console
• echo module load droneapi.module.api >> %HOMEPATH%\AppData\Local\MAVProxy\mavinit.scr
Install WX Python. It should be the 64-bit Python 2.7 version.
Download and install OpenCV 2.4.11 to any folder
• Copy/paste the file cv2.pyd from OpenCV\build\python\2.7\x64\ to \python-2.7.6.amd64\Lib\site-packages.
Steps 8 through 11 apply to SITL only
Follow the online documentation for setting up Cygwin for SITL in Windows
Go to C:\cygwin\home\Your Username\ardupilot\Tools\autotest\
Open sim_vehicle.sh in Notepad++
• Change line 429 from…
cygstart -w "/cygdrive/c/Program Files (x86)/MAVProxy/mavproxy.exe" $options --cmd="$extra_cmd" $*
to...
cygstart -w "/cygdrive/c/Users/YOUR USERNAME HERE/Desktop/WinPython-64bit-2.7.6.4/python-2.7.6.amd64/Dronekit/Scripts/mavproxy.py" $options --cmd="$extra_cmd" $*
Note: This location changes depending on where you installed WinPython. For me, it was the desktop.
Start simulations as you would normally for SITL. To run Python scripts during the simulations, use the command
• api start Path to script\script_name
To use the code to connect to an actual copter, open WinPython Command Prompt
• Navigate to the folder which contains the scripts you wish to test
• Type mavproxy.py --master=”com##”,57600
• Run your script by typing into the MAVProxy terminal
o api start script_name

Starting and stopping App Engine instances with Docker

I've set up an App Engine project locally using Docker (on OSX), and have been running a server using the usual "gcloud preview app run app.yaml" command. From what I can tell, this keeps creating new images over and over again. After an hour or so of work I end up with something like 30 docker images, each taking 130MB.
Eventually I'm told I can no longer bind to localhost:8080. I tried killing all containers and images, but still cannot use localhost:8080 until I reboot.
Seems like I'm not using Docker/gcloud correctly. Anyone have an idea what I might be doing wrong? Is there another way I should be restarting App Engine instances other than hitting command C and running the "run" command again?
UPDATE: After looking closer, I noticed I'm getting this message when I run an app locally and a container is created: "http: Hijack is incompatible with use of CloseNotifier". I'm not familiar enough with Docker to understand what's going on here. All searches seem to point to Go, which I am not using.
UPDATE 2: Here is the trace:
Creating container...
INFO 2015-05-05 02:23:28,293 containers.py:560] Container 1564ce4344957114312d6d1dc696ffbb4176b40ace6dcff5e4239e13ee04a8f6 created.
Exception in thread Thread-2:
Traceback (most recent call last):
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 810, in __bootstrap_inner
self.run()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 763, in run
self.__target(*self.__args, **self.__kwargs)
File "/Users/judeosborn/google-cloud-sdk/platform/google_appengine/google/appengine/tools/docker/containers.py", line 643, in _ListenToLogs
for line in log_lines:
File "/Users/judeosborn/google-cloud-sdk/./lib/docker/docker/client.py", line 225, in _multiplexed_response_stream_helper
socket = self._get_raw_response_socket(response)
File "/Users/judeosborn/google-cloud-sdk/./lib/docker/docker/client.py", line 167, in _get_raw_response_socket
self._raise_for_status(response)
File "/Users/judeosborn/google-cloud-sdk/./lib/docker/docker/client.py", line 119, in _raise_for_status
raise errors.APIError(e, response, explanation=explanation)
APIError: 500 Server Error: Internal Server Error ("http: Hijack is incompatible with use of CloseNotifier")
INFO 2015-05-05 02:23:28,606 module.py:1745] New instance for module "default" serving on:
http://localhost:8080
There's an ongoing issue with Docker 1.6.x [reference] that prevents gcloud to work well with Managed VMs (as you seem to be using). Easiest workaround until it gets fixed is to downgrade Docker in your development machine to version 1.5.0, which is the latest version known to work.
For Ubuntu, you can do something like:
$ curl -sSL https://get.docker.com/ubuntu | sed 's/lxc-docker/lxc-docker-1.5.0/' | sudo sh
For other Linux distros, you might have to modify that sed pattern, though.
On the other hand, if you're using Boot2Docker under Mac OS X, follow these steps:
Fully uninstall your previous Boot2Docker/Docker setup; there is a nice guide here
Reinstall Boot2Docker/Docker following instructions here. IMPORTANT: You MUST stop right after completing "Install Boot2Docker" step and before "Start the Boot2Docker Application". Once you get there, open up a terminal and execute the following commands:
$ mkdir ~/.boot2docker
$ echo 'ISOURL="https://github.com/boot2docker/boot2docker/releases/download/v1.5.0/boot2docker.iso"' > ~/.boot2docker/profile
At this point, you can continue with "Start the Boot2Docker Application" section and finish the installation. You should now have a valid Docker launchpad with which to start Managed VMs. It'd be nice to double check that you have the right versions installed by issuing:
$ boot2docker ssh docker version | egrep "(Client|Server) version"
The output should look like:
Client version: 1.5.0
Server version: 1.5.0
Now you can try again your original command:
$ gcloud preview app run app.yaml
Try running:
$ ps uax | egrep "gcloud|appserver"
If you see anything running, kill it... you may even need to kill -9 it.

Resources