Imported existing Android project error on eclipse - java

I've got many errors on my project recently which I'd imported on eclipse.
The project build target is Android 2.3.3 (API Level 10) and minSdkVersion, targetSdkVersion
is "9" and "14" respectively. In addition, Zip_file, library(licensing), and (Google Play) downloader_library have been added to the project.
The point is I have no idea with the errors appeared.
Window -> Show Views -> Problems -> 4errors (4items)
Project 'downloader_library' is missing required library :'/Users/Documents/Folder/downloader_library/bin/downloader_library.jar'
The Container 'Android Dependencies' references non existing library'/Users/Documents/Folder/downloader_library/bin/downloader_library.jar'
The project cannot be built until build path errors are resolved
The project cannot be built until build path errors are resolved
You know what I've put the 'downloader_library.jar' as the same path above but errors are still exist.
Errors extra :
com.google.android.vending.expansion.downloader.impl/downloader_library/V14CustomNotification
Notification.Builder cannot be resolved to a type
Multiple markers at this line - Notification.Builder cannot be resolved to a type
- Notification.Builder cannot be resolved to a type
project/package/
The hierarchy of the type MainActivity is inconsistent
ICE_CREAM_SANDWICH cannot be resolved or is not a field
SYSTEM_UI_FLAG_LOW_PROFILE cannot be resolved or is not a field
The hierarchy of the type MarketActivity is inconsistent
The import android.nfc.NfcAdapter.CreateNdefMessageCallback cannot be resolved
The import android.nfc.NfcEvent cannot be resolved
The import com.google.android.vending.expansion cannot be resolved
The import com.google.android.vending.expansion cannot be resolved
CreateNdefMessageCallback cannot be resolved to a type
The method setNdefPushMessageCallback(MuseumActivity, MuseumActivity) is undefined for the type NfcAdapter
Helpers cannot be resolved
DownloaderClientMarshaller cannot be resolved
NfcEvent cannot be resolved to a type
DownloaderService cannot be resolved to a type
The method getPublicKey() of type ExpansionFileDownloaderService must override or implement a supertype method
The method getSALT() of type ExpansionFileDownloaderService must override or implement a supertype method
The method getAlarmReceiverClassName() of type ExpansionFileDownloaderService must override or implement a supertype method
All I want to do is just editing some codes in application but i can't even build this project. I've wasted 7days for this. What should I do. Please give me a help.

you can try this-
download latest android sdk from here, http://developer.android.com/sdk/index.html#download
open the sdk manager and install the libraries required for the project. make a new project. copy all the layout files in this new project, and then clean the project. now make new java files with same names and copy the code. create entries in manifest files. it should work now.
same problem existed for me. adding the libraries in java build path didn't work.

Related

How do I resolve "the type is not accessible" error in Eclipse when using an external JAR? JAR in question is algs4 from Princeton [duplicate]

I'm new to the whole programming stuff but here's my problem:
I used to add my JUnit test cases in Eclipse by right clicking on the project, and just add New > JUnit Test Case.
Currently, I am not able to implement any test methods because Eclipse tells me on the line
import static org.junit.jupiter.api.Assertions.*;
the error message
The type org.junit.jupiter.api.Assertions is not accessible.
Error I get in the IDE:
I tried the following:
Reinstalling Eclipse, using a fresh workplace.
Adding the JUnit to Build path
Nothing helped.
It worked and works in older projects just fine.
Here is how the Package Explorer looks:
What am I missing?
You use the Java Platform Module System (JPMS) by having a module-info.java file in the default package probably without the required requires <module>; statement. JPMS was introduced in Java 9.
Do one of the following:
Delete the module-info.java file (if needed, you can recreate it via right-clicking the project folder and choosing Configure > Create module-info.java)
In module-info.java add the corresponding requires statement, e.g. by going to the line with the import statement and using the corresponding Quick Fix (Ctrl+1)

Adding an external jar to Order and Export build path generates error in project

