Argument type NSURL does not conform
<p>I am working from an old tutorial swift2, Alamofire 3, but I am using swift 3, Alamofire 4.</p>

<p>I have changed most things successfully,  but I am running into a problem.
with this code area.</p>

<pre><code>let url = NSURL(string: _pokemonUrl)!
        Alamofire.request(url).responseJSON { response in
            let result = response.result
</code></pre>

<p>I am getting an error that says: </p>

<blockquote>
  <p>Argument type NSURL does not conform to expected type
  URLRequestConvertible.</p>
</blockquote>

<p>it does give me the option of adding in as! URLRequestConvertible after the (url) but it crashes again after compile and when i press the button to get the info. it gives an error of: </p>

<blockquote>
  <p>Could not cast value of type 'NSURL' (0x117e99338) to
  'Alamofire.URLRequestConvertible' (0x1189ab120).</p>
</blockquote>

<p>if I change NSURL to Url then it moves forward in the code but when it gets to the print statement it crashes and gives the error:</p>

<blockquote>
  <p>fatal error: unexpectedly found nil while unwrapping an Optional value</p>
</blockquote>

<p>here is that code below.</p>

<pre><code>let url = URL(string: _pokemonUrl)!
        Alamofire.request(url).responseJSON { response in
            let result = response.result



            if let dict = result.value as? Dictionary&lt;String, AnyObject&gt; {

                if let weight = dict["weight"] as? String {
                    self._weight = weight
                }

                if let height = dict["height"] as? String {
                    self._height = height
                }

                if let baseAttack = dict["attack"] as? Int {
                    self._baseAttack = "\(baseAttack)"
                }



                if let defense = dict["defense"] as? Int {
                    self._defense = "\(defense)"
                }


                print(self._weight)
                print(self._height)
                print(self._baseAttack)
                print(self._defense)
</code></pre>

<p>I have tried to change all to Int but i get the same error.</p>

<p>Can anyone shed any light on this for me.</p>

<p>if it helps I put a break point in after print("Here") in the next code and it gives me the following error.</p>

<pre><code>let url = URL(string: _pokemonUrl)!
        Alamofire.request(url).responseJSON { response in
            let result = response.result

            print(result.value.debugDescription)
            print("Here")
</code></pre>

<p>error comes up:</p>

<blockquote>
  <p>Optional({
      "error_message" = "Sorry, this request could not be processed. Please try again later.";
  })
  Here</p>
</blockquote>

<p>Thanks in advance,
Tony</p>