NoClassDefFoundError: org.htmlcleaner.HtmlCleaner - android

I an trying to read an html page. i used the following link: http://thinkandroid.wordpress.com/2010/01/05/using-xpath-and-html-cleaner-to-parse-html-xml/ as an example but I get the following error
09-14 11:27:54.624: E/AndroidRuntime(10223): FATAL EXCEPTION: main
09-14 11:27:54.624: E/AndroidRuntime(10223): java.lang.NoClassDefFoundError: org.htmlcleaner.HtmlCleaner
09-14 11:27:54.624: E/AndroidRuntime(10223): at com.example.htmltest.MainActivity.getBlogStats(MainActivity.java:43)
09-14 11:27:54.624: E/AndroidRuntime(10223): at com.example.htmltest.MainActivity.onCreate(MainActivity.java:29)
09-14 11:27:54.624: E/AndroidRuntime(10223): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
09-14 11:27:54.624: E/AndroidRuntime(10223): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1615)
09-14 11:27:54.624: E/AndroidRuntime(10223): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1667)
09-14 11:27:54.624: E/AndroidRuntime(10223): at android.app.ActivityThread.access$1500(ActivityThread.java:117)
09-14 11:27:54.624: E/AndroidRuntime(10223): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:935)
I can't seem to figure out what is causing this error. any thoughts?

There are many questions already relating to the error NoClassDefFound
NoClassDefFoundError for code in an Java library on Android
java.lang.NoClassDefFoundError after integrating project to windows 7
Gson NoClassDefFoundError after ADT and SDK Tools update to v17
Have you tried any suggestions from these questions yet?
http://tools.android.com/recent/dealingwithdependenciesinandroidprojects

Related

FFmpegMediaPlayer: findLibrary returned null

I use https://github.com/wseemann/FFmpegMediaPlayer in my application, but some Android device throw exception:
java.lang.ExceptionInInitializerError
at ru.mypackage.PlayService.initPlayer(PlayService.java:74)
at ru.mypackage.PlayService.onCreate(PlayService.java:68)
at android.app.ActivityThread.handleCreateService(ActivityThread.java:1949)
at android.app.ActivityThread.access$2500(ActivityThread.java:117)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:989)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:130)
at android.app.ActivityThread.main(ActivityThread.java:3687)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:867)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:625)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.UnsatisfiedLinkError: Couldn't load avutil: findLibrary returned null
at java.lang.Runtime.loadLibrary(Runtime.java:429)
at java.lang.System.loadLibrary(System.java:554)
at wseemann.media.FFmpegMediaPlayer.<clinit>(FFmpegMediaPlayer.java:620)
... 13 more
My project:
Can somebody explain me what's wrong there?
On my device and some other device the app working nice, but on some device (for example: Galaxy Ace (GT-S5830i) Android 2.3.3 - 2.3.7) it throw the exception.
p.s. about "lib" prefix I understood ( https://developer.android.com/reference/java/lang/System.html#mapLibraryName(java.lang.String) )
You have to place the armeabi file under jnilibs folder (you will have to create it) in app/src/main/.
Hope it helps.

SecurityException DownloadManager for android 3.2

I cant use download manager for android 3.2 cause app crashes.
Log Cat:
java.lang.SecurityException: Invalid value for visibility: 1
at android.os.Parcel.readException(Parcel.java:1321)
at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:182)
at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:136)
at android.content.ContentProviderProxy.insert(ContentProviderNative.java:447)
at android.content.ContentResolver.insert(ContentResolver.java:721)
at android.app.DownloadManager.enqueue(DownloadManager.java:1172)
at gr.backatel.videotomp3download.MainActivity$10.onDownloadStart(MainActivity.java:800)
at android.webkit.CallbackProxy.handleMessage(CallbackProxy.java:389)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:132)
at android.app.ActivityThread.main(ActivityThread.java:4125)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:491)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:844)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:602)
at dalvik.system.NativeStart.main(Native Method)
The only thing that i can do is to check if android version is 3.2 and then start download so as to avoid device to crash.
<uses-permission
android:name="android.permission.DOWNLOAD_WITHOUT_NOTIFICATION" />
Try This