I have an eclipse plugin which has it's Java code structured in multiple projects. In one of the projects I added an external jar and used some classes from it. At compilation time no errors where reported, but at runtime, a NoClassDefFoundError exception was thrown. I fixed the problem following this solution.
After this I run a Project -> Clean.. and out of a sudden in a different project I have an error that The method filter(Predicate<? super String[]>) in the type FluentIterable<String[]> is not applicable for the arguments ....
I compared the FluentIterable clasess in both situations and their origin does not modify.
Why is this happening?
I was getting the error because the imported jar was using a different FluentIterable class from a guava jar. I thought the class origin is the same because when I switched back the build path, I did not execute a Project->Clean and eclipse was still pointing to the bad class location.

PomData cannot be resolved to a variable

I'm using Eclipse with maven plugin. I just downloaded project, where are some values in code taken from pom file.
logger.info(lf(_("Pre-init of %s v%s", PomData.NAME, PomData.VERSION)));
But I get error:
PomData cannot be resolved to a variable
How can I fix it ?
I presume this is a compilation error, right? Is the project using https://github.com/SpongePowered/sponge-plugin-archetype? This seems to generate a Java class called PomData with the structure expected in your code.

Eclipse message (The type java.lang.Object cannot be resolved)

it's the first time I working with Eclipse but when I try to import any source I've this problem
1-The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files
2-The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files
I tried some solutions like add library..>JRE System . but useless with me!!
I just solved this problem for myself as well. If the typical uninstalling and reinstalling the JRE System Library in the Java Build Path didn't work for you, then I suggest you try to install the Java JDK from here:
https://www.oracle.com/java/technologies/javase-downloads.html
Then, create a new workspace with default settings, and everything should be good. The reason why I had this problem is probably because I accidentally deleted something that was needed for Eclipse to function.

Indirectly referenced from required .class file

I'm getting an error message when I try to build my project in eclipse:
The type weblogic.utils.expressions.ExpressionMap cannot be resolved. It is indirectly referenced
from required .class files
I've looked online for a solution and cannot find one (except for those sites that make you pay for help). Anyone have any idea of a way to find out how to go about solving this problem? Any help is appreciated, thanks!
How are you adding your Weblogic classes to the classpath in Eclipse? Are you using WTP, and a server runtime? If so, is your server runtime associated with your project?
If you right click on your project and choose build path->configure build path and then choose the libraries tab. You should see the weblogic libraries associated here. If you do not you can click Add Library->Server Runtime. If the library is not there, then you first need to configure it. Windows->Preferences->Server->Installed runtimes
Add spring-tx jar file and it should settle it.
Have you Googled for "weblogic ExpressionMap"? Do you know what it is and what it does?
Looks like you definitely need to be compiling alongside Weblogic and with Weblogic's jars included in your Eclipse classpath, if you're not already.
If you're not already working with Weblogic, then you need to find out what in the world is referencing it. You might need to do some heavy-duty grepping on your jars, classfiles, and/or source files looking for which ones include the string "weblogic".
If I had to include something that was relying on this Weblogic class, but couldn't use Weblogic, I'd be tempted to try to reverse-engineer a compatible class. Create your own weblogic.utils.expressions.ExpressionMap class; see if everything compiles; use any resultant errors or warnings at compile-time or runtime to give you clues as to what methods and other members need to be in this class. Make stub methods that do nothing or return null if possible.
This issue happen because of few jars are getting references from other jar and reference jar is missing .
Example : Spring framework
Description Resource Path Location Type
The project was not built since its build path is incomplete. Cannot find the class file for org.springframework.beans.factory.annotation.Autowire. Fix the build path then try building this project SpringBatch Unknown Java Problem
In this case "org.springframework.beans.factory.annotation.Autowire" is missing.
Spring-bean.jar is missing
Once you add dependency in your class path issue will resolve.
I was getting this error:
The type com.ibm.portal.state.exceptions.StateException cannot be resolved. It is indirectly referenced from required .class files
Doing the following fixed it for me:
Properties -> Java build path -> Libraries -> Server Library[wps.base.v61]unbound -> Websphere Portal v6.1 on WAS 7 -> Finish -> OK

Categories