Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

android.os.Bundle cannot resolved

Tags:

android

libgdx

I use libgdx with its java based project generator application. So I use Gradle to import project into Eclipse(so I have 2 projects imported: core and android). After that I can not import android.os.Bundle, because it cannot be resolved. I should import also this class togethet with other libgdx specific packages.

I have also tried to fix Build targets, but I think this option isn't exists for this project.

like image 571
plaidshirt Avatar asked May 01 '26 20:05

plaidshirt


1 Answers

This depends if you are trying to reference the package in the core project or the android project. You can't/shouldn't import the 'Android X.X' library in the core LibGDX project, because all platforms can't use it. Make classes in the mygame-android project that are only referenced in the core project if

Gdx.app.getType() == ApplicationType.Android;
like image 133
Steven Landow Avatar answered May 04 '26 12:05

Steven Landow