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

Travis Bentz
Travis Bentz
640 Points

Why did I receive an Error Message after hitting build app:?

Information:Gradle tasks [:app:assembleDebug] :app:preBuild :app:compileDebugNdk UP-TO-DATE :app:preDebugBuild :app:checkDebugManifest :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 C:\Users\travis\AndroidStudioProjects\FunFacts2\app\src\main\res\layout\activity_fun_facts.xml Error:(10, 17) Resource id cannot be an empty string (at 'id' with value '@+id/'). Error:(16, 21) Resource id cannot be an empty string (at 'id' with value '@+id/'). Error:(24, 31) Resource id cannot be an empty string (at 'layout_below' with value '@+id/'). Error:Execution failed for task ':app:processDebugResources'.

com.android.ide.common.internal.LoggedErrorException: Failed to run command: C:\Users\travis\Desktop\android-studio-bundle-windows\android-studio\sdk\build-tools\android-4.4W\aapt.exe package -f --no-crunch -I C:\Users\travis\Desktop\android-studio-bundle-windows\android-studio\sdk\platforms\android-19\android.jar -M C:\Users\travis\AndroidStudioProjects\FunFacts2\app\build\intermediates\manifests\debug\AndroidManifest.xml -S C:\Users\travis\AndroidStudioProjects\FunFacts2\app\build\intermediates\res\debug -A C:\Users\travis\AndroidStudioProjects\FunFacts2\app\build\intermediates\assets\debug -m -J C:\Users\travis\AndroidStudioProjects\FunFacts2\app\build\generated\source\r\debug -F C:\Users\travis\AndroidStudioProjects\FunFacts2\app\build\intermediates\libs\app-debug.ap_ --debug-mode --custom-package HiramAbiff.funfacts -0 apk Error Code: 1 Output: C:\Users\travis\AndroidStudioProjects\FunFacts2\app\build\intermediates\res\debug\layout\activity_fun_facts.xml:1: error: Error: Resource id cannot be an empty string (at 'id' with value '@+id/'). C:\Users\travis\AndroidStudioProjects\FunFacts2\app\build\intermediates\res\debug\layout\activity_fun_facts.xml:12: error: Error: Resource id cannot be an empty string (at 'id' with value '@+id/'). C:\Users\travis\AndroidStudioProjects\FunFacts2\app\build\intermediates\res\debug\layout\activity_fun_facts.xml:19: error: Error: Resource id cannot be an empty string (at 'layout_below' with value '@+id/'). Information:BUILD FAILED Information:Total time: 4.457 secs Information:4 errors Information:0 warnings Information:See complete output in console

Got this message after clicking "run app". Anybody know what it means? or why it happened. this is genymotion. I had the same issue with the AVD.

it says there are some errors in line (10, 17) , (16, 21) and (24, 31). see those lines and make sure to put the right Ids. if it doesn't work, please paste those lines here.

2 Answers

Travis Bentz
Travis Bentz
640 Points

thanks guys. Got it!

There are some errors in your code, line 10, 17 , 16, 21 and 24, 31. It's easy to spot usually the file name for example funfactsactivity.xml will have a red squigly line under it in the tabline.