I’ve a sample wich works on 2.11 and before.
task doRun << {
Thread.UncaughtExceptionHandler uncaughtExceptionHandler = new Thread.UncaughtExceptionHandler() {
@Override
void uncaughtException(Thread thread, Throwable e) {
// do something smart
}
};
}
task wrapper(type: Wrapper) {
gradleVersion '2.11'
}
when migrating to 2.12
task doRun << {
Thread.UncaughtExceptionHandler uncaughtExceptionHandler = new Thread.UncaughtExceptionHandler() {
@Override
void uncaughtException(Thread thread, Throwable e) {
// do something smart
}
};
}
task wrapper(type: Wrapper) {
gradleVersion '2.12'
}
the build fails with the following message:
FAILURE: Build failed with an exception.
* Where:
Build file 'C:\Projekte\test\build.gradle' line: 4
* What went wrong:
Could not compile build file 'C:\Projekte\test\build.gradle'.
> startup failed:
build file 'C:\Projekte\test\build.gradle': 4: unable to resolve class Thread.UncaughtExceptionHandler
@ line 4, column 34.
Thread.UncaughtExceptionHandler uncaughtExceptionHandler = new Thread.UncaughtExceptionHandler() {
^
build file 'C:\Projekte\test\build.gradle': 4: unable to resolve class Thread.UncaughtExceptionHandler
@ line 4, column 99.
ad.UncaughtExceptionHandler() {
^
2 errors
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
What can I do to solve the problem?
Kind regards,
Jörg