Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot convert an object of type Array{Any,1} to an object of type String #26

Closed
nw11 opened this issue Nov 8, 2018 · 3 comments
Closed

Comments

@nw11
Copy link

nw11 commented Nov 8, 2018

When running:

GoogleCloud.JSONCredentials("/home/nick/credentials.json")

I get the following error message.

ERROR: MethodError: Cannot `convert` an object of type Array{Any,1} to an object of type String
Closest candidates are:
  convert(::Type{String}, ::Symbol) at deprecated.jl:53
  convert(::Type{String}, ::Array{UInt8,1}) at deprecated.jl:53
  convert(::Type{String}, ::AbstractArray{Char,1}) at deprecated.jl:53
  ...
Stacktrace:
 [1] setindex!(::Dict{Symbol,String}, ::Array{Any,1}, ::Symbol) at ./dict.jl:381
 [2] parse_object(::JSON.Parser.ParserContext{Dict{Symbol,String},Int64}, ::JSON.Parser.MemoryParserState) at /home/nick/.julia/packages/JSON/Hs3Dj/src/Parser.jl:223
 [3] parse_value(::JSON.Parser.ParserContext{Dict{Symbol,String},Int64}, ::JSON.Parser.MemoryParserState) at /home/nick/.julia/packages/JSON/Hs3Dj/src/Parser.jl:164
 [4] parse_object(::JSON.Parser.ParserContext{Dict{Symbol,String},Int64}, ::JSON.Parser.MemoryParserState) at /home/nick/.julia/packages/JSON/Hs3Dj/src/Parser.jl:221
 [5] parse_value(::JSON.Parser.ParserContext{Dict{Symbol,String},Int64}, ::JSON.Parser.MemoryParserState) at /home/nick/.julia/packages/JSON/Hs3Dj/src/Parser.jl:164
 [6] #parse#1(::Type, ::Type{Int64}, ::Function, ::String) at /home/nick/.julia/packages/JSON/Hs3Dj/src/Parser.jl:392
 [7] (::getfield(JSON.Parser, Symbol("#kw##parse")))(::NamedTuple{(:dicttype, :inttype),Tuple{DataType,DataType}}, ::typeof(JSON.Parser.parse), ::String) at ./none:0
 [8] (::getfield(JSON.Parser, Symbol("##4#5")){DataType,DataType,Bool,Int64})(::IOStream) at /home/nick/.julia/packages/JSON/Hs3Dj/src/Parser.jl:415
 [9] #open#298(::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Function, ::getfield(JSON.Parser, Symbol("##4#5")){DataType,DataType,Bool,Int64}, ::String) at ./iostream.jl:369
 [10] open at ./iostream.jl:367 [inlined]
 [11] #parsefile#3 at /home/nick/.julia/packages/JSON/Hs3Dj/src/Parser.jl:413 [inlined]
 [12] #parsefile at ./none:0 [inlined]
 [13] JSONCredentials(::String) at /home/nick/.julia/packages/GoogleCloud/EjsR6/src/credentials.jl:118
 [14] top-level scope at none:0

This is for Julia 0.7.0 - working off master branch, as current release doesn't precompile successfully.
I get a similar error message using Julia 0.6.4.

@xiuliren
Copy link
Contributor

did you update the new release?
try again?

@JockLawrie
Copy link
Contributor

Just tried this on master.
It works without any errors (on Linux).

@xiuliren
Copy link
Contributor

ok, close here.
please reopen if you still have this error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants