エラー:「デフォルト」という名前の構成が見つかりません。解決



Error Configuration With Namedefaultnot Found



今日、プロジェクトElmBusinessをgithubにインポートすると、次のエラーが報告されました。

Configuration with name 'default' not found

情報を参考にしたところ、gradleの設定が間違っていたためです。このプロジェクトは、次の方法で単独で正常に解決されました。

1. Delete the include'library' in the setting.gradle file

画像



2. Delete project(':library') in the app.gradle file

画像

3. Then compile and pass

================================================= = =====



1.エラーの原因

主に、空のモデル(ここではライブラリ)がアプリモデルで参照されているためです。これは、プロジェクトにモデルがまったくないためです:ライブラリ

1.1 How to check the models (meaning of projects) in your project, the files in the project view correspond to the folders in the computer one to one. There is no one-to-one correspondence under the android view. As shown in the figure below: In the android view: There are 8 models with bold fonts. It is easy to identify, each model must correspond to a gradle file, and there is also a project gradle file.

画像

In the project view, you can also see that there are 8 models (blue and bold)

画像



この例では、最初に次の図を見てください。
画像

プロジェクトにライブラリモデルがないため、存在しないモデルがapp.gradleファイルで参照されていることがわかります。これは間違っているので、app.gradleの間違った依存関係を削除する必要があります。もう1つは、setting.gradleファイルに空のライブラリが含まれているため、間違ったインクルードコードを削除する必要があることです。

注:プロジェクト内のすべてのモデルはsetting.gradleファイルに含まれ、存在しない一部のモデルは含めることができません。に
画像