Step 1: Why one-sided options fail
A barrier needs charges of both signs on either side of the junction to produce a field between them. Options (A), (B) and (C) mention only one kind of charge.
Step 2: Pick the option
Option (D) includes both positive and negative charges next to the junction, and this is what sets up the built-in potential.
Step 3: Result
The barrier is due to the fixed ions of both signs near the junction, which is option (D).
Final Answer:
The barrier comes from the build-up of both positive and negative charges, so option (D) is correct.
\[ \boxed{\text{(D) }\text{accumulation of positive and negative charges near the junction}} \]