React native Configuration with name 'default' not found.

添加插件后出现异常

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':app'.
> Could not resolve all dependencies for configuration ':app:_debugApk'.
   > Configuration with name 'default' not found.

  解决方案是:

react-native upgrade

更新代码