That's what I tried to do and was pretty sure it would solve this issue. But, it didn't.
Maybe the "upgrader_process_complete" isn't the right hook in this case. This is the code I used:
function do_rewrites() {
flush_rewrite_rules();
}
add_action( 'after_switch_theme', 'do_rewrites' )...