Finished with error: Gradle task assembleDebug failed with exit code 1

recently encountered the following bug during development with flutter :

during run,

Finished with error: Gradle task assembleDebug failed with exit code 1

at this point if you are in a hurry to pack for someone else, you can scan with flutter clean and then re-run. The first time always succeeds,

then, after the first run, the error will continue.

you can’t just flutter clean all the time and then run, that would be a waste of time, not a long-term solution.

———————————————–

according to the above line of error Google has encountered many similar situations, but the reasons for the error are different, and I did not see the possibility of

is the same reason that I’m in this situation,

———————

but the answer is that running the flutter run-v will give you more detailed information about the error, but still not much use.

the information obtained from the flutter run-v does not locate the cause of the error.

flutter as a new cross-platform solution is really a pitfall, but the problem will always be solved and the project will continue to be done,

————–

then began to think, until the day before yesterday off work or not this situation, yesterday since noon had this problem, so

Can

find clues in git’s commit records?

——————————–

then starts to look through the Git commit record of this period and finds a suspicious

import 'package:inin/features/searchpage/SearchUserPage.dart%20';

Is there an extra %20 after

?

————————

so delete this line, flutter clean, re-run, the problem finally does not appear.

solved the case…

Read More: