Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The type android.content.Context cannot be resolved. It is indirectly referenced from required .class files

I got solution(it worked for someone) for my problem:

Error with Autogenerated file BuildConfig.java - Android

Actually I do not have idea how to do this in Sybase unwired platform/eclipse:

"Fix project properties". Right click project-->android tools.

Note: I have generated code in Sybase unwired platfrom V2.1.3 for Android device.After this automatic code generation I'm getting this error, in following method:

The type android.content.Context cannot be resolved. It is indirectly referenced from required .class files

public static synchronized void setApplication(com.sybase.mobile.Application app)
{
    com.sybase.sup.client.mbs.RegistryUtil.setApplicationContext(app.getInstance().getApplicationContext());
    initialize();
}

How to solve this? Thanks.

like image 342
bapi Avatar asked Aug 29 '13 11:08

bapi


2 Answers

Right click the project -> Properties -> Java Build Path -> Libraries -> Add Library -> Android Clathpath Container -> Select your project from avaliable projects in your workspace -> Finish.

like image 151
Puzzle Avatar answered Oct 04 '22 20:10

Puzzle


Adding jar from Android SDK path...cleared the error. :)

Josh Edit: Basically I copied the file android.jar from my computer and added it to the path of my Sap Mobile Platform project, which is running on a remote virtual machine. These are the detailed steps (We all love detailed steps):

go to: YourAndroidSDKPath\sdk\platforms\android-17 (instead of 17 go to your version number)

...and copy the file android.jar somewhere else

Now, go to your SMP project, highlight the red "app.getInstance().getApplicationContext()" code where the error is, so that a yellow popup appears, with a hyperlink to "Fix Path"

Go to the Library tab, click on add external JAR, and browse to the android.jar file that you copied before.

Voila!!

like image 25
bapi Avatar answered Oct 04 '22 22:10

bapi