프로그래밍 농장

Execution failed for task ':audioplayers:compileDebugKotlin'./null error 해결법 [ flutter ] 본문

flutter [Darts]

Execution failed for task ':audioplayers:compileDebugKotlin'./null error 해결법 [ flutter ]

Tennessee201 2021. 11. 25.
728x90

flutter 사용시 2.0 버전 업그레이드에 따라서, nullable 에러가 다수 발생하는 경우가 생긴다 .

이떄 가장 간단히 해결할수있는방법은, 변수 선언시 ? 를 추가로 붙혀주고, 이는 호출 등 이후 사용할떄도 붙혀줄수있다.

하지만 이는 일일이 수정 및 올바르지않다 .

 

stackoverflow에 따르면 project/gradle 에서 kotlin/java의 업데이트된 12에서 6으로 다운그레이드(수정)할시 쉽게 해결된다고한다. 

(아래와 같이 다운그레이드 수정)

android/build.gradle

ext.kotlin_version = '1.5.10'

 

 

또는 android/.gradle 를 삭제후 재 컴파일을 해보는 것도 좋다. 

https://stackoverflow.com/questions/59893018/flutter-execution-failed-for-task-appcompiledebugkotlin?rq=1 

 

Flutter: Execution failed for task ':app:compileDebugKotlin'

I tried running the default flutter app from flutter create on my android device but it throws me an error. Can someone help? Launching lib\main.dart on SM G610F in debug mode... Running Gradle ...

stackoverflow.com

 

728x90