As @belorn noted [3], the prosecutors had 3 options, and given it seems like they didn't have enough to make a case or a plan to continue the investigation, it had to be dropped.
Also note, that the UN has sided with Assange. As the confinement in the Embassy is confinement. And he's been unjustly confined for a longer period than the maximum penalty for rape in Sweden [4].
[1] http://www.reuters.com/article/us-ecuador-sweden-assange-idU...
[2] "He has offered to be questioned inside the embassy but the Swedish prosecutors only recently agreed." http://www.telegraph.co.uk/news/2016/08/11/ecuador-to-let-sw...