java.lang.NoClassDefFoundError: android.support,v4.app.Notification - java

Following a reboot my Eclipse Android project was damaged, with the vast majority of my import statements being removed. I've managed to recover it using the "Source...Organize Imports" option, but now I get the above error in a previously-working piece of code which uses NotificationCompat.
I found and followed the advice from this question:
Could not find class 'android.app.Notification$Builder
I have import android.support.v4.app.NotificationCompat; at the top of my class, and have both android-support-v4.jar and android-support-v7-appcompat.jar in the lib folder of my project. I still get the error above however.
What else can I try to resolve this?

Related

Should I download a library to import com.sun.pdfview.*?

When i decided to import com.sun.pdfview.* to my program it marked an error where it specified that I should create a package for it but when I did it still gave me an error, should I download a library to be able to use it? Which one?
ps.Im using eclipse as my IDE

Eclipse type / import error with built java file

I have a project where we use a ant buildfile to create some .java files. Those built files need to reference to already existing other java files.
My problem is that the built file can have a code line as for example
arg = (Expr) new Ast.BinaryOP(lhs, BOp.B_MINUS, rhs);
where it will show an error "Ast.BinaryOP cannot be resolved to a type". I then can type Ast.BinaryOP again and use autocomplete to pick the BinaryOP part and the error will disappear. The same with BOp.B_MINUS.
I did import (probably way too many times) the necessary other files as far as I can tell.
I.e.
import cd.ir.Ast;
import cd.ir.Ast.*;
import cd.ir.Ast.Expr;
import cd.ir.Ast.BinaryOp;
import cd.ir.Ast.BinaryOp.BOp;
So far I tried
restarting Eclipse
'clean' the project
to just run the project anyway (doesn't work)
remove the "Ast." part which will work once again if I do it in Eclipse but not if generated that way
Google the problem, respectively search it on Stackoverflow which turned out to be hard as there are many related issues. There are no good keywords as far as I can tell.
deleted the project from Eclipse and imported it newly
I need to repeatedly run the ant build file to test the code from where the .java file is generated, thus changing all errors manually is not an option.
Thanks for any advice/help in advance. I will gladly provide more information if you tell me what could help.
Hit F5 on the project, open the file, and then try hitting Ctrl+Shift+O to automatically organize the imports.
After consulting with a friend who didn't see the issue either I finally found it. So logical in retrospect but small enough that I spend 2,5h trying to find it:
import cd.ir.Ast.BinaryOp;
vs:
new Ast.BinaryOP(....
BinaryOp vs. BinaryOP

Sphero TwoPhonesOneBall sample compiler error

I imported the samples of Sphero-Android SDK to my workspace. TwoPhonesOneBall project gives compiler errors. In ConnectionActivity.java class, the following imports cannot be resolved.
//...some imports
import orbotix.multiplayer.LocalMultiplayerClient;
import orbotix.multiplayer.MultiplayerControlStrategy;
import orbotix.multiplayer.MultiplayerGame;
import orbotix.multiplayer.RemotePlayer;
//...imports
How can I fix it? Since these classes don't exist, I didn't come up with a solution. I searched the net but I couldn't find similar problem. By the way,the same problem also occurs in MultiplayerLobby application.

Missing android classes - AbstractWheelTextAdapter and WheelView

I have installed the Android SDK and then the plug-in for eclipse. That is okay, but now when I imported existing project it gives me two errors. The first one is:
//The import kankan cannot be resolved
import kankan.wheel.widget.WheelView;
The other problem is:
//The import kankan cannot be resolved
import kankan.wheel.widget.adapters.AbstractWheelTextAdapter;
I guess the problem is that this kankan is missing, but how can I add it ?
Maybe it is not installed.
Here are the missing files:
http://code.google.com/p/android-wheel/source/browse/#svn%2Ftrunk%2Fwheel%2Fsrc%2Fkankan%2Fwheel%2Fwidget
I downloaded them and added them to a package in my project. Then just fixed the imports to them. And it works.

The import javazoom cannot be resolved

hi all
i use the javazoom.jl.player.Player package but it is says The import javazoom cannot be resolved. i am using eclipse and doing Android project. i clean the project still the same error is shown. please correct me.
If eclipse can't resolve a package fragment of an import statement, then it tells you (with that error), that there is no library on the classpath that contains a class from that package (or from a package whose name starts with the missing part).
An easy way for standard java/eclipse:
create a folder lib in your projects root directory (with the eclipse workbench!)
copy and paste the jar into that folder
right-click the copied jar and select "add to build path".
This should eliminate the compiler errors immediately.
(Previous part of the answer)
Taking the error message literally, it looks like you have a line of code like that:
import javazoom;
This would be wrong, because we don't import packages but classes from a package. To import all classes from the javazoom package, we'd say:
import javazoom.*;
You should download the .jar of jLayer ( http://www.javazoom.net/javalayer/sources.html )
And add into classpath in the way Andreas_D told you.

Categories