rhomobile build for iphone fails, provisioning profile can't be found - ios5

I got a simple application I want to run on my iphone. However I get a annoying error the provisioning profile can not be found. It happens after I go to my project folder and run:
sudo rake device:iphone:production
=== BUILD NATIVE TARGET RhoLib OF PROJECT RhoLib WITH CONFIGURATION Release ===
Check dependencies
=== BUILD NATIVE TARGET rhoextlib OF PROJECT rhoextlib WITH CONFIGURATION Release ===
Check dependencies
=== BUILD NATIVE TARGET curl OF PROJECT curl WITH CONFIGURATION Release ===
Check dependencies
=== BUILD NATIVE TARGET rhorunner OF PROJECT rhorunner WITH CONFIGURATION Release ===
Check dependencies
Code Sign error: Provisioning profile '0558F1B2-FE5A-4236-B9EE-A200EFAD68E9' can't be found
cd ~/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/rhodes-3.3.3
set bundle identifier
set URL name
restore_default_images
rm -f platform/iphone/Default.png
rm -f platform/iphone/Default.png
cp platform/iphone/Default.bak platform/iphone/Default.png
rm -f platform/iphone/Default.bak
rm -f platform/iphone/Default#2x.png
rm -f platform/iphone/Default-Portrait.png
rm -f platform/iphone/Default-PortraitUpsideDown.png
rm -f platform/iphone/Default-Landscape.png
rm -f platform/iphone/Default-LadscapeLeft.png
rm -f platform/iphone/Default-LandscapeRight.png
restore icon
rm -f platform/iphone/icon.png
cp platform/iphone/icon.bak platform/iphone/icon.png
rm -f platform/iphone/icon.bak
rm -f platform/iphone/icon57.png
cp platform/iphone/icon57.bak platform/iphone/icon57.png
rm -f platform/iphone/icon57.bak
rm -f platform/iphone/icon72.png
cp platform/iphone/icon72.bak platform/iphone/icon72.png
rm -f platform/iphone/icon72.bak
rm -f platform/iphone/icon114.png
cp platform/iphone/icon114.bak platform/iphone/icon114.png
rm -f platform/iphone/icon114.bak
************************************
ERROR during building by XCode !
XCode return next error code = pid 9102 exit 65
I checked the xcode organizer and the profile is both on the phone and the library.
I checked developer.apple.com and the profile is Distribution Ad Hoc for the device plugged in.
My build.yml:
sdkversion: 3.3.2
name: My Application
version: 0.1
vendor: rhomobile
build: release
bbver: 4.6
applog: rholog.txt
iphone:
provisionprofile: 0558F1B2-FE5A-4236-B9EE-A200EFAD68E9
sdk: iphoneos5.1
codesignidentity: "iPhone Distribution"
entitlements:
configuration: Release
emulator: 5.1
emulatortarget: iphone
BundleIdentifier: com.randomname.myapplication
BundleURLScheme: myapplication
wp:
productid:
uid: 3928127822
android:
version: 2.1
extensions:
- accelerometer
Anyone got a clue what I missed here? Already been trying different things for a few days without result :(

After a while I found that the script checks for the provisioning profile in /Library/MobileDevice/Provisioning Profiles instead of ~/Library/MobileDevice/Provisioning Profiles. This is caused by using the sudo command, however without sudo I dont have permission. Workaround is to create a /Library/MobileDevice/Provisioning Profiles folder and copy the installed profile to that location. Code signing works fine now.
edit: even a better solution is to reinstall the rhodes gem without sudo. By installing the suite I had to sudo it to make system changes, however this made the compilation require sudo as well and therefor look in the wrong place for provisioning profiles.
This did the trick:
sudo gem uninstall rhodes
gem install rhodes

Related

fastlane wasn't found on your system. did you run 'sudo gem install fastlane'?

When I try to run the command from my project it failed. But the fastlane command get the session. If I try to run app it shows the error as
2021-07-27 fastlane wasn't found on your system. did you run 'sudo gem install fastlane'?
2021-07-27 [FATAL] trying to use produce but fastlane wasn't located. see error above as well.
My machine has
% fastlane -v
fastlane installation at path:
/Users/name/.rvm/rubies/ruby-3.0.0/lib/ruby/gems/3.0.0/gems/fastlane-2.188.0/bin/fastlane
-----------------------------
[✔] 🚀
fastlane 2.188.0
% which fastlane
/Users/name/.rvm/rubies/ruby-3.0.0/bin/fastlane
Fixed the above by installing the fastlane in the /usr/local/bin folder
sudo gem install -i /usr/local/bin fastlane

Pods fail to install

I am trying to install pods for my project, but it fails with this error
[!] /bin/bash -c
set -e
sh build.sh cocoapods-setup
WARNING: The active Xcode command line tools, as returned by 'xcode-select -p', are not from Xcode.
The newest version of Xcode will be used instead.
Print: Entry, ":CFBundleVersion", Does Not Exist
sudo rm -rf /Library/Developer/CommandLineTools
sudo xcode-select --install
This will install the command line tools.
You can also get it from here:
Apple Downloads and install it.

Cannot install Cocoapods, keep getting error

I have been trying to install cocoapods but I keep getting an error. I have tried the following commands and get the same result.
sudo gem install cocoapods
sudo gem install -n /usr/local/bin cocoapods
Building native extensions. This could take a while...
ERROR: Error installing cocoapods:
ERROR: Failed to build gem native extension.
current directory: /Library/Ruby/Gems/2.6.0/gems/ffi-1.13.1/ext/ffi_c
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby -I /Library/Ruby/Site/2.6.0 -r ./siteconf20200726-37338-rvqxhv.rb extconf.rb
mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/include/ruby.h
You might have to install separate package for the ruby development
environment, ruby-dev or ruby-devel for example.
extconf failed, exit code 1
Gem files will remain installed in /Library/Ruby/Gems/2.6.0/gems/ffi-1.13.1 for inspection.
Results logged to /Library/Ruby/Gems/2.6.0/extensions/universal-darwin-19/2.6.0/ffi-1.13.1/gem_make.out
After a lot of searching I finally came across a solution that I believe works. If you are use Mac OS Catalina you need to use Brew.
Open Terminal on your Mac.
Now, run
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" < /dev/null 2> /dev/null
Install cocoapods using brew
brew install cocoapods
cocoapods is ready to use now!

Perfect Asistant: Build Linux failed due to module cache path on linux vs macOS

I tried to follow along the Perfect screencast from RayWenderlich on a Mac. On Perfect Asistant (2nd screencast), he showed using Perfect Assistant, we could just click on the Build Linux and it will build on Linux given we have installed the Docker.
In my case it started to compile then it failed with error that current module cache path and the module cache path the PCH was compiled was not the same. I don't know how to update the module cache path just for Linux.
Here are the console output:
Starting Linux build of /Users/hange/Developer/RayWenderlich/Practices/ServerSide_Perfect/hello-perfect-assistant
Using image perfectassistant/helloperfectassistant
Using image perfectassistant/helloperfectassistant
Compile COpenSSL openssl.c
Compile LinuxBridge LinuxBridge.c
error: PCH was compiled with module cache path '/perfectbuild/.build_lin/debug/ModuleCache/5QE1M5WG4ATI', but the path is currently '/perfectbuild/.build/debug/ModuleCache/5QE1M5WG4ATI'
1 error generated.
Failed: systemError(1, ":0: error: build had 1 command failures\nswift-build: error: exit(1): /swift-3.1.1-RELEASE-ubuntu16.04/usr/bin/swift-build-tool -f /perfectbuild/.build/debug.yaml\n")
In Perfect Assistant project editor window, press and hold button "Build" and choose "Clean Project", then try building it once more.
Alternatively, press and hold button "Open" then choose "Open Terminal", and run commands below:
$ rm -rf .build*
$ rm -rf *.pins
$ rm -rf *.resolved
Then try building.
If you still couldn't understand what was going on, try opening a terminal window and run scripts below:
$ cd "/Users/hange/Developer/RayWenderlich/Practices/ServerSide_Perfect/hello-perfect-assistant"
$ rm -rf .build*
$ rm -rf *.pins
$ rm -rf *.resolved
Which should perform the same task as the second solution.

CMake install directory permission

I have built a project using cmake (LLVM project) and tried to install it by issuing the following command:
$ cmake3 --build . --target install
If I run it using root then there is no problem and the files will be installed under the directory /usr/local/.
My problem is when I want to install the project using normal user.
I get the following error:
CMake Error at cmake_install.cmake:36 (file):
file INSTALL cannot set permissions on "/usr/local/include/llvm"
I have changed the permission of directory /usr/local/ to 777 recursively, and their ownership to root:wheel and I added my normal user to group wheel. But I still cannot install the files into the /usr/local/ directory.
The main issue is about building project in Eclipse which fails at "Build Install" command.
chmod 777 -R / is a very scary command. I've destroyed a system once by doing that.
The philosophy I use for this is:
If I need to deploy something through my IDE to debug or test before packaging, I deploy it locally within my home directory.
I only install stuff to my system (outside of home) if it has been packaged first (*.deb, *.rpm, *.tar.gz) so that I can remove it without problems.
For me, I do this with:
cmake $src
cmake --build . --target install -- DESTDIR=stage
This will configure my project, make it, then install it locally in a folder called ./stage which resides in my build directory. I can then run my executable from ./stage/usr/bin. Note that this only works if make is your generator.
Once I've tested it and I'm happy, I package it and deploy to my system or upload to a repository:
cpack
sudo dpkg -i <package>.deb
We should use USE_SOURCE_PERMISSIONS in our install function.
Example:
install(DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/Release/" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}" USE_SOURCE_PERMISSIONS)