Lacking Foreign Language Credits in Highschool

I want to apply to Ivy-league schools; everything is good except for one problem - I have no foreign language classes and I’m in my Junior year.
Could I take an online German class for 1 credit, and then take German II Senior year to have 2 language credits? Or is 2 credits still lacking? I lived in Switzerland for a few years in my youth and speak German fluently, so would these schools accept me passing some large German final without ever taking the classes, or is it essentially a requirement to earn the credits?

For Stanford and the Ivies four years of a language are recommended but not absolutely required. Being bilingual should fulfill the goals of that recommendation in spirit. Perhaps you should try to take the highest level German class offered at your school, then sit for the German AP exam.

Thank you, I think that is a smart choice. My school offers German AP, I’ll schedule that