sort apps by version, so newest is chosen if it passes constraints