Only the 2nd is acceptable. 'Attempt' is a countable noun. attempt noun n [C]
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.
The first option works if you add -ing. "In attempting to" or "as a consequence of attempting...".