Xcode AFNetworking - Command /bin/sh with exit code 1 - swift

When I run my project I get this error, i can't understand the problem...
Showing Recent Issues
PhaseScriptExecution [CP]\ Embed\ Pods\ Frameworks /Users/leo/Library/Developer/Xcode/DerivedData/Clubber-ghdadinxjzgblkgllmrradwnzqcv/Build/Intermediates.noindex/Clubber.build/Debug-iphoneos/Clubber.build/Script-6032B42DA46117C50C8623CC.sh
cd /Users/leo/Documents/Progetti/iOS/Clubber
/bin/sh -c /Users/leo/Library/Developer/Xcode/DerivedData/Clubber-ghdadinxjzgblkgllmrradwnzqcv/Build/Intermediates.noindex/Clubber.build/Debug-iphoneos/Clubber.build/Script-6032B42DA46117C50C8623CC.sh
mkdir -p /Users/leo/Library/Developer/Xcode/DerivedData/Clubber-ghdadinxjzgblkgllmrradwnzqcv/Build/Products/Debug-iphoneos/Clubber.app/Frameworks
rsync --delete -av --filter P .*.?????? --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "/Users/leo/Library/Developer/Xcode/DerivedData/Clubber-ghdadinxjzgblkgllmrradwnzqcv/Build/Products/Debug-iphoneos/AFNetworking/AFNetworking.framework" "/Users/leo/Library/Developer/Xcode/DerivedData/Clubber-ghdadinxjzgblkgllmrradwnzqcv/Build/Products/Debug-iphoneos/Clubber.app/Frameworks"
building file list ... done
AFNetworking.framework/
AFNetworking.framework/AFNetworking
AFNetworking.framework/Info.plist
sent 1305423 bytes received 70 bytes 2610986.00 bytes/sec
total size is 1305025 speedup is 1.00
Stripped /Users/leo/Library/Developer/Xcode/DerivedData/Clubber-ghdadinxjzgblkgllmrradwnzqcv/Build/Products/Debug-iphoneos/Clubber.app/Frameworks/AFNetworking.framework/AFNetworking of architectures: armv7
Code Signing /Users/leo/Library/Developer/Xcode/DerivedData/Clubber-ghdadinxjzgblkgllmrradwnzqcv/Build/Products/Debug-iphoneos/Clubber.app/Frameworks/AFNetworking.framework with Identity iPhone Developer: cana.46#live.it (U698V62S44)
/usr/bin/codesign --force --sign 17E36AAB0AE20D9A471180DEC67D5500DF962DC0 --preserve-metadata=identifier,entitlements '/Users/leo/Library/Developer/Xcode/DerivedData/Clubber-ghdadinxjzgblkgllmrradwnzqcv/Build/Products/Debug-iphoneos/Clubber.app/Frameworks/AFNetworking.framework'
/Users/leo/Library/Developer/Xcode/DerivedData/Clubber-ghdadinxjzgblkgllmrradwnzqcv/Build/Products/Debug-iphoneos/Clubber.app/Frameworks/AFNetworking.framework: unknown error -1=ffffffffffffffff
Command /bin/sh failed with exit code 1
I tried to:
Clean my project
Delete derived data
Reinstall my pods
Set Build Active architetture only to NO in my POD Project
I also tried to read a lot of related posts but nothing... -.-
This problem is driving me crazy, someone can help me?

This is because you might have not check the "run the script only when installing"
go to the project build folder
Select Targets
Select Build Phases tab
Open Run Script drop-down option
Select Run script only when installing checkbox
And then clean your project (cmd+shift+k) and build your project.

i found this solution, for some reasons my login keychan wasn't still valid, this works for me : Getting this error command /usr/bin/codesign failed with exit code 1 with xcode 9.1?

Related

Where do I find alias arguments in fastlane?

