Update to Alamofire 4.0 and Swift 3.0 via Carthage - alamofire

I am trying to update Alamofire to version 4.0. When I run carthage update I get many errors when building Alamofire scheme. It looks like files weren't updated to Swift 3.0 syntax. What I am doing wrong? Log from terminal:
*** Checking out Alamofire at "4.0.0"
*** xcodebuild output can be found in /var/folders/ls/6t_b5mqx5s187hq2dtts6ys00000gn/T/carthage-xcodebuild.ORghi2.log
*** Building scheme "Alamofire watchOS" in Alamofire.xcworkspace
/Users/liborzapletal/Documents/Aplikace/PNG/PNG/Carthage/Checkouts/Alamofire/Source/NetworkReachabilityManager.swift:36:1: error: expressions are not allowed at the top level
/Users/liborzapletal/Documents/Aplikace/PNG/PNG/Carthage/Checkouts/Alamofire/Source/NetworkReachabilityManager.swift:36:5: error: consecutive statements on a line must be separated by ';'
/Users/liborzapletal/Documents/Aplikace/PNG/PNG/Carthage/Checkouts/Alamofire/Source/NetworkReachabilityManager.swift:74:5: error: expected declaration
/Users/liborzapletal/Documents/Aplikace/PNG/PNG/Carthage/Checkouts/Alamofire/Source/NetworkReachabilityManager.swift:74:9: error: consecutive declarations on a line must be separated by ';'
/Users/liborzapletal/Documents/Aplikace/PNG/PNG/Carthage/Checkouts/Alamofire/Source/NetworkReachabilityManager.swift:77:5: error: expected declaration
/Users/liborzapletal/Documents/Aplikace/PNG/PNG/Carthage/Checkouts/Alamofire/Source/NetworkReachabilityManager.swift:77:9: error: consecutive declarations on a line must be separated by ';'
/Users/liborzapletal/Documents/Aplikace/PNG/PNG/Carthage/Checkouts/Alamofire/Source/NetworkReachabilityManager.swift:80:5: error: expected declaration
/Users/liborzapletal/Documents/Aplikace/PNG/PNG/Carthage/Checkouts/Alamofire/Source/NetworkReachabilityManager.swift:80:9: error: consecutive declarations on a line must be separated by ';'
/Users/liborzapletal/Documents/Aplikace/PNG/PNG/Carthage/Checkouts/Alamofire/Source/NetworkReachabilityManager.swift:83:5: error: expected declaration
/Users/liborzapletal/Documents/Aplikace/PNG/PNG/Carthage/Checkouts/Alamofire/Source/NetworkReachabilityManager.swift:83:9: error: consecutive declarations on a line must be separated by ';'
/Users/liborzapletal/Documents/Aplikace/PNG/PNG/Carthage/Checkouts/Alamofire/Source/NetworkReachabilityManager.swift:89:5: error: expected declaration
/Users/liborzapletal/Documents/Aplikace/PNG/PNG/Carthage/Checkouts/Alamofire/Source/NetworkReachabilityManager.swift:89:9: error: consecutive declarations on a line must be separated by ';'
/Users/liborzapletal/Documents/Aplikace/PNG/PNG/Carthage/Checkouts/Alamofire/Source/NetworkReachabilityManager.swift:92:5: error: expected declaration
....... and many others
I am using carthage version 0.18. I tried delete carthage Build and Checkout folders. I have set Xcode 8 version as default. For now without any luck.

The problem was that in terminal default Xcode was still 7. I checked it by command:
xcodebuild -version
which returns:
Xcode 7.3
Build version 7D175
In system it looks like default is Xcode 8.0 but not in terminal. So I use command:
sudo xcode-select -switch /Applications/Xcode\ 8.app/
And now it's working.

Related

Command for generating bundle installer not working

While following the Oro documentation for generating an installer for my bundle
I get the following error when using the oro:migration:dump --bundle=MyBundle command:
In schema-template.php.twig line 38:
Unexpected token "name" of value "table" ("end of statement block"
expected).
Is this a known issue or am I missing something?

Flow generates many errors for new project

Flow seems to generate a lot of errors on a new project. What am I doing wrong ?
What I did:
Created a new React Native project using react-native init FlowProject
Followed the set-up for Flow with yarn and Babel
yarn add --dev babel-cli babel-preset-flow
yarn add --dev flow-bin
Ran yarn run flow (.flowconfig was generated by the init)
Here is the error I get:
.flowconfig:53 Unsupported option specified! (unsafe.enable_getters_and_setters)
error Command failed with exit code 8.
Now if I remove the specified line (and version number), I get a bunch of these two errors:
Error: node_modules/react-native/Libraries/Inspector/Inspector.js:104
104: clearTimeout(_hideWait);
^^^^^^^^^ null. This type is incompatible with the expected param type of
733: declare function clearTimeout(timeoutId?: TimeoutID): void;
^^^^^^^^^ TimeoutID. See lib: /private/tmp/flow/flowlib_171966cc/core.js:733
Error: node_modules/react-native/Libraries/Lists/VirtualizedList.js:1094
1094: this.props.onEndReachedThreshold * visibleLength / 2;
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ undefined. The operand of an arithmetic operation must be a number.
Found 19 errors
error Command failed with exit code 2.
If I delete the generated .flowconfig file (see at the end), recreate it with yarn run flow init, and run yarn run flow again, I get the following errors (I'm just showing those 5, most of them were similar to each other):
Error: node_modules/react-native/Libraries/Animated/src/AnimatedEvent.js:101
101: if (__DEV__) {
^^^^^^^ __DEV__. Could not resolve name
Error: node_modules/react-native/Libraries/Inspector/Inspector.js:104
104: clearTimeout(_hideWait);
^^^^^^^^^ null. This type is incompatible with the expected param type of
733: declare function clearTimeout(timeoutId?: TimeoutID): void;
^^^^^^^^^ TimeoutID. See lib: /private/tmp/flow/flowlib_15451c3f/core.js:733
Error: node_modules/react-native/Libraries/Interaction/InteractionManager.js:107
107: return promise.done(...args);
^^^^^^^^^^^^^^^^^^^^^ call of method `done`. Function cannot be called on
107: return promise.done(...args);
^^^^^^^^^^^^^^^^^^^^^ property `done` of unknown type
Error: node_modules/react-native/Libraries/Interaction/TaskQueue.js:165
165: .done();
^^^^ property `done`. Property not found in
v---------
152: task.gen()
153: .then(() => {
154: DEBUG && infoLog(
...:
164: })
-^ Promise
Error: node_modules/react-native/Libraries/Lists/VirtualizedList.js:1016
1016: distanceFromEnd < onEndReachedThreshold * visibleLength &&
^^^^^^^^^^^^^^^^^^^^^ undefined. The operand of an arithmetic operation must be a number.
... 16 more errors (only 50 out of 66 errors displayed)
To see all errors, re-run Flow with --show-all-errors
error Command failed with exit code 2.
Now I know that I can tell flow to ignore certain files, but first, it seems weird to me that flow gives me these errors for code that I have not produced. I've also seen on a github issue that we shouldn't tell flow to ignore the node_modules. So is the solution to ignore every single file that this first flow analysis gives us ?
Here's a list of the files concerned:
Error node_modules/react-native/Libraries/Inspector/Inspector.js:
Error node_modules/react-native/Libraries/Interaction/InteractionManager.js
Error node_modules/react-native/Libraries/Lists/FlatList.js
Error node_modules/react-native/Libraries/Lists/ViewabilityHelper.js
Error node_modules/react-native/Libraries/Lists/VirtualizedList.js
Error node_modules/react-native/Libraries/Lists/VirtualizedSectionList.js
Error node_modules/react-native/Libraries/StyleSheet/flattenStyle.js
Generated .flowconfig file
[ignore]
; We fork some components by platform
.*/*[.]android.js
; Ignore "BUCK" generated dirs
<PROJECT_ROOT>/\.buckd/
; Ignore unexpected extra "#providesModule"
.*/node_modules/.*/node_modules/fbjs/.*
; Ignore duplicate module providers
; For RN Apps installed via npm, "Libraries" folder is inside
; "node_modules/react-native" but in the source repo it is in the root
.*/Libraries/react-native/React.js
; Ignore polyfills
.*/Libraries/polyfills/.*
; Ignore metro
.*/node_modules/metro/.*
[include]
[libs]
node_modules/react-native/Libraries/react-native/react-native-interface.js
node_modules/react-native/flow/
node_modules/react-native/flow-github/
[options]
emoji=true
module.system=haste
munge_underscores=true
module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> 'RelativeImageStub'
module.file_ext=.js
module.file_ext=.jsx
module.file_ext=.json
module.file_ext=.native.js
suppress_type=$FlowIssue
suppress_type=$FlowFixMe
suppress_type=$FlowFixMeProps
suppress_type=$FlowFixMeState
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError
unsafe.enable_getters_and_setters=true
[version]
^0.61.0
You cannot delete the React Native .flowconfig, because it defines a lot of custom configuration required for the project to typecheck cleanly.
Let's instead look at the initial error:
.flowconfig:53 Unsupported option specified! (unsafe.enable_getters_and_setters)
error Command failed with exit code 8.
This is caused by the version of Flow you installed with yarn add flow-bin no longer supporting this option (It was removed in 0.62). You'll need to install the exact version of Flow defined on the last line of your .flowconfig
[version]
^0.61.0
You can do this with:
yarn add flow-bin#0.61
Now the project should type check correctly.
Note that in the future, if you upgrade your project template with react-native upgrade and you accept the changes to .flowconfig, you may need to manually upgrade your flow-bin dependency to match.
Found this semi-related issue which recommended updating the flowconfig to use the latest version from create-react-native-app. Seems to have worked for me.
Go to .flowconfig file in your root project folder.
Delete this lines:
esproposal.optional_chaining=enable
esproposal.nullish_coalescing=enable
Done!

Configuring Erlang plugin for Intellij

I am trying to set-up an Erlang project in IntelliJ 15. I am running windows.
I have built Rebar. trying escript.exe "//rebar_path//" --version returns the version number. Erlang also works on command line. In Settings->Other-settings->Erlang External tools I have the address of rebar file and IntelliJ detects the version number alright.
For my hello-world Erlang App, I have added an Erlang console application which runs fine and gives me
D:/Program Files/erl7.2.1\bin\erl" -pa E:/Documents/Projects/Erlang_test/out/production/Erlang_test -pa E:/Documents/Projects/Erlang_test
at the top. However attempting to call the functions gives me:
exception error: undefined function hello:hello2/0
It's as if compilation does not happen. I also tried setting up an "Erlang Rebar" Run configuration with compile as the command. It outputs:
*"D:\Program Files\erl7.2.1\bin\escript.exe"
E:\Documents\Projects\rebar_source\rebar c*
at the top, followed by the error:
escript: Error executing 'D:\Program': 193
What am I doing wrong?
update: I tried adding the rebar.cmd as an external tool to run it before the run configuration. After doing some research, I tried adding a rebar.config file with:
{sub_dirs, ["src" ] }.
to match the project structure.
Running the tool with compile on its own outputs: (configuration page screenshot)
==>src (compile)
==> Erlang_test (compile)
I was expecting to get: Compiled src/hello.erl but I neither get that, nor do I see any bean files created anywhere; and if I try running hello:hello() in the "Erlang console" run configuration gives me:
exception error: undefined function hello:hello2/0

ANTRL4: TestRig error

I am just trying to get ANTLR to run following those instructions: http://www.antlr.org/wiki/display/ANTLR4/Getting+Started+with+ANTLR+v4
The grammar is translated into code, but when I want to call TestRig, I'm getting the error "Can't load Hello as lexer or parser".
TestRig is located in file C:\bin\grun.cmd and contains this command
java -cp .;C:\LIBS\Java\ANTLR\antlr-4.1-complete.jar
org.antlr.v4.runtime.misc.TestRig %1 %2
Is anything wrong with that?
When I try to start TestRig from the ANTLWorks IDE I'm receiving warnings like:
warning: Supported source version 'RELEASE_6' from annotation
processor
'org.netbeans.modules.openide.modules.PatchedPublicProcessor' less
than -source '1.7'
warning: Supported source version 'RELEASE_6' from
annotation processor
'org.netbeans.modules.openide.util.ServiceProviderProcessor' less than
-source '1.7'
warning: Supported source version 'RELEASE_6' from annotation processor
'org.netbeans.modules.openide.util.NamedServiceProcessor' less than
-source '1.7'
warning: Supported source version 'RELEASE_6' from annotation processor
'org.netbeans.modules.openide.util.NbBundleProcessor' less than
-source '1.7'
and errors like:
line 1:7 token recognition error at: ' '
...........
line 1:0 missing 'hello' at 'grammar'
On Linux I'm experiencing another problem with ANTLRWorks2:
For whatever reason the menu bar doesn't work so that it's impossible to select anything from there. Anyway, clicking on an icon below the menu bar works.
What might be wrong here? Thanks for any help.
Almost a year late on this but in case others have the issue...
I am guessing you named your grammar file 'hello' instead of 'Hello' or you didn't copy the contents correctly.
https://theantlrguy.atlassian.net/wiki/display/ANTLR4/Getting+Started+with+ANTLR+v4
The warnings about 'RELEASE_6' are supposedly harmless according to this bug report.
https://netbeans.org/bugzilla/show_bug.cgi?id=210286
I am still getting these warnings in ANTLRWorks2.1. According to the final post it may be fixed in the NetBeans plugin. However, as far as I can tell this plugin has been recently broken.
I can't help you with IDE issues on Linux.

I am using a previous app but getting error in UIResponder.h

I am using a app of previous developer ,but when i compile it ,ig shows 5 errors at UIResponder.h and UIEvent.h
error 1:
file/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIEvent.h:38:0 /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIEvent.h:38: error: expected ':' before ';' token
error2:
/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIResponder.h:15:0 /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIResponder.h:15: error: expected ')' before 'UIResponder'
error 3:
/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIResponder.h:17:0 /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIResponder.h:17: error: expected '{' before '-' token
error4:
/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIResponder.h:42:0 /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIResponder.h:42: warning: '#end' must appear in an #implementation context
error5:
/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIResponder.h:58:0 /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIResponder.h:58: error: cannot find interface declaration for 'UIResponder'
Once check in which version of iPhone OS you are installing your App. Once check the targets and change the base sdk and deployment sdk as required.
Try by removing all the linked frameworks and link from your library.
Remove all the frameworks used in the application. Add back all the frameworks and do a clean build of the application. This might help.