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 trialGuy Bridge
Android Development Techdegree Graduate 24,991 PointsHi, I'm trying to put the following code in a try/catch however I keep getting the compile error.
I get this compile error:
JavaTester.java:22: error: exception Exception is never thrown in body of corresponding try statement } catch(Exception ex) { ^ 1 error
I've compiled it locally and it runs, although I removed the InputStream and copyFile method.
// assetManager, assetName, and fileToWrite have been initialized elsewhere
try
{
InputStream in = assetManager.open(assetName);
FileOutputStream out = new FileOutputStream(fileToWrite);
copyFile(in, out);
}
catch(Exception e)
{
e.printStackTrace();
}
4 Answers
Harry James
14,780 PointsHey Guy!
I'm getting the same problem on my side as well - there must be an issue with this Code Challenge.
I've gone ahead and reported this to the Treehouse Support team and will post back onto here if I get any updates about this for you (It shouldn't be long - they usually respond pretty quickly)
Speak to you soon and sorry about the issue!
Harry James
14,780 PointsHello again!
Just posting an update for you that this has now been passed along and the team are working on the issue.
Peter Do
12,294 Pointssame issue here...
Peter Do
12,294 PointsHarry, any answer on this?
Harry James
14,780 PointsHey Peter!
I've no news as of yet but will wait a couple more days before I ask for another update on this for you.
Again, sorry for the inconvenience and I'll speak to you shortly!
Peter Do
12,294 Pointsthis is fixed, thanks Harry!
Harry James
14,780 PointsWoohoo!
Glad everything is working again, have fun with the Android courses :D
Sandro Meschiari
18,418 PointsSandro Meschiari
18,418 Pointstry to clean the project, build=> clean Project