# Class InvalidModelException

java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.gradle.api.GradleException
org.gradle.platform.base.InvalidModelException

All Implemented Interfaces:
  `Serializable`

@Incubating @Deprecated public class InvalidModelException extends GradleException
Deprecated.
The Gradle software model is deprecated and will be removed in Gradle 10. Use the new component model (e.g. `cpp-application`, `cpp-library`, `swift-application`, `swift-library`, `xctest`) instead.
Thrown when a component model is declared in an invalid way.

Since:
  2.4
See Also:
  - Serialized Form

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `InvalidModelException(String message)`
  Deprecated.
  Creates a new `InvalidModelException`.
  `InvalidModelException(String message, Exception cause)`
  Deprecated.
  Creates a new `InvalidModelException`.

- ## Method Summary

  ### Methods inherited from class Throwable

  `addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString`

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### InvalidModelException

    public InvalidModelException(String message)
    Deprecated.
    Creates a new `InvalidModelException`.
    Since:
      2.4

  - ### InvalidModelException

    public InvalidModelException(String message, Exception cause)
    Deprecated.
    Creates a new `InvalidModelException`.
    Since:
      2.4