close

[Fixed] Error: A non-null value must be returned since the return type ‘Never’ doesn’t allow null

Today We are Going To Solve Error: A non-null value must be returned since the return type ‘Never’ doesn’t allow null in flutter. Here we will Discuss All Possible Solutions and How this error Occurs So let’s get started with this Article.

How to Fix Error: A non-null value must be returned since the return type ‘Never’ doesn’t allow null Error?

  1. How to Fix Error: A non-null value must be returned since the return type ‘Never’ doesn’t allow null Error?

    To Fix Error: A non-null value must be returned since the return type ‘Never’ doesn’t allow null Error just Use the lower version of firebase_auth. You have to upgrade the dart version or just use the lower version of firebase_auth. You can use the below command: firebase_auth: 2.0.0 It will help you.

  2. Error: A non-null value must be returned since the return type ‘Never’ doesn’t allow null

    To Fix Error: A non-null value must be returned since the return type ‘Never’ doesn’t allow null Error just Change to ext.kotlin_version. First of all, upgrade to the new flutter version. Open Command Prompt and run this command. flutter upgrade Now just Go to android/build.gradle and just change to ext.kotlin_version = '1.6.10' And after it Go to android/app/build.gradle and change minSdkVersion to 19 and just add multiDexEnabled true. By doing this you can solve your error. try this.

Solution 1 : Use the lower version of firebase_auth

You have to upgrade the dart version or just use the lower version of firebase_auth. You can use the below command:

  firebase_auth: 2.0.0

It will help you.

Solution 2 : Change to ext.kotlin_version

First of all, upgrade to the new flutter version. Open Command Prompt and run this command.

flutter upgrade

Now just Go to android/build.gradle and just change to ext.kotlin_version = ‘1.6.10’

And after it Go to android/app/build.gradle and change minSdkVersion to 19 and just add multiDexEnabled true.

By doing this you can solve your error. try this.

Conclusion

So these were all possible solutions to this error. I hope your error has been solved by this article. In the comments, tell us which solution worked? If you liked our article, please share it on your social media and comment on your suggestions. Thank you.

Also Read These Solutions

Leave a Comment