Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Android

Gradle build finished with two errors

Information:Gradle tasks [:app:assembleDebug] :app:preBuild UP-TO-DATE :app:preDebugBuild UP-TO-DATE :app:checkDebugManifest :app:preReleaseBuild UP-TO-DATE :app:prepareComAndroidSupportAppcompatV72211Library UP-TO-DATE :app:prepareComAndroidSupportSupportV42211Library UP-TO-DATE :app:prepareDebugDependencies :app:compileDebugAidl UP-TO-DATE :app:compileDebugRenderscript UP-TO-DATE :app:generateDebugBuildConfig UP-TO-DATE :app:generateDebugAssets UP-TO-DATE :app:mergeDebugAssets UP-TO-DATE :app:generateDebugResValues UP-TO-DATE :app:generateDebugResources UP-TO-DATE :app:mergeDebugResources :app:processDebugManifest UP-TO-DATE :app:processDebugResources :app:generateDebugSources :app:processDebugJavaRes UP-TO-DATE :app:compileDebugJava C:\Users\Murungu\AndroidStudioProjects\InputBonanza\app\src\main\java\com\example\murungu\inputbonanza\InputBonanzaMainActivity.java Error:(25, 46) error: local variable nameEditText is accessed from within inner class; needs to be declared final Note: C:\Users\Murungu\AndroidStudioProjects\InputBonanza\app\src\main\java\com\example\murungu\inputbonanza\InputBonanzaMainActivity.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. Error:Execution failed for task ':app:compileDebugJava'.

Compilation failed; see the compiler error output for details. Information:BUILD FAILED Information:Total time: 13.151 secs Information:2 errors Information:0 warnings Information:See complete output in console

3 Answers

I am not sure on what you are working on but i just realized one possible error in your Gradle messages.That says you have declared a member variable(nameEditText) in an inner class directly instead of putting the key word final before you declare.

Thanks Tatenda, Its now running but producing errors during runtime. Let me look into my code.

Welcome