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

Problem with Preview Representative Sample

When I try to Preview Representative Sample I get a message that an internal error has occurred.

An internal error has occurred. After scene creation, #init() must be called

Anyone know how to fix this?

Thanks!

4 Answers

That happened to me also, The API 19 was selected by default (seems broken).

Solved it Clicking the dropdown above which has the Android icon with a number (19) and chose another API. I chose 17 (as I have API 17 installed, and probably you too), and then it worked well.

Ben Jakuben
Ben Jakuben
Treehouse Teacher

There appears to be a bug using API 19 in the preview, and this seems to be the right answer for now. Thanks for posting, Hugo!

:-)

Ryan Bend
Ryan Bend
5,951 Points

Had a similar problem, for some reason eclipse is having trouble with the latest SDK.

I'm just copying the reply I gave in another thread, but the principal is the same, it lets you change the rendering engine:

Load up the Android SDK Manager, it should be under the 'Window' menu in your menu bar at the top of Eclipse.(If not make sure you're using the "Java" perspective) if you're using a mac, I have no idea.

From there scroll down until you see Android 4.3, you want to install the SDK Platform and the ARM EABI v7a System Image, at least those are the ones I used.

Once that's done you might have to restart eclipse.

Now when you're in the graphical editor tab of the activity_main.xml look for a little Android alien with the number 19 beside him. It should be at the top of the main window with your app preview.

Click the down arrow beside it and change the number to API 18: Android 4.3.

No idea why this works as it's supposed to only change the way that it renders the layout but it worked for me. Let me know if you need any clarification or if it still won't work.

I tried but got this message: Downloading SDK Platform Android 4.3, API 18, revision 2 Download interrupted: Unknown Host dl-ssl.google.com Done. Nothing was installed.

It makes sense that it is something to do with this causing the problem though. When I created the project I left it on the defaults for Target SDK: API 18 and Compile With: API 19

Moved this to a comment below the answer Ryan posted. There doesn't seem to be an option to delete this one though.

Hello I am in loop. I can't find the API 17 . And I don't know how to add other API with the Android SDK Manager. Could you help me? Tnks.

Ben Jakuben
Ben Jakuben
Treehouse Teacher

This Quick Tip goes over how to use the SDK Manager. Click on the little Android button with the down arrow in the Eclipse toolbar to start it and then you'll need to select API 17 from the list.