Solution 1:

Like the others have mentioned you must follow these rules in order for it to work:

  1. Have high friendship - I make mine hold a Soothe Bell and give it some berries that boost friendship, however these can also lower the stats.
  2. Level Up during the day - This is between 10am and 6pm (Check your 3DS clock), however DO NOT change the time as that will stop all timed events for 24 hours.

If you follow those rules your Riolu shall evolve into Lucario. :)

Solution 2:

If you have high enough friendship it should evolve when leveled up, but the part you are missing is that it needs to be day. Other than that, I don't know.