can't add plugin org.apache.cordova.geolocation.GeoBroker

I am having some problems with PhoneGap 3.0
Everything was working as should on PhoneGap 2.9
Now I upgraded to 3.0 And created a new PhoneGap Project.
$> phonegap create new_project
added to config.xml :
<feature name="http://api.phonegap.com/1.0/geolocation"/>
and for index.html I used the full example from http://docs.phonegap.com/en/edge/cordova_geolocation_geolocation.md.html#geolocation.getCurrentPosition_full_example
then
$> phonegap build android
I imported the project to Eclipse and checked the following :
AndroidManifest.xml has
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
xml/config.xml has
<feature name="Geolocation">
<param name="android-package" value="org.apache.cordova.geolocation.GeoBroker" />
</feature>
I also used this cmd :
$> phonegap local plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation.git
and that created the package src/
org.apache.cordova.geolocation
now when I run my app.
I got the Following errors :
I/System.out(15155): Error adding plugin org.apache.cordova.geolocation.GeoBroker.
D/PluginManager(15155): exec() call to unknown plugin: Geolocation
error Trace :
09-14 18:07:50.185: W/System.err(28211): java.lang.ClassNotFoundException: org.apache.cordova.geolocation.GeoBroker
09-14 18:07:50.195: W/System.err(28211): at java.lang.Class.classForName(Native Method)
09-14 18:07:50.195: W/System.err(28211): at java.lang.Class.forName(Class.java:217)
09-14 18:07:50.195: W/System.err(28211): at java.lang.Class.forName(Class.java:172)
09-14 18:07:50.195: W/System.err(28211): at org.apache.cordova.PluginEntry.getClassByName(PluginEntry.java:117)
09-14 18:07:50.195: W/System.err(28211): at org.apache.cordova.PluginEntry.createPlugin(PluginEntry.java:93)
09-14 18:07:50.195: W/System.err(28211): at org.apache.cordova.PluginManager.getPlugin(PluginManager.java:267)
09-14 18:07:50.205: W/System.err(28211): at org.apache.cordova.PluginManager.execHelper(PluginManager.java:221)
09-14 18:07:50.205: W/System.err(28211): at org.apache.cordova.PluginManager.exec(PluginManager.java:216)
09-14 18:07:50.205: W/System.err(28211): at org.apache.cordova.ExposedJsApi.exec(ExposedJsApi.java:53)
09-14 18:07:50.205: W/System.err(28211): at android.webkit.JWebCoreJavaBridge.sharedTimerFired(Native Method)
09-14 18:07:50.205: W/System.err(28211): at android.webkit.JWebCoreJavaBridge.sharedTimerFired(Native Method)
09-14 18:07:50.205: W/System.err(28211): at android.webkit.JWebCoreJavaBridge.fireSharedTimer(JWebCoreJavaBridge.java:107)
09-14 18:07:50.215: W/System.err(28211): at android.webkit.JWebCoreJavaBridge.handleMessage(JWebCoreJavaBridge.java:136)
09-14 18:07:50.215: W/System.err(28211): at android.os.Handler.dispatchMessage(Handler.java:99)
09-14 18:07:50.215: W/System.err(28211): at android.os.Looper.loop(Looper.java:154)
09-14 18:07:50.215: W/System.err(28211): at android.webkit.WebViewCore$WebCoreThread.run(WebViewCore.java:780)
09-14 18:07:50.215: W/System.err(28211): at java.lang.Thread.run(Thread.java:864)
09-14 18:07:50.225: W/System.err(28211): Caused by: java.lang.NoClassDefFoundError: org/apache/cordova/geolocation/GeoBroker
09-14 18:07:50.225: W/System.err(28211): ... 17 more
09-14 18:07:50.225: W/System.err(28211): Caused by: java.lang.ClassNotFoundException: org.apache.cordova.geolocation.GeoBroker
09-14 18:07:50.225: W/System.err(28211): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
09-14 18:07:50.225: W/System.err(28211): at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
09-14 18:07:50.225: W/System.err(28211): at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
09-14 18:07:50.235: W/System.err(28211): ... 17 more
and the Javascript function onError()
alert with code:null & message:
Any suggestions ?
Thank you in Advance
I thinks it's strange, but it was solved by following the steps from this link.
You need to download Cordova Android from here.
Then run these commands to build cordova-dev.jar:
android update project -p . -t android-17
ant jar
This will create cordova-dev.jar. Alternatively you can download the jar from here.
Copy cordova-dev.jar to libs folder in the Android project in eclipse and add it to the project classpath.
Now all the compilation errors will be resolved, and the project will compile successfully.

BluetoothChat example: NullPointerException [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
getActionBar returns null
Complete Android noob. I am trying to run the BluetoothChat example from a Galaxy S3, and it appears to crash the moment the application is run.
Here is the LogCat output:
09-14 15:47:23.400: E/AndroidRuntime(6098): FATAL EXCEPTION: main
09-14 15:47:23.400: E/AndroidRuntime(6098): java.lang.NullPointerException
09-14 15:47:23.400: E/AndroidRuntime(6098): at com.example.android.BluetoothChat.BluetoothChat.setStatus(BluetoothChat.java:235)
09-14 15:47:23.400: E/AndroidRuntime(6098): at com.example.android.BluetoothChat.BluetoothChat.access$4(BluetoothChat.java:233)
09-14 15:47:23.400: E/AndroidRuntime(6098): at com.example.android.BluetoothChat.BluetoothChat$2.handleMessage(BluetoothChat.java:260)
09-14 15:47:23.400: E/AndroidRuntime(6098): at android.os.Handler.dispatchMessage(Handler.java:99)
09-14 15:47:23.400: E/AndroidRuntime(6098): at android.os.Looper.loop(Looper.java:137)
09-14 15:47:23.400: E/AndroidRuntime(6098): at android.app.ActivityThread.main(ActivityThread.java:4514)
09-14 15:47:23.400: E/AndroidRuntime(6098): at java.lang.reflect.Method.invokeNative(Native Method)
09-14 15:47:23.400: E/AndroidRuntime(6098): at java.lang.reflect.Method.invoke(Method.java:511)
09-14 15:47:23.400: E/AndroidRuntime(6098): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:993)
09-14 15:47:23.400: E/AndroidRuntime(6098): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:760)
09-14 15:47:23.400: E/AndroidRuntime(6098): at dalvik.system.NativeStart.main(Native Method)
Code is exactly per the example in the SDK:
private final void setStatus(int resId) {
final ActionBar actionBar = getActionBar();
actionBar.setSubtitle(resId);
}
It appears getActionBar returns null. What might I be doing incorrectly?
This is only the 2nd Android app I have run, so go easy on me :)
Cheers
Solution found here: getActionBar returns null
this needs to go to the onCreate() method in bluetoothChat.java
getWindow().requestFeature(Window.FEATURE_ACTION_BAR);

Android market showing java.lang.IllegalArgumentException

I am getting following exception on android market for my app.
Exception class java.lang.IllegalArgumentException
Source method WindowManagerImpl.findViewLocked()
I am unable to understand why and where this is coming from? I never got this exception on my device. Does anybody have a clue how to solve this? Or see it on my device?
java.lang.IllegalArgumentException: View not attached to window manager
at android.view.WindowManagerImpl.findViewLocked(WindowManagerImpl.java:355)
at android.view.WindowManagerImpl.removeView(WindowManagerImpl.java:200)
at android.view.Window$LocalWindowManager.removeView(Window.java:432)
at android.app.Dialog.dismissDialog(Dialog.java:278)
at android.app.Dialog.access$000(Dialog.java:71)
at android.app.Dialog$1.run(Dialog.java:111)
at android.app.Dialog.dismiss(Dialog.java:268)
at android.app.Dialog.cancel(Dialog.java:951)
at com.bappy.cror.GameActivity$17$1.run(GameActivity.java:719)
at android.os.Handler.handleCallback(Handler.java:587)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:130)
at android.app.ActivityThread.main(ActivityThread.java:3687)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:867)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:625)
at dalvik.system.NativeStart.main(Native Method)

Categories

Resources