android - Application closing once started -



android - Application closing once started -

i got code compile, gets closed every time start it. can advise me wrong?

below manifest , logcat , top half of code in activity.

this application project done 1 coder. using native library. had compiled native library using cygwin. able compiled successfully. error "could not load needed library 'libiconv.so' 'libexif2.so' (load_library[1108]: library 'libiconv.so' not found) 01-20 14:08:19.791", had checked, these 2 files has been generated. there place else need place library file to?

<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.kos.agphoto2" android:versionname="0.1" android:versioncode="1"> <uses-feature android:required="true" android:name="android.hardware.usb.host"></uses-feature> <uses-sdk android:minsdkversion="12"/> <uses-permission android:name="android.permission.write_external_storage"/> <application android:debuggable="true"> <activity android:name=".detectcameraactivity" android:label="detect camera"> <intent-filter> <action android:name="android.intent.action.main"/> <category android:name="android.intent.category.launcher"/> </intent-filter> <intent-filter> <action android:name="android.hardware.usb.action.usb_device_attached"/> </intent-filter> <meta-data android:name="android.hardware.usb.action.usb_device_attached" android:resource="@xml/device_filter" /> </activity> </application> </manifest> > 01-20 14:08:19.761: debug/dalvikvm(390): trying load lib > /data/data/com.kos.agphoto2/lib/libexif2.so 0x40642338 01-20 > 14:08:19.771: warn/dalvikvm(390): exception > ljava/lang/unsatisfiedlinkerror; thrown while initializing > lcom/kos/agphoto2/detectcameraactivity; 01-20 14:08:19.771: > warn/dalvikvm(390): class init failed in newinstance phone call > (lcom/kos/agphoto2/detectcameraactivity;) 01-20 14:08:19.771: > debug/androidruntime(390): shutting downwards vm 01-20 14:08:19.771: > warn/dalvikvm(390): threadid=1: thread exiting uncaught exception > (group=0x40014760) 01-20 14:08:19.791: error/androidruntime(390): > fatal exception: main 01-20 14:08:19.791: error/androidruntime(390): > java.lang.exceptionininitializererror 01-20 14:08:19.791: > error/androidruntime(390): @ > java.lang.class.newinstanceimpl(native method) 01-20 14:08:19.791: > error/androidruntime(390): @ > java.lang.class.newinstance(class.java:1301) 01-20 14:08:19.791: > error/androidruntime(390): @ > android.app.instrumentation.newactivity(instrumentation.java:1022) > 01-20 14:08:19.791: error/androidruntime(390): @ > android.app.activitythread.performlaunchactivity(activitythread.java:1663) > 01-20 14:08:19.791: error/androidruntime(390): @ > android.app.activitythread.handlelaunchactivity(activitythread.java:1764) > 01-20 14:08:19.791: error/androidruntime(390): @ > android.app.activitythread.access$1500(activitythread.java:122) 01-20 > 14:08:19.791: error/androidruntime(390): @ > android.app.activitythread$h.handlemessage(activitythread.java:1002) > 01-20 14:08:19.791: error/androidruntime(390): @ > android.os.handler.dispatchmessage(handler.java:99) 01-20 > 14:08:19.791: error/androidruntime(390): @ > android.os.looper.loop(looper.java:132) 01-20 14:08:19.791: > error/androidruntime(390): @ > android.app.activitythread.main(activitythread.java:4025) 01-20 > 14:08:19.791: error/androidruntime(390): @ > java.lang.reflect.method.invokenative(native method) 01-20 > 14:08:19.791: error/androidruntime(390): @ > java.lang.reflect.method.invoke(method.java:491) 01-20 14:08:19.791: > error/androidruntime(390): @ > com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:841) > 01-20 14:08:19.791: error/androidruntime(390): @ > com.android.internal.os.zygoteinit.main(zygoteinit.java:599) 01-20 > 14:08:19.791: error/androidruntime(390): @ > dalvik.system.nativestart.main(native method) 01-20 14:08:19.791: > error/androidruntime(390): caused by: java.lang.unsatisfiedlinkerror: > cannot load library: link_image[1966]: 32 not load needed > library 'libiconv.so' 'libexif2.so' (load_library[1108]: library > 'libiconv.so' not found) 01-20 14:08:19.791: > error/androidruntime(390): @ > java.lang.runtime.loadlibrary(runtime.java:430) 01-20 14:08:19.791: > error/androidruntime(390): @ > java.lang.system.loadlibrary(system.java:554) 01-20 14:08:19.791: > error/androidruntime(390): @ > com.kos.agphoto2.api.librarieshelper.loadnativelibraries(librarieshelper.java:42) > 01-20 14:08:19.791: error/androidruntime(390): @ > com.kos.agphoto2.detectcameraactivity.(detectcameraactivity.java:78) > 01-20 14:08:19.791: error/androidruntime(390): ... 15 more 01-20 > 14:08:19.801: warn/activitymanager(81): forcefulness finishing activity > com.kos.agphoto2/.detectcameraactivity 01-20 14:08:20.315: > warn/activitymanager(81): activity pause timeout > activityrecord{40b92fe8 com.kos.agphoto2/.detectcameraactivity} 01-20 > 14:08:20.351: info/activitymanager(81): displayed > com.android.launcher/com.android.launcher2.launcher: +32s438ms 01-20 > 14:08:24.411: debug/dalvikvm(81): gc_concurrent freed 207k, 15% free > 10682k/12487k, paused 5ms+5ms public class detectcameraactivity extends activity { static { librarieshelper.loadnativelibraries(); } private gpcontext c; private progressdialog pd; private handler h; private static final string detectcamera = "detectcamera"; private pendingintent mpermissionintent; private usbmanager musbmanager; private usbinterface musbintf; private usbdeviceconnection mconnection; private boolean musbconnected = false; // connect 1 photographic camera @ time. ignore additional cameras private boolean mforceclaim = true; private static final string action_usb_permission = "com.kos.agphoto2.usb_permission"; private final broadcastreceiver musbreceiver = new broadcastreceiver() { public void onreceive(context context, intent intent) { string action = intent.getaction(); if (action_usb_permission.equals(action) || usbmanager.action_usb_device_attached.equals(action)) { synchronized (this) { usbdevice device = (usbdevice)intent.getparcelableextra(usbmanager.extra_device); if (intent.getbooleanextra(usbmanager.extra_permission_granted, false)) { if(!musbconnected && device != null){ //call method set device communication claimdevice(device); musbconnected = true; } } else { log.d(detectcamera, "permission denied device " + device); } } } if (usbmanager.action_usb_device_detached.equals(action)) { usbdevice device = (usbdevice)intent.getparcelableextra(usbmanager.extra_device); if (musbconnected && device != null) { // phone call method cleans , closes communication device cleanupdevices(); musbconnected = false; } } } }; private void claimdevice(usbdevice device) { log.d(detectcamera, "claiming device: " + device.tostring()); musbintf = device.getinterface(0); // need next line if using java communicate // usbendpoint endpoint = musbintf.getendpoint(0); mconnection = musbmanager.opendevice(device); if(mconnection.claiminterface(musbintf, mforceclaim)) log.d(detectcamera,"interface succesfully claimed!"); } private void cleanupdevices() { if(musbconnected && mconnection!=null) { mconnection.close(); if(musbintf!=null) { mconnection.releaseinterface(musbintf); } } } @override public void oncreate(final bundle savedinstancestate) { super.oncreate(savedinstancestate); //set usb stuff musbmanager = (usbmanager) getsystemservice(android.content.context.usb_service); mpermissionintent = pendingintent.getbroadcast(this, 0, new intent(action_usb_permission), 0); intentfilter filter = new intentfilter(action_usb_permission); registerreceiver(musbreceiver, filter); //iterate on connect usb devices, check if match our intent filter hashmap<string, usbdevice> devicelist = musbmanager.getdevicelist(); iterator<usbdevice> deviceiterator = devicelist.values().iterator(); //todo: list of device filters resource file // xmlresourceparser xrp = getresources().getxml(r.xml.device_filter); while(deviceiterator.hasnext()){ usbdevice device = deviceiterator.next(); //todo: compare device list of device filters // if( device.getvendorid() ) musbmanager.requestpermission(device, mpermissionintent); } setcontentview(r.layout.detect_camera); // getpanel().setmovementmethod(new scrollingmovementmethod()); h = new handler() { @override public void handlemessage(final message msg) { if (msg.obj instanceof string) { final string s = (string) (msg.obj); getpanel().settext(s); getpanel().scrollto(0, 0); } pd.dismiss(); } }; c = gpcontextimpl.createnew();

it seems problem compiler cannot find libraries. project or downloaded internet? if net should check if project uses native code (does have smth jni folder .c, .cpp or .h files?). if yes, should @ first build native part , after can create build of code.

android forceclose

Comments

Popular posts from this blog

delphi - blogger via idHTTP : error 400 bad request -

c++ - compiler errors when initializing EXPECT_CALL with function which has program_options::variables_map as parameter -

How do I check if an insert was successful with MySQLdb in Python? -