In a fastlane project that I am taking over everything is run by command line (e.g. not fastfile). In this project (using fastlane 1.7) there are aliases used for arguments. Where would I go to find out what each of the aliases map to as far as fastlane commands? For example:
def build(Myapp, skip_profile)
if skip_profile || download_provisioning_profiles(MyApp)
build_cmd = "gym -a -r -s #{MyApp.name} -o ./build -n #{MyApp.ipa_name} --use_legacy_build_api"
system(build_cmd)
else
puts "Was unable to install provisioning profiles"
exit 1
end
end
Looking at this I am pretty sure that -o is the output but where would I look to find out explicitly what -a and -r and -s and -o are?
Run
fastlane gym --help
to get a list of all available options for the gym tool.

How to install Grafana on Mac

I tied the following steps
cd $GOPATH/src/github.com/grafana/grafana
go run build.go setup
I got the following
Version: 2.5.0-pre1, Linux Version: 2.5.0, Package Iteration: pre1
go get -v github.com/tools/godep
github.com/tools/godep (download)
github.com/tools/godep/Godeps/_workspace/src/github.com/kr/fs
github.com/tools/godep/Godeps/_workspace/src/github.com/pmezard/go-difflib/difflib
github.com/tools/godep/Godeps/_workspace/src/golang.org/x/tools/go/vcs
github.com/tools/godep
go get -v github.com/blang/semver
github.com/blang/semver (download)
github.com/blang/semver
go get -v github.com/mattn/go-sqlite3
go install -v github.com/mattn/go-sqlite3
then i executed
$GOPATH/bin/godep restore
i got no putput but command got executed
then i ran the command
go run build.go build
Version: 2.5.0-pre1, Linux Version: 2.5.0, Package Iteration: pre1
rm -r bin
rm -r Godeps/_workspace/pkg
rm -r Godeps/_workspace/bin
rm -r dist
rm -r tmp
rm -r /Users/skhare/sk/go/pkg/darwin_amd64/github.com/grafana
rm -r ./bin/grafana-server
rm -r ./bin/grafana-server.md5
GOPATH=/Users/skhare/sk/go/src/github.com/grafana/grafana/Godeps/_workspace:/Users/skhare/sk/go
go build -ldflags -w -X main.version '2.5.0-pre1' -X main.commit 'v2.1.2+394- gfb767f5' -X main.buildstamp 1442671169 -o ./bin/grafana-server .
# github.com/grafana/grafana
link: warning: option -X main.version 2.5.0-pre1 may not work in future releases; use -X main.version=2.5.0-pre1
link: warning: option -X main.commit v2.1.2+394-gfb767f5 may not work in future releases; use -X main.commit=v2.1.2+394-gfb767f5
link: warning: option -X main.buildstamp 1442671169 may not work in future releases; use -X main.buildstamp=1442671169
then i executed
npm install
i had to install npm
>npm install -g grunt-cli
/usr/local/bin/grunt -> /usr/local/lib/node_modules/grunt-cli/bin/grunt
grunt-cli#0.1.13 /usr/local/lib/node_modules/grunt-cli
├── resolve#0.3.1
├── nopt#1.0.10 (abbrev#1.0.7)
└── findup-sync#0.1.3 (lodash#2.4.2, glob#3.2.11)
>grunt
Running "jscs:src" (jscs) task
>> 156 files without code style errors.
Running "jshint:source" (jshint) task
✔ No problems
Running "jshint:tests" (jshint) task
✔ No problems
Running "tslint:source" (tslint) task
>> 11 files lint free.
Running "clean:gen" (clean) task
Cleaning public_gen...OK
Running "copy:public_to_gen" (copy) task
Created 122 directories, copied 553 files
Running "less:src" (less) task
File public_gen/css/bootstrap.dark.min.css created.
File public_gen/css/bootstrap.light.min.css created.
File public_gen/css/bootstrap-responsive.min.css created.
Running "concat:cssDark" (concat) task
File public_gen/css/grafana.dark.min.css created.
Running "concat:cssLight" (concat) task
File public_gen/css/grafana.light.min.css created.
Running "typescript:build" (typescript) task
42 files created. js: 14 files, map: 14 files, declaration: 14 files (968ms)
Done, without errors.
>go get github.com/Unknwon/bra
the above command did not give any output, nor an error message
bra run
it says -bash: bra: command not found
i tried to look for the resolution, but i could not find it. Please help
Recompile backend on source change
To rebuild on source change (requires that you executed godep restore)
go get github.com/Unknwon/bra
bra run
Running Grafana Locally
You can run a local instance of Grafana by running:
./bin/grafana-server
You must have missed this step!
go get github.com/Unknwon/bra
You can install Grafana using home brew.
brew update
brew install grafana
This sounds like an issue where Go is just being installed to build something else (for me, it was Grafana). In which case $GOPATH/bin is not in your PATH. $GOPATH/bin/bra should work. It did for me.
I suggest you installing Grafana inside Docker. If you install Docker for Mac, the GUI (Kitematic) will allow you to install grafana as easily as one click. You will just need to create a new container with "+ New" button, search grafana through the exisiting image lists and click "Create"
Docker will download grafana and it will appear in the left sidebar:

aapt can't find 9Patch Images

I want to certificate an Android project just with cmd. Now Im stocked at the creation of the .apk file. aapt says he cant find the pictures with the .9. ending. If i rename this pictures and delete the .9. ending then everything works fine without the correct size of the pictures in the app.
ettings
I figured out that I have to "crunch" this pictures, like what he says at the page: Ant Build AAPT Crunch is stripping draw9 information from Library resource images but Im not sure how this works correctly.
I tried this command:
aapt crunch -v -S res -C bin/res
It works with my .9.png files but I still dont get it how I can run it, that it creates the .apk file. How can I use it in the following command ?
aapt package -v -f -A \assets -M \AndroidManifest -S \res -I \android.jar -F \Projectname.unsigned.apk \bin
Just this command gives me the following error:
activity_settings.xml:2: error: Error: No resource found that matches the given name (at 'sound' with value '#drawable/btn_sound_active_pressed')
This file is an .9.png file.
With eclipse everything runs fine.
So i figured it out: I have to "crunch" all picture in the res folder first:
aapt crunch -v -S \res -C \bin\res
And then I pointed as a source folder to the res dir and to the bin\res dir. Also added --no-chrunch --generate-dependencies
aapt package --no-crunch --generate-dependencies -v -f
-M \AndroidManifest.xml"
-S \bin\res
-S \res
-A \assets
-I \android.jar
-F \bin\APPNAME.unsigned.apk \bin
Now Its working perfectly. Also with the .9.png 9patch pictures.

PintOS, kernel panic with -v option bochs on ubuntu

