hasen's tech life

Twitter: @hasen

Djangoで SyntaxError: non-default argument follows default argument というエラーが出たので対応した.

# Djangoで SyntaxError: non-default argument follows default argument というエラーが出たので対応した.

> SyntaxError: non-default argument follows default argument

> 途中で引数にデフォルト値がついているものがあったので,削除.
$ vi hoge.py
aaa,
--- bbb=BBB,
+++ bbb,
ccc,

Djangoで got an unexpected keyword argument 'pk' というエラーが出たので対応した.

# Djangoで got an unexpected keyword argument 'pk' というエラーが出たので対応した.

> got an unexpected keyword argument 'pk'

$ vi hoge.py
-- def deta(request):
++ def data(request, pk)

Shenzhenでipa buildをするとエラーが出たので対応した.

# Shenzhenでipa buildをするとエラーが出たので対応した.

$ ipa build
> xcodebuild AnyStudio.xcworkspace
> 11-12 14:38:25.515 xcodebuild[89662:4051767] WARNING: Failed to load plugin at path: "/PATH/TO/Application Support/Developer/Shared/Xcode/Plug-ins/Alcatraz.xcplugin", skipping. Error: Error Domain=NSCocoaErrorDomain Code=3587 "dlopen_preflight(/PATH/TO/Application Support/Developer/Shared/Xcode/Plug-ins/Alcatraz.xcplugin/Contents/MacOS/Alcatraz): no suitable image found. Did find:
> /PATH/TO/Application Support/Developer/Shared/Xcode/Plug-ins/Alcatraz.xcplugin/Contents/MacOS/Alcatraz: code signing blocked mmap() of '/PATH/TO/Application Support/Developer/Shared/Xcode/Plug-ins/Alcatraz.xcplugin/Contents/MacOS/Alcatraz'" UserInfo={NSLocalizedFailureReason=The bundle is damaged or missing necessary resources., NSLocalizedRecoverySuggestion=Try reinstalling the bundle., NSFilePath=/PATH/TO/Application Support/Developer/Shared/Xcode/Plug-ins/Alcatraz.xcplugin/Contents/MacOS/Alcatraz, NSDebugDescription=dlopen_preflight(/PATH/TO/Application Support/Developer/Shared/Xcode/Plug-ins/Alcatraz.xcplugin/Contents/MacOS/Alcatraz): no suitable image found. Did find:
> /PATH/TO/Application Support/Developer/Shared/Xcode/Plug-ins/Alcatraz.xcplugin/Contents/MacOS/Alcatraz: code signing blocked mmap() of '/PATH/TO/Application Support/Developer/Shared/Xcode/Plug-ins/Alcatraz.xcplugin/Contents/MacOS/Alcatraz', NSBundlePath=/PATH/TO/Application Support/Developer/Shared/Xcode/Plug-ins/Alcatraz.xcplugin, NSLocalizedDescription=The bundle “Alcatraz” couldn’t be loaded because it is damaged or missing necessary resources.}
> xcrun PackageApplication
> xcrun: error: unable to find utility "PackageApplication", not a developer tool or in PATH

# PackageApplicationがXCode8にないことが原因.(v7, v8をそれぞれXCode7, XCode8として使っている)
$ cp /Applications/Xcode7.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/PackageApplication /Applications/Xcode8.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/

$ ipa build

参考: xcrun: error: unable to find utility “PackageApplication”, not a developer tool or in PATH - Since updating xCode

React Nativeでエラーが出たので対応した.

# React Nativeでエラーが出たので対応した.
$ react-native run-ios
> Latest react-native app doesn't work ":CFBundleIdentifier", Does Not Exist

# NodeJSをv8.8.1にアップデート.
$ nodebrew install-binary v8.8.1
$ nodebrew use v8.8.1
$ npm install -g react-native react-native-cli
$ react-native run-ios

参考: https://github.com/facebook/react-native/issues/7308

Swiftでリソースが接続できなかったので対応した.

# Swiftでリソースが接続できなかったので対応した.

> could not insert new outlet connection could not find any information for the class named

# XCodeを再度開き直すと,エラーが表示されなくなった.