Exception while using ksoap2-android - java

I have a problem regarding the ksoap2. My problem is that the project used to work well up to the time that I had to format my pc and set it up again.
I don't remember what version I had referenced in my application but I tried many of them and the problem still occurs.
04-05 13:56:18.289: E/dalvikvm(495): Could not find class 'org.ksoap2.serialization.SoapObject', referenced from method com.giatrosofia.Activity_Votana$ConnectAndGetLst.doInBackground
04-05 13:56:18.289: W/dalvikvm(495): VFY: unable to resolve new-instance 223 (Lorg/ksoap2/serialization/SoapObject;) in Lcom/giatrosofia/Activity_Votana$ConnectAndGetLst;
04-05 13:56:18.289: D/dalvikvm(495): VFY: replacing opcode 0x22 at 0x0000
04-05 13:56:29.627: W/dalvikvm(495): threadid=9: thread exiting with uncaught exception (group=0x40014760)
04-05 13:56:29.809: E/AndroidRuntime(495): FATAL EXCEPTION: AsyncTask #1
04-05 13:56:29.809: E/AndroidRuntime(495): java.lang.RuntimeException: An error occured while executing doInBackground()
04-05 13:56:29.809: E/AndroidRuntime(495): at android.os.AsyncTask$3.done(AsyncTask.java:266)
04-05 13:56:29.809: E/AndroidRuntime(495): at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:273)
04-05 13:56:29.809: E/AndroidRuntime(495): at java.util.concurrent.FutureTask.setException(FutureTask.java:124)
04-05 13:56:29.809: E/AndroidRuntime(495): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:307)
04-05 13:56:29.809: E/AndroidRuntime(495): at java.util.concurrent.FutureTask.run(FutureTask.java:137)
04-05 13:56:29.809: E/AndroidRuntime(495): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1081)
04-05 13:56:29.809: E/AndroidRuntime(495): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:574)
04-05 13:56:29.809: E/AndroidRuntime(495): at java.lang.Thread.run(Thread.java:1020)
04-05 13:56:29.809: E/AndroidRuntime(495): Caused by: java.lang.NoClassDefFoundError: org.ksoap2.serialization.SoapObject
The referenced file is ksoap2-android-assembly-2.6.2-jar-with-dependencies.jar
and the excpetion occured in
SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
Here are the referenced jar files
Am I missing someging?

if you are using new ADT 17
then create one directory on root of your project named libs
and just copy and paste ksop jar into libs dir.
res
bin
libs --> your.jar file here
as new updated it will work well.

You can try to add the KSOAP2 to your "Order and Export" tab. To do that:
01- Right click on the name of your project
02- Click on Properties
03- Select Java Build Path
04- Check if the KSOAP Library is already on the Libraries Tab
05- Click on the Order and Export tab and check the checkbox next to ksoap2-android-assembly.
Export your project again and try it. It should work now.

Related

ListViewAnimations NoClassDefFound error

I am using ListViewAnimations core library version 3.1.0 in my android application. I have only included lib-core library as per the setup instructions. But unfortunately I am receiving following error java.lang.NoClassDefFoundError:
java.lang.NoClassDefFoundError: Failed resolution of: [Lcom/nineoldandroids/animation/Animator;
11-23 14:47:18.489 14928-14928/com.gi.giml E/AndroidRuntime: at com.nhaarman.listviewanimations.appearance.AnimationAdapter.animateViewIfNecessary(AnimationAdapter.java:174)
11-23 14:47:18.489 14928-14928/com.gi.giml E/AndroidRuntime: at com.nhaarman.listviewanimations.appearance.AnimationAdapter.getView(AnimationAdapter.java:145)
11-23 14:47:18.489 14928-14928/com.gi.giml E/AndroidRuntime: at android.widget.AbsListView.obtainView(AbsListView.java:2346)
11-23 14:47:18.489 14928-14928/com.gi.giml E/AndroidRuntime: at android.widget.ListView.makeAndAddView(ListView.java:1875)
11-23 14:47:18.489 14928-14928/com.gi.giml E/AndroidRuntime: at android.widget.ListView.fillDown(ListView.java:702)
11-23 14:47:18.489 14928-14928/com.gi.giml E/AndroidRuntime: at android.widget.ListView.fillFromTop(ListView.java:763)
11-23 14:47:18.489 14928-14928/com.gi.giml E/AndroidRuntime: at android.widget.ListView.layoutChildren(ListView.java:1684)
11-23 14:47:18.489 14928-14928/com.gi.giml E/AndroidRuntime: at android.widget.AbsListView.onLayout(AbsListView.java:2148)
11-23 14:47:18.489 14928-14928/com.gi.giml E/AndroidRuntime: at android.view.View.layout(View.java:16630)
11-23 14:47:18.489 14928-14928/com.gi.giml E/AndroidRuntime: at android.view.ViewGroup.layout(ViewGroup.java:5437)
11-23 14:47:18.489 14928-14928/com.gi.giml E/AndroidRuntime: at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1743)
I am using this animation library in my app like below:
ListView lv = new ListView(getActivity());
SwingBottomInAnimationAdapter bottomInAnimationAdapter = new SwingBottomInAnimationAdapter(new ArrayAdapter<String>(getActivity(), R.layout.subgroup_list_layout, R.id.textView, result));
bottomInAnimationAdapter.setAbsListView(lv);
lv.setAdapter(bottomInAnimationAdapter);
Any idea what I am doing wrong?
ListViewAnimations is based on NineOldAndroids and several classes reference com.nineoldandroids.animation.Animator directly. So you need to include this library as well.
If you're using gradle, this is done automatically by only declaring
dependencies {
compile 'com.nhaarman.listviewanimations:lib-core:3.1.0#aar'
}
in your build.gradle. The same holds if you're using Maven and pom.xml. Otherwise you need to follow the instructions on the page you linked yourself:
Download the jar files you need: (lib-core)
Download the latest NineOldAndroids.jar file
Add the .jar files to your project's libs folder, or add them as external jars to your project's build path.
You should also include "nineoldandroids-2.4.0.jar" file in your project along with dependencies {
compile 'com.nhaarman.listviewanimations:lib-core:3.1.0#aar'
}
add jar file to the lib folder and add this line in dependency
compile files('libs/nineoldandroids-2.4.0.jar') it works fine for this error "java.lang.NoClassDefFoundError: Failed resolution of: [Lcom/nineoldandroids/animation/Animator;"
link to download jar file https://github.com/downloads/JakeWharton/NineOldAndroids/nineoldandroids-2.4.0.jar

Caused by: java.lang.UnsatisfiedLinkError: Library pjsua2 not found

I am using pjsua2 lib for voip calling and after building sample application there is a file named pjsua2.so has been created in lib->armebie folder .Now this sample application is running well in version 4.1.1 but same application crashing in version 2.2 and giving exception
04-05 13:27:11.936: W/dalvikvm(8936): VFY: unable to resolve virtual method 81: Ljava/lang/String;.isEmpty ()Z
04-05 13:27:12.236: W/dalvikvm(8936): Exception Ljava/lang/UnsatisfiedLinkError; thrown during Lorg/pjsip/pjsua2/app/MyApp;.<clinit>
04-05 13:27:12.236: W/dalvikvm(8936): threadid=1: thread exiting with uncaught exception (group=0x400207d8)
04-05 13:27:12.256: E/AndroidRuntime(8936): FATAL EXCEPTION: main
04-05 13:27:12.256: E/AndroidRuntime(8936): java.lang.ExceptionInInitializerError
04-05 13:27:12.256: E/AndroidRuntime(8936): at org.pjsip.pjsua2.app.MainActivity.onCreate(MainActivity.java:93)
04-05 13:27:12.256: E/AndroidRuntime(8936): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
04-05 13:27:12.256: E/AndroidRuntime(8936): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2633)
04-05 13:27:12.256: E/AndroidRuntime(8936): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2685)
04-05 13:27:12.256: E/AndroidRuntime(8936): at android.app.ActivityThread.access$2300(ActivityThread.java:126)
04-05 13:27:12.256: E/AndroidRuntime(8936): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2038)
So can any one tell me the issue ??
here is make file
include ../../../../../build.mak
LOCAL_PATH := $(PJDIR)/pjsip-apps/src/swig/java/android
include $(CLEAR_VARS)
LOCAL_MODULE := libpjsua2
LOCAL_CFLAGS := $(APP_CFLAGS) -frtti -fexceptions
LOCAL_LDFLAGS := $(APP_LDFLAGS)
LOCAL_LDLIBS := $(APP_LDLIBS)
LOCAL_SRC_FILES := ../output/pjsua2_wrap.cpp
include $(BUILD_SHARED_LIBRARY)
Your problem is related to the path of the pjsua2 library. Check in your source where you load the library. Try to add this static block a static :
static {
System.load("path to your library";
System.out.println("library loaded");
}
When you start to build PJSUA2 don't forget to build it for every armeabi you are going to use. For example: TARGET_ABI=armeabi-v7a ./configure-android --use-ndk-cflags.

Vitamio Sample Error - java.lang.UnsatisfiedLinkError: Couldn't load vinit findLibrary returned null

I'm having trouble running the vitamio-sample from https://github.com/yixia/VitamioBundle.
I am building it with Android Studio and it compiles fine and runs, but when it gets to this line:
if (!io.vov.vitamio.LibsChecker.checkVitamioLibs(this))
return;
It throws an exception when I run it on my Nexus 5 (and also on a Galaxy S4):
01-22 11:58:40.759 12323-12323/? E/AndroidRuntime﹕ FATAL EXCEPTION: main
Process: io.vov.vitamio.demo, PID: 12323
java.lang.UnsatisfiedLinkError: Couldn't load vinit from loader dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/io.vov.vitamio.demo-1.apk"],nativeLibraryDirectories=[/data/app-lib/io.vov.vitamio.demo-1, /vendor/lib, /system/lib]]]: findLibrary returned null
at java.lang.Runtime.loadLibrary(Runtime.java:358)
at java.lang.System.loadLibrary(System.java:526)
at io.vov.vitamio.Vitamio.<clinit>(Vitamio.java:258)
at io.vov.vitamio.LibsChecker.checkVitamioLibs(LibsChecker.java:40)
at io.vov.vitamio.demo.VitamioListActivity.onCreate(VitamioListActivity.java:40)
at android.app.Activity.performCreate(Activity.java:5231)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2159)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
at android.app.ActivityThread.access$800(ActivityThread.java:135)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5017)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
at dalvik.system.NativeStart.main(Native Method)
The exception also happens when I'm running the v4.2.0 tree in my own app.
Any idea what I'm missing? In my own app I pulled the vitamio project into a libraries folder and am referencing it like this:
compile(project(':libraries:vitamio'))
The sample project is left as-is.
I am not sure if there is a cleaner way in the newer version of Vitamino (or gradle). But here is how I got it to work with gradle build tools 0.6.
Added a project to my /libraries directory with the vitamino source/sdk. This has a /libs/armeabi /libs/armeabi-v7a with libvinit.so inside.
In my build.gradle for my main project, reference the library project like:
dependencies {
// other dependencies
compile(project(':libraries:vitamio'))
}
Add the following to the bottom of my build.gradle
task copyNativeLibs(type: Copy) {
from(new File(project(':libraries:vitamio').getProjectDir(), 'libs')) { include '**/*.so' }
into new File(buildDir, 'native-libs')
}
tasks.withType(JavaCompile) { compileTask -> compileTask.dependsOn copyNativeLibs }
clean.dependsOn 'cleanCopyNativeLibs'
tasks.withType(com.android.build.gradle.tasks.PackageApplication) { pkgTask ->
pkgTask.jniDir new File(buildDir, 'native-libs')
}
Then when i run a clean and rebuild it will copy the native libs to the proper spot and include them in the build.

NullPointerException in Android when declaring a Content Provider

I'm facing a strange issue when declaring a Content Provider in my project. I'm copying the classes and Manifest declaration from another project of my own. It's working OK on my other project.
Here's part of my Manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.qr"
android:installLocation="auto"
android:versionCode="540"
android:versionName="5.4" >
(...)
<application
android:name=".Application"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:logo="#drawable/ic_launch" >
(...)
<provider
android:name=".provider.HistoryProvider"
android:authorities="com.example.qr.History"
android:exported="true"
android:multiprocess="true"
android:readPermission="com.example.qr.History.read"
android:writePermission="com.example.qr.History.write" />
(...)
</application>
</manifest>
When I run my app, I get this stack trace:
FATAL EXCEPTION: main
java.lang.NullPointerException
at android.app.ActivityThread.installProvider(ActivityThread.java:4783)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:4430)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4372)
at android.app.ActivityThread.access$1300(ActivityThread.java:141)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1294)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5039)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
at dalvik.system.NativeStart.main(Native Method)
This is the whole stack trace. No 'com.example' trace is included. Of course some code in my app is producing this but the actual crash happens in Android.
Because my own classes are not included in the stack trace, I really don't know where to look.
I've run the code in an emulator with Android 4.2 and I've compared it with the source code of that version of Android, so I know the crash is produced in this line of ActivityThread:
4782 ApplicationInfo ai = info.applicationInfo;
4783 if (context.getPackageName().equals(ai.packageName)) {
Here's a link to the source code of this class.
If I don't declare the content provider (i.e. if I remove from my Manifest), the app works perfectly.
I've added some logs to my Application class, as well as the main Activity class. The crash is produced before either is launched.
So, my question is: what in my code can be producing context, context.getPackageName() or info.applicationInfo to be null during installation?
EDIT
When triggering the stack trace in the emulator several times, I only get this between traces:
09-11 23:10:21.250: E/AndroidRuntime(933): at dalvik.system.NativeStart.main(Native Method)
09-11 23:10:21.470: D/dalvikvm(933): GC_CONCURRENT freed 142K, 9% free 2951K/3224K, paused 78ms+3ms, total 225ms
09-11 23:10:44.030: I/Process(933): Sending signal. PID: 933 SIG: 9
09-11 23:10:46.940: D/dalvikvm(947): GC_CONCURRENT freed 164K, 10% free 2711K/2996K, paused 13ms+114ms, total 201ms
09-11 23:10:47.170: I/ActivityThread(947): Pub com.example.qr.History: com.example.qr.provider.HistoryProvider
09-11 23:10:47.170: D/AndroidRuntime(947): Shutting down VM
09-11 23:10:47.170: W/dalvikvm(947): threadid=1: thread exiting with uncaught exception (group=0x40a70930)
09-11 23:10:47.180: E/AndroidRuntime(947): FATAL EXCEPTION: main

android opengl error (Application unexpectedly stopped)

I'm developing this game for android. I'm following a tutorial on how to make menus. And this is the code. There's no errors just warning in the code so I dont know what to do.
08-23 21:31:41.099: E/System(79): Failure starting core service
08-23 21:31:41.099: E/System(79): java.lang.SecurityException
08-23 21:31:41.099: E/System(79): at android.os.BinderProxy.transact(Native Method)
08-23 21:31:41.099: E/System(79): at android.os.ServiceManagerProxy.addService(ServiceManagerNative.java:146)
08-23 21:31:41.099: E/System(79): at android.os.ServiceManager.addService(ServiceManager.java:72)
08-23 21:31:41.099: E/System(79): at com.android.server.ServerThread.run(SystemServer.java:206)
08-23 21:31:41.139: E/EventHub(79): could not get driver version for /dev/input/mouse0, Not a typewriter
08-23 21:31:41.139: E/EventHub(79): could not get driver version for /dev/input/mice, Not a typewriter
08-23 21:31:42.049: E/SoundPool(79): error loading /system/media/audio/ui/Effect_Tick.ogg
08-23 21:31:42.049: E/SoundPool(79): error loading /system/media/audio/ui/KeypressStandard.ogg
08-23 21:31:42.069: E/SoundPool(79): error loading /system/media/audio/ui/KeypressSpacebar.ogg
08-23 21:31:42.069: E/SoundPool(79): error loading /system/media/audio/ui/KeypressDelete.ogg
08-23 21:31:42.079: E/SoundPool(79): error loading /system/media/audio/ui/KeypressReturn.ogg
08-23 21:31:42.159: E/UsbObserver(79): java.lang.NullPointerException
08-23 21:31:42.159: E/UsbObserver(79): at com.android.server.UsbObserver.init(UsbObserver.java:131)
08-23 21:31:42.159: E/UsbObserver(79): at com.android.server.UsbObserver.<init>(UsbObserver.java:65)
08-23 21:31:42.159: E/UsbObserver(79): at com.android.server.ServerThread.run(SystemServer.java:402)
08-23 21:31:47.820: E/ThrottleService(79): Could not open GPS configuration file /etc/gps.conf
08-23 21:31:47.880: E/ThrottleService(79): Error reading data file
08-23 21:31:49.250: E/logwrapper(194): executing /system/bin/tc failed: No such file or directory
08-23 21:31:49.320: E/logwrapper(195): executing /system/bin/tc failed: No such file or directory
08-23 21:31:49.370: E/logwrapper(196): executing /system/bin/tc failed: No such file or directory
08-23 21:31:57.759: E/logwrapper(225): executing /system/bin/tc failed: No such file or directory
08-23 21:31:57.889: E/logwrapper(226): executing /system/bin/tc failed: No such file or directory
08-23 21:31:58.000: E/logwrapper(227): executing /system/bin/tc failed: No such file or directory
08-23 21:32:41.593: E/MetadataRetrieverClient(34): failed to extract an album art
08-23 21:33:17.502: E/ThrottleService(79): Error reading data file
08-23 22:06:08.702: E/AndroidRuntime(414): FATAL EXCEPTION: GLThread 13
08-23 22:06:08.702: E/AndroidRuntime(414): java.lang.IllegalArgumentException: No EGLConfig found!
08-23 22:06:08.702: E/AndroidRuntime(414): at org.andengine.opengl.view.ConfigChooser.chooseConfig(ConfigChooser.java:183)
08-23 22:06:08.702: E/AndroidRuntime(414): at org.andengine.opengl.view.ConfigChooser.chooseConfig(ConfigChooser.java:157)
08-23 22:06:08.702: E/AndroidRuntime(414): at android.opengl.GLSurfaceView$EglHelper.start(GLSurfaceView.java:919)
08-23 22:06:08.702: E/AndroidRuntime(414): at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1264)
08-23 22:06:08.702: E/AndroidRuntime(414): at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1118)
if you are trying this in an emulator - it's probably not configured properly. See my answer to this question - Android AndEngine problems: java.lang.IllegalArgumentException: No EGLConfig Found
Changed already the target SDK, enable GPU Host, the processor to Intel. Still getting errors
08-25 01:41:48.889: ERROR/Zygote(793): setreuid() failed. errno: 30
08-25 01:42:01.820: ERROR/Zygote(793): setreuid() failed. errno: 30
08-25 01:42:04.430: ERROR/BatteryService(853): acOnlinePath not found
08-25 01:42:04.430: ERROR/BatteryService(853): usbOnlinePath not found
08-25 01:42:04.430: ERROR/BatteryService(853): batteryStatusPath not found
08-25 01:42:04.430: ERROR/BatteryService(853): batteryHealthPath not found
08-25 01:42:04.430: ERROR/BatteryService(853): batteryPresentPath not found
08-25 01:42:04.430: ERROR/BatteryService(853): batteryCapacityPath not found
08-25 01:42:04.430: ERROR/BatteryService(853): batteryVoltagePath not found
08-25 01:42:04.430: ERROR/BatteryService(853): batteryTemperaturePath not found
08-25 01:42:04.430: ERROR/BatteryService(853): batteryTechnologyPath not found
08-25 01:42:04.770: ERROR/EGL_emulation(853): rcMakeCurrent returned EGL_FALSE
08-25 01:42:04.770: ERROR/EGL_emulation(853): tid 874: eglMakeCurrent(984): error 0x3006 (EGL_BAD_CONTEXT)
08-25 01:42:04.770: ERROR/libEGL(853): call to OpenGL ES API with no current context (logged once per thread)
08-25 01:42:04.770: ERROR/libEGL(853): call to OpenGL ES API with no current context (logged once per thread)
08-25 01:42:04.770: ERROR/libEGL(853): call to OpenGL ES API with no current context (logged once per thread)
08-25 01:42:04.770: ERROR/libEGL(853): call to OpenGL ES API with no current context (logged once per thread)
08-25 01:43:01.773: ERROR/Zygote(889): setreuid() failed. errno: 30

Categories