when i do "pintos -- run alarm-multiple" in .../build/ everything seems fine.
but when i do "make check" in .../build/ all 7 tests failed with the same
"Run didn't start up properly: no "pintos booting" message"
pintos -v -k -T 60 --bochs -- -q run alarm-single < /dev/null 2> tests/threads/alarm-single.errors > tests/threads/alarm-single.output
perl -I../.. ../../tests/threads/alarm-single.ck tests/threads/alarm-single tests/threads/alarm-single.result
FAIL tests/threads/alarm-single
Run didn't start up properly: no "Pintos booting" message
then I discovered "pintos -v -k -T 60 --bochs -- -q run alarm-single" in .../build
it gives a
Bochs is exiting with the following message:
[ ] bochsrc.txt:12: display library 'nogui' not available
if I take away the "-v" it will be fine.
How to fix this
display library 'nogui' not available
Nobody seems to answer me... I got that myself at last.
just need to change the bochs's configure : ./configer --with-nogui
and then compile it again:
make
sudo make install
After that pintos's make check will work.
i had same problem and i solved it.
open "/pintos/src/tests/Make.tests"
edit line 54 (delete -v)
TESTCMD = pintos -v -k -T $(TIMEOUT)
then, in "/threads/build" you can do
make check
Remember when you using Ubuntu 14.04 or 16.04, never forget doing such things when you download original pintos project or any pintos project from Github.
(Any line with no parentheses are terminal commands)
cd ~
gedit .bashrc
(add next line to the final of the file)
{export PATH="$PATH:/home/{username}/pintos/src/utils"}
(save)
bash
cd ~/pintos/src/utils
gedit Makefile
(You need to change one line)
{change LDFLAGS = -lm to LDLIBS = -lm}
(save)
make
Then you can compile and run "make check" for pintos with no error.
(Any ~/pintos should be changed to your pintos path)
Remember final make in ~/pintos/src/utils is ridiculously important. Otherwise you will get "Run didn't start up properly: no "Pintos booting" message".
You can check full version here. http://www.luosheng-parallelbgls.com.cn/2016/03/29/pintos-install/
Cause this is a Chinese version, I would appreciate for anyone who can translate it to English.

UIAutomation : Failed to authorize rights with status: -60007

So I am running UIAutomation on command line with
$ instruments -t /Developer/Platforms/iPhoneOS.platform/Developer/Library/Instruments/PlugIns/AutomationInstrument.bundle/Contents/Resources/Automation.tracetemplate
<path-to-your-app>/<appname>.app/ -e UIASCRIPT <path-to-your-js-test-file> -e
UIARESULTSPATH <path-to-results-folder>
This works fine and the simulator opens up, and the app runs, but gets stuck with this error.
Failed to authorize rights (0x2) with status: -60007
I believe it has something to do with the permissions.
How do I go about this ?
That's the answer I posted at Instruments via command line - jenkins
And here is even a blog post about Xcode command line authorization prompt error
I will explain it again here:
What I did was the following:
Mark jenkins user as admin (unfortunately it seems that there is no other way atm)
Go to /etc/authorization
search for key system.privilige.taskport
change value of allow-root to true
<key>system.privilege.taskport</key>
<dict>
<key>allow-root</key>
<false/> // change to -> <true>
<key>class</key>
<string>user</string>
<key>comment</key>
<string>Used by task_for_pid(...).
...
</dict>
Now I am being able to use jenkins to run my UIAutomation-Tests via Command Line Script
EDIT
To make jenkins recognize a successfull build, I have not a perfect solution but the following workaround:
...
echo "Run instruments simulator"
instruments -t "$ORDER_AUTOMATION_TEST_TEMPLATE_PATH" "$FILE_DEBUG_APP" -e UIASCRIPT "$ORDER_AUTOMATION_TESTSCRIPT_PATH" -e UIARESULTSPATH "$DIRECTORY_INSTRUMENTS_RESULT"
returnCode=0
if test -a "Run 1/Assertion failed.png"; then
echo "failed"
returnCode=1
else
echo "passed"
returnCode=0
fi
rm -fR "Run 1"
rm -fR "instrumentscli0.trace"
echo "Removing app dir"
echo "$FILE_APPLICATIONS"
rm -fR "$FILE_APPLICATIONS"
echo $returnCode
exit $returnCode
EDIT 2
Better way to check if automation test did run successfully:
# cleanup the tracefiles produced from instruments
rm -rf *.trace
##kill simulator afterwards
killall "iPhone Simulator"
##check if failures occured
# fail script if any failures have been generated
if [ `grep "<string>Error</string>" "$WORKSPACE/Automation Results/Run 1/Automation Results.plist" | wc -l` -gt 0 ]; then
echo 'Build Failed'
exit -1
else
echo 'Build Passed'
exit 0
fi
This can help on Mavericks and Yosemite: (based on Alexander's answer)
$ security authorizationdb write system.privilege.taskport allow