Bluetooth library crashing app - android

I've been trying to use this bluetooth library to make connection to a little bluetooth module easier. Problem is, when I change my MainActivity from extends AppCompatActivity to extends BluetoothActivity as shown in the example, my app consistently crashes. I've narrowed it down to only this - I can leave all of the abstract functions blank or in their original forms, and it still crashes. Not really sure what to do here.
Could it have to do with versions? It seems to be a memory error, but the abstract methods don't interfere with any of the other objects in the activity.
Edit: Additionally, I do have
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
in my AndroidManifest.xml
Crash log:
05-10 22:17:37.862 18350-18350/? E/Zygote: v2
05-10 22:17:37.862 18350-18350/? I/libpersona: KNOX_SDCARD checking this for 10010
05-10 22:17:37.862 18350-18350/? I/libpersona: KNOX_SDCARD not a persona
05-10 22:17:37.862 18350-18350/? W/SELinux: Function: selinux_compare_spd_ram, index[1], priority [2], priority version is VE=SEPF_SECMOBILE_6.0.1_0004
05-10 22:17:37.862 18350-18350/? E/Zygote: accessInfo : 0
05-10 22:17:37.862 18350-18350/? W/SELinux: SELinux: seapp_context_lookup: seinfo=default, level=s0:c512,c768, pkgname=com.start.user.calculator
05-10 22:17:37.862 18350-18350/? I/art: Late-enabling -Xcheck:jni
05-10 22:17:37.882 18350-18350/? D/TimaKeyStoreProvider: TimaSignature is unavailable
05-10 22:17:37.882 18350-18350/? D/ActivityThread: Added TimaKeyStore provider
05-10 22:17:37.912 18350-18350/? W/ResourcesManager: getTopLevelResources: /data/app/com.start.user.calculator-1/base.apk / 1.0 running in com.start.user.calculator rsrc of package com.start.user.calculator
05-10 22:17:37.912 18350-18350/? I/InjectionManager: Inside getClassLibPath + mLibMap{0=, 1=}
05-10 22:17:37.912 18350-18350/? D/ResourcesManager: For user 0 new overlays fetched Null
05-10 22:17:37.922 18350-18350/? W/ActivityThread: Application com.start.user.calculator is waiting for the debugger on port 8100...
05-10 22:17:37.922 18350-18350/? I/System.out: Sending WAIT chunk
05-10 22:17:40.252 18350-18356/com.start.user.calculator I/art: Debugger is active
05-10 22:17:40.322 18350-18350/com.start.user.calculator I/System.out: Debugger has connected
05-10 22:17:40.322 18350-18350/com.start.user.calculator I/System.out: waiting for debugger to settle...
05-10 22:17:40.522 18350-18350/com.start.user.calculator I/System.out: waiting for debugger to settle...
05-10 22:17:40.722 18350-18350/com.start.user.calculator I/System.out: waiting for debugger to settle...
05-10 22:17:40.922 18350-18350/com.start.user.calculator I/System.out: waiting for debugger to settle...
05-10 22:17:41.122 18350-18350/com.start.user.calculator I/System.out: waiting for debugger to settle...
05-10 22:17:41.322 18350-18350/com.start.user.calculator I/System.out: waiting for debugger to settle...
05-10 22:17:41.522 18350-18350/com.start.user.calculator I/System.out: waiting for debugger to settle...
05-10 22:17:41.722 18350-18350/com.start.user.calculator I/System.out: waiting for debugger to settle...
05-10 22:17:41.922 18350-18350/com.start.user.calculator I/System.out: waiting for debugger to settle...
05-10 22:17:42.122 18350-18350/com.start.user.calculator I/System.out: waiting for debugger to settle...
05-10 22:17:42.322 18350-18350/com.start.user.calculator I/System.out: waiting for debugger to settle...
05-10 22:17:42.522 18350-18350/com.start.user.calculator I/System.out: waiting for debugger to settle...
05-10 22:17:42.722 18350-18350/com.start.user.calculator I/System.out: waiting for debugger to settle...
05-10 22:17:42.922 18350-18350/com.start.user.calculator I/System.out: debugger has settled (1379)
05-10 22:17:42.932 18350-18350/com.start.user.calculator I/InjectionManager: Inside getClassLibPath caller
05-10 22:17:42.942 18350-18350/com.start.user.calculator W/System: ClassLoader referenced unknown path: /data/app/com.start.user.calculator-1/lib/arm64
05-10 22:17:42.952 18350-18350/com.start.user.calculator D/Minikin: FontFamily bestFont == NULL, so return vacant FakedFont
05-10 22:17:42.952 18350-18350/com.start.user.calculator D/Minikin: FontFamily bestFont == NULL, so return vacant FakedFont
05-10 22:17:42.952 18350-18350/com.start.user.calculator D/Minikin: FontFamily bestFont == NULL, so return vacant FakedFont
05-10 22:17:42.962 18350-18350/com.start.user.calculator D/Minikin: FontFamily bestFont == NULL, so return vacant FakedFont
05-10 22:17:42.962 18350-18350/com.start.user.calculator D/Minikin: FontFamily bestFont == NULL, so return vacant FakedFont
05-10 22:17:42.962 18350-18350/com.start.user.calculator D/Minikin: FontFamily bestFont == NULL, so return vacant FakedFont
05-10 22:17:42.962 18350-18350/com.start.user.calculator D/InjectionManager: InjectionManager
05-10 22:17:42.962 18350-18350/com.start.user.calculator D/InjectionManager: fillFeatureStoreMap com.start.user.calculator
05-10 22:17:42.962 18350-18350/com.start.user.calculator I/InjectionManager: Constructor com.start.user.calculator, Feature store :{}
05-10 22:17:42.962 18350-18350/com.start.user.calculator I/InjectionManager: featureStore :{}
05-10 22:17:42.992 18350-18350/com.start.user.calculator W/ResourcesManager: getTopLevelResources: /data/app/com.start.user.calculator-1/base.apk / 1.0 running in com.start.user.calculator rsrc of package com.start.user.calculator
05-10 22:17:43.002 18350-18350/com.start.user.calculator W/ResourcesManager: getTopLevelResources: /data/app/com.start.user.calculator-1/base.apk / 1.0 running in com.start.user.calculator rsrc of package com.start.user.calculator
05-10 22:17:43.162 18350-18350/com.start.user.calculator D/Activity: performCreate Call Injection manager
05-10 22:17:43.172 18350-18350/com.start.user.calculator D/AndroidRuntime: Shutting down VM
05-10 22:17:43.172 18350-18350/com.start.user.calculator E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.start.user.calculator, PID: 18350
java.lang.NoClassDefFoundError: Failed resolution of: Lde/greenrobot/event/EventBus;
at com.ramimartin.bluetooth.activity.BluetoothActivity.onStart(BluetoothActivity.java:37)
at com.start.user.calculator.OnlyActivity.onStart(OnlyActivity.java:314)
at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1265)
at android.app.Activity.performStart(Activity.java:6915)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3217)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3350)
at android.app.ActivityThread.access$1100(ActivityThread.java:222)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1795)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:158)
at android.app.ActivityThread.main(ActivityThread.java:7229)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
Caused by: java.lang.ClassNotFoundException: Didn't find class "de.greenrobot.event.EventBus" on path: DexPathList[[zip file "/data/app/com.start.user.calculator-1/base.apk"],nativeLibraryDirectories=[/data/app/com.start.user.calculator-1/lib/arm64, /vendor/lib64, /system/lib64]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
at com.ramimartin.bluetooth.activity.BluetoothActivity.onStart(BluetoothActivity.java:37) 
at com.start.user.calculator.OnlyActivity.onStart(OnlyActivity.java:314) 
at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1265) 
at android.app.Activity.performStart(Activity.java:6915) 
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3217) 
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3350) 
at android.app.ActivityThread.access$1100(ActivityThread.java:222) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1795) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:158) 
at android.app.ActivityThread.main(ActivityThread.java:7229) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120) 
Suppressed: java.lang.ClassNotFoundException: de.greenrobot.event.EventBus
at java.lang.Class.classForName(Native Method)
at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
... 15 more
Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack trace available
05-10 22:18:11.802 18350-18350/com.start.user.calculator I/Process: Sending signal. PID: 18350 SIG: 9

try this , add following lines in proguard-project.txt
# Only required if you use AsyncExecutor
-keepclassmembers class * extends de.greenrobot.event.util.ThrowableFailureEvent { *; }

Related

Akka Remote on Android: Attempt to invoke virtual method 'java.lang.Object java.lang.StackTraceElement[].clone()' on a null object reference

I'm working on a simple Android app which should connect to a server in the same local network. Both the server and app run Akka Remote.
Indeed it is possible to start the ActorSystem in the Android app, but with the first request to the server the below listed NullPointerException appears.
It does not matter if I start the ActorSystem in the main thread or in an AsyncTask and funnily enough the problem does not exist on the emulator but only on a physical device in a "real network".
Has anyone an idea what the cause of this problem could be?
06-05 14:07:35.074 4746-5303/ch.fhnw.ws6.chat I/System.out: [INFO] [06/05/2016 14:07:35.073] [AsyncTask #7] [Remoting] Starting remoting
06-05 14:07:35.544 4746-5303/ch.fhnw.ws6.chat I/System.out: [INFO] [06/05/2016 14:07:35.543] [AsyncTask #7] [Remoting] Remoting started; listening on addresses :[akka.tcp://clientActorSystem#192.168.254.104:12345]
06-05 14:07:35.547 4746-5303/ch.fhnw.ws6.chat I/System.out: [INFO] [06/05/2016 14:07:35.546] [AsyncTask #7] [Remoting] Remoting now listens on addresses: [akka.tcp://clientActorSystem#192.168.254.104:12345]
06-05 14:07:35.589 4746-5235/ch.fhnw.ws6.chat D/login-tag: Send login request... 192.168.254.105:14711
06-05 14:07:35.821 4746-5305/ch.fhnw.ws6.chat I/System.out: [WARN] [06/05/2016 14:07:35.819] [clientActorSystem-akka.remote.default-remote-dispatcher-5] [akka.tcp://clientActorSystem#192.168.254.104:12345/system/endpointManager/reliableEndpointWriter-akka.tcp%3A%2F%2FChatServerSystem%40192.168.254.105%3A14711-0] Association with remote system [akka.tcp://ChatServerSystem#192.168.254.105:14711] has failed, address is now gated for [5000] ms. Reason: [Attempt to invoke virtual method 'java.lang.Object java.lang.StackTraceElement[].clone()' on a null object reference]
06-05 14:07:35.838 4746-5305/ch.fhnw.ws6.chat I/System.out: [ERROR] [06/05/2016 14:07:35.832] [clientActorSystem-akka.remote.default-remote-dispatcher-6] [Remoting] Attempt to invoke virtual method 'java.lang.Object java.lang.StackTraceElement[].clone()' on a null object reference
06-05 14:07:35.838 4746-5305/ch.fhnw.ws6.chat I/System.out: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Object java.lang.StackTraceElement[].clone()' on a null object reference
06-05 14:07:35.838 4746-5305/ch.fhnw.ws6.chat I/System.out: at akka.OnlyCauseStackTrace$class.fillInStackTrace(AkkaException.scala:27)
06-05 14:07:35.838 4746-5305/ch.fhnw.ws6.chat I/System.out: at akka.remote.EndpointException.fillInStackTrace(Endpoint.scala:113)
06-05 14:07:35.838 4746-5305/ch.fhnw.ws6.chat I/System.out: at java.lang.Throwable.<init>(Throwable.java:106)
06-05 14:07:35.838 4746-5305/ch.fhnw.ws6.chat I/System.out: at java.lang.Exception.<init>(Exception.java:60)
06-05 14:07:35.838 4746-5305/ch.fhnw.ws6.chat I/System.out: at java.lang.RuntimeException.<init>(RuntimeException.java:59)
06-05 14:07:35.838 4746-5305/ch.fhnw.ws6.chat I/System.out: at akka.AkkaException.<init>(AkkaException.scala:15)
06-05 14:07:35.838 4746-5305/ch.fhnw.ws6.chat I/System.out: at akka.remote.EndpointException.<init>(Endpoint.scala:113)
06-05 14:07:35.838 4746-5305/ch.fhnw.ws6.chat I/System.out: at akka.remote.EndpointAssociationException.<init>(Endpoint.scala:153)
06-05 14:07:35.838 4746-5305/ch.fhnw.ws6.chat I/System.out: at akka.remote.EndpointWriter$$anonfun$initializing$1.applyOrElse(Endpoint.scala:596)
06-05 14:07:35.838 4746-5305/ch.fhnw.ws6.chat I/System.out: at akka.actor.Actor$class.aroundReceive(Actor.scala:467)
06-05 14:07:35.838 4746-5305/ch.fhnw.ws6.chat I/System.out: at akka.remote.EndpointActor.aroundReceive(Endpoint.scala:437)
06-05 14:07:35.838 4746-5305/ch.fhnw.ws6.chat I/System.out: at akka.actor.ActorCell.receiveMessage(ActorCell.scala:516)
06-05 14:07:35.838 4746-5305/ch.fhnw.ws6.chat I/System.out: at akka.actor.ActorCell.invoke(ActorCell.scala:487)
06-05 14:07:35.838 4746-5305/ch.fhnw.ws6.chat I/System.out: at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:238)
06-05 14:07:35.838 4746-5305/ch.fhnw.ws6.chat I/System.out: at akka.dispatch.Mailbox.run(Mailbox.scala:220)
06-05 14:07:35.838 4746-5305/ch.fhnw.ws6.chat I/System.out: at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(AbstractDispatcher.scala:397)
06-05 14:07:35.838 4746-5305/ch.fhnw.ws6.chat I/System.out: at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
06-05 14:07:35.838 4746-5305/ch.fhnw.ws6.chat I/System.out: at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
06-05 14:07:35.838 4746-5305/ch.fhnw.ws6.chat I/System.out: at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
06-05 14:07:35.839 4746-5305/ch.fhnw.ws6.chat I/System.out: at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)

Android old devices crashing on start

My android app is crashing on older devices, it crashes as soon as it press run. I cannot work out where the error is, and if I put breakpoints it appears to crash before any of them fire. Here is the logcat...
05-19 08:10:53.847 7782-7788/com.appname.appname I/dalvikvm: Debugger is active
05-19 08:10:53.851 7782-7782/com.appname.appname I/System.out: Debugger has connected
05-19 08:10:53.851 7782-7782/com.appname.appname I/System.out: waiting for debugger to settle...
05-19 08:10:54.055 7782-7782/com.appname.appname I/System.out: waiting for debugger to settle...
05-19 08:10:54.255 7782-7782/com.appname.appname I/System.out: waiting for debugger to settle...
05-19 08:10:54.455 7782-7782/com.appname.appname I/System.out: waiting for debugger to settle...
05-19 08:10:54.655 7782-7782/com.appname.appname I/System.out: waiting for debugger to settle...
05-19 08:10:54.855 7782-7782/com.appname.appname I/System.out: waiting for debugger to settle...
05-19 08:10:55.059 7782-7782/com.appname.appname I/System.out: waiting for debugger to settle...
05-19 08:10:55.259 7782-7782/com.appname.appname I/System.out: waiting for debugger to settle...
05-19 08:10:55.459 7782-7782/com.appname.appname I/System.out: debugger has settled (1419)
05-19 08:10:55.463 7782-7782/com.appname.appname W/dalvikvm: VFY: unable to resolve static field 10394 (common_google_play_services_unknown_issue) in Lcom/google/android/gms/R$string;
05-19 08:10:55.463 7782-7782/com.appname.appname D/dalvikvm: VFY: replacing opcode 0x60 at 0x0012
05-19 08:10:55.467 7782-7782/com.appname.appname I/dalvikvm: Could not find method android.app.AppOpsManager.checkPackage, referenced from method com.google.android.gms.common.zze.zzb
05-19 08:10:55.467 7782-7782/com.appname.appname W/dalvikvm: VFY: unable to resolve virtual method 134: Landroid/app/AppOpsManager;.checkPackage (ILjava/lang/String;)V
05-19 08:10:55.467 7782-7782/com.appname.appname D/dalvikvm: VFY: replacing opcode 0x6e at 0x0011
05-19 08:10:55.467 7782-7782/com.appname.appname I/dalvikvm: Could not find method android.content.pm.PackageManager.getPackageInstaller, referenced from method com.google.android.gms.common.zze.zzi
05-19 08:10:55.467 7782-7782/com.appname W/dalvikvm: VFY: unable to resolve virtual method 495: Landroid/content/pm/PackageManager;.getPackageInstaller ()Landroid/content/pm/PackageInstaller;
05-19 08:10:55.467 7782-7782/com.appname.appname D/dalvikvm: VFY: replacing opcode 0x6e at 0x000b
05-19 08:10:55.559 7782-7782/com.appname.appname I/GMPM: App measurement is starting up, version: 8487
05-19 08:10:55.559 7782-7782/com.appname.appname I/GMPM: To enable debug logging run: adb shell setprop log.tag.GMPM VERBOSE
05-19 08:10:55.567 7782-7782/com.appname.appname W/dalvikvm: VFY: unable to resolve static field 10394 (common_google_play_services_unknown_issue) in Lcom/google/android/gms/R$string;
05-19 08:10:55.567 7782-7782/com.appname.appname D/dalvikvm: VFY: replacing opcode 0x60 at 0x000c
05-19 08:10:55.567 7782-7782/com.appname.appname D/AndroidRuntime: Shutting down VM
05-19 08:10:55.567 7782-7782/com.appname.appname W/dalvikvm: threadid=1: thread exiting with uncaught exception (group=0xa4c35648)
05-19 08:10:55.571 7782-7782/com.appname.appname E/AndroidRuntime: FATAL EXCEPTION: main
java.lang.NoClassDefFoundError: com.google.android.gms.R$string
at com.google.android.gms.measurement.zza.<init>(Unknown Source)
at com.google.android.gms.measurement.zza.zzaR(Unknown Source)
at com.google.android.gms.measurement.internal.zzn.zziJ(Unknown Source)
at com.google.android.gms.measurement.internal.zzz.zza(Unknown Source)
at com.google.android.gms.measurement.internal.zzw.<init>(Unknown Source)
at com.google.android.gms.measurement.internal.zzaa.zzDj(Unknown Source)
at com.google.android.gms.measurement.internal.zzw.zzaT(Unknown Source)
at com.google.android.gms.measurement.AppMeasurementContentProvider.onCreate(Unknown Source)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1214)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1189)
at android.app.ActivityThread.installProvider(ActivityThread.java:4879)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:4485)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4425)
at android.app.ActivityThread.access$1300(ActivityThread.java:141)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1316)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5103)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
at dalvik.system.NativeStart.main(Native Method)
Make sure you have not added google-play-services_lib project as library in Libraries (under Modules). If you have, you can go to Libraries and simply remove it. Google Play Library Should Not Appear In Libraries.
make sure you have no duplicate libraries.
For example,
If you are using SDK of Facebook it has it's own support library in it's libs folder. If you are using support library in your project then compiler throws error. Solution is, point your project and Facebook (and other modules if you have) to a (one) support library
check answer here for more details.

Google Play Games C++ SDK Samples fails with Library 'ButtonClickerNativeActivity' not found

I need to experiment with the Google Play Games C++ SDK Samples for Android.
Running it from an emulator fails to sign in requesting to install the Google Play Games... which requires to be done manually, as I understand...
Running it from the Samsung Samsung Galaxy Note 10.1 GT-N8010 executing Android 4.1.2, the Button Clicker application fails at launch with the following error:
Cannot load library: load_library[1094]: Library
'ButtonClickerNativeActivity' not found
Note: This error does not show up when I run it from the emulator.
I don't understand why this fails and how to fix or work around this failure.
The sample loads the so this way:
public class ButtonClickerNativeActivity extends NativeActivity {
// Load SO
static {
System.load("libButtonClickerNativeActivity.so");
}
I confirm the package (ButtonClicker-debug.apk) contains the library in lib folder for armeabi, armeabi-v7a and x86.
Here is the logcat listing of the app start up:
01-28 15:18:44.885 31258-31258/? D/dalvikvm: Late-enabling CheckJNI
01-28 15:18:44.900 31258-31264/? E/jdwp: Failed sending reply to debugger: Broken pipe
01-28 15:18:44.900 31258-31264/? D/dalvikvm: Debugger has detached; object registry had 1 entries
01-28 15:18:44.945 31258-31258/? W/ActivityThread: Application com.google.example.games.ButtonClicker is waiting for the debugger on port 8100...
01-28 15:18:44.960 31258-31258/? I/System.out: Sending WAIT chunk
01-28 15:18:45.915 31258-31264/com.google.example.games.ButtonClicker I/dalvikvm: Debugger is active
01-28 15:18:45.965 31258-31258/com.google.example.games.ButtonClicker I/System.out: Debugger has connected
01-28 15:18:45.965 31258-31258/com.google.example.games.ButtonClicker I/System.out: waiting for debugger to settle...
01-28 15:18:46.165 31258-31258/com.google.example.games.ButtonClicker I/System.out: waiting for debugger to settle...
01-28 15:18:46.365 31258-31258/com.google.example.games.ButtonClicker I/System.out: waiting for debugger to settle...
01-28 15:18:46.565 31258-31258/com.google.example.games.ButtonClicker I/System.out: waiting for debugger to settle...
01-28 15:18:46.765 31258-31258/com.google.example.games.ButtonClicker I/System.out: waiting for debugger to settle...
01-28 15:18:46.965 31258-31258/com.google.example.games.ButtonClicker I/System.out: waiting for debugger to settle...
01-28 15:18:47.170 31258-31258/com.google.example.games.ButtonClicker I/System.out: waiting for debugger to settle...
01-28 15:18:47.370 31258-31258/com.google.example.games.ButtonClicker I/System.out: debugger has settled (1325)
01-28 15:18:47.510 31258-31258/com.google.example.games.ButtonClicker D/dalvikvm: Trying to load lib ButtonClickerNativeActivity 0x423b2428
01-28 15:18:47.515 31258-31258/com.google.example.games.ButtonClicker W/dalvikvm: Exception Ljava/lang/UnsatisfiedLinkError; thrown while initializing Lcom/google/example/games/ButtonClicker/ButtonClickerNativeActivity;
01-28 15:18:47.515 31258-31258/com.google.example.games.ButtonClicker W/dalvikvm: Class init failed in newInstance call (Lcom/google/example/games/ButtonClicker/ButtonClickerNativeActivity;)
01-28 15:18:47.515 31258-31258/com.google.example.games.ButtonClicker D/AndroidRuntime: Shutting down VM
01-28 15:18:47.515 31258-31258/com.google.example.games.ButtonClicker W/dalvikvm: threadid=1: thread exiting with uncaught exception (group=0x41c3d2a0)
01-28 15:18:47.525 31258-31258/com.google.example.games.ButtonClicker E/AndroidRuntime: FATAL EXCEPTION: main
java.lang.ExceptionInInitializerError
at java.lang.Class.newInstanceImpl(Native Method)
at java.lang.Class.newInstance(Class.java:1319)
at android.app.Instrumentation.newActivity(Instrumentation.java:1068)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2025)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2135)
at android.app.ActivityThread.access$700(ActivityThread.java:140)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1237)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4921)
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:1038)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:805)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.UnsatisfiedLinkError: Cannot load library: load_library[1094]: Library 'ButtonClickerNativeActivity' not found
at java.lang.Runtime.load(Runtime.java:340)
at java.lang.System.load(System.java:521)
at com.google.example.games.ButtonClicker.ButtonClickerNativeActivity.(ButtonClickerNativeActivity.java:29)
at java.lang.Class.newInstanceImpl(Native Method) 
at java.lang.Class.newInstance(Class.java:1319) 
at android.app.Instrumentation.newActivity(Instrumentation.java:1068) 
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2025) 
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2135) 
at android.app.ActivityThread.access$700(ActivityThread.java:140) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1237) 
at android.os.Handler.dispatchMessage(Handler.java:99) 
at android.os.Looper.loop(Looper.java:137) 
at android.app.ActivityThread.main(ActivityThread.java:4921) 
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:1038) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:805) 
at dalvik.system.NativeStart.main(Native Method) 
01-28 15:18:58.720 31258-31258/? I/Process: Sending signal. PID: 31258 SIG: 9
I changed the following line in the sample code (ButtonClickerNativeActivity.java) and the application launched on the Samsung device without the exception.
public class ButtonClickerNativeActivity extends NativeActivity {
// Load SO
static {
//System.load("libButtonClickerNativeActivity.so");
System.loadLibrary("ButtonClickerNativeActivity");
}

android app running in background with timer task,suddenly stop the task

I make app in android with scheduled task and running in background, but when i open other app and do it something with my device,then i back to my app to check the task,the task is stopped. i have logcat like this,does somebody now what i'm doing wrong??
05-10 17:55:14.520: W/GpsLocationProvider(149): Unneeded remove listener for uid 1000
05-10 17:55:14.650: W/ActivityManager(149): Scheduling restart of crashed service com.sec.chaton/.push.PushClientService in 5000ms
05-10 17:55:15.740: E/ActivityThread(9192): Failed to find provider info for ownhere.google.settings
05-10 17:55:15.750: E/ActivityThread(9192): Failed to find provider info for ownhere.google.settings
05-10 17:55:15.790: E/ActivityThread(9192): Failed to find provider info for ownhere.google.settings
05-10 17:55:15.790: E/ActivityThread(9192): Failed to find provider info for ownhere.google.settings
05-10 17:55:16.580: W/ActivityManager(149): Scheduling restart of crashed service com.staircase3.opensignal/.library.Background_scan in 5000ms
05-10 17:55:21.680: E/API(9280): 15
05-10 17:55:21.700: E/Background_scan(9280): Tab_Overview.overview_visible=false;
05-10 17:55:34.990: W/ActivityManager(149): startActivity called from non-Activity context; forcing Intent.FLAG_ACTIVITY_NEW_TASK for: Intent { cmp=com.firstwap.celltrack/.MainActivity bnds=[834,488][1264,552] }
05-10 17:55:35.030: W/KeyguardViewMediator(149): verifyUnlock called when not externally disabled
05-10 17:55:35.140: W/ActivityManager(149): Force removing ActivityRecord{414b2478 com.firstwap.celltrack/.MainActivity}: app died, no saved state
05-10 17:55:35.250: W/GpsLocationProvider(149): Duplicate add listener for uid 10012
05-10 17:55:35.350: E/LWUIT(9312): problem with setHasAlpha
05-10 17:55:35.350: E/LWUIT(9312): java.lang.NoSuchMethodException: setHasAlpha [class java.lang.Boolean]
05-10 17:55:35.350: E/LWUIT(9312): at java.lang.Class.getConstructorOrMethod(Class.java:460)
05-10 17:55:35.350: E/LWUIT(9312): at java.lang.Class.getMethod(Class.java:915)
05-10 17:55:35.350: E/LWUIT(9312): at com.sun.lwuit.impl.android.AndroidView.initBitmaps(AndroidView.java:151)
05-10 17:55:35.350: E/LWUIT(9312): at com.sun.lwuit.impl.android.AndroidView.<init>(AndroidView.java:132)
05-10 17:55:35.350: E/LWUIT(9312): at com.sun.lwuit.impl.android.AndroidImplementation$1.run(AndroidImplementation.java:244)
05-10 17:55:35.350: E/LWUIT(9312): at com.sun.lwuit.impl.android.AndroidImplementation$12.run(AndroidImplementation.java:2155)
05-10 17:55:35.350: E/LWUIT(9312): at android.app.Activity.runOnUiThread(Activity.java:4170)
05-10 17:55:35.350: E/LWUIT(9312): at com.sun.lwuit.impl.android.AndroidImplementation.runOnAndroidUIThreadAndWait(AndroidImplementation.java:2151)
05-10 17:55:35.350: E/LWUIT(9312): at com.sun.lwuit.impl.android.AndroidImplementation.runOnAndroidUIThreadAndWait(AndroidImplementation.java:2144)
05-10 17:55:35.350: E/LWUIT(9312): at com.sun.lwuit.impl.android.AndroidImplementation.initSurface(AndroidImplementation.java:238)
05-10 17:55:35.350: E/LWUIT(9312): at com.sun.lwuit.impl.android.AndroidImplementation.init(AndroidImplementation.java:179)
05-10 17:55:35.350: E/LWUIT(9312): at com.sun.lwuit.Display.init(Display.java:423)
05-10 17:55:35.350: E/LWUIT(9312): at com.firstwap.celltrack.MobileCellTrackActivity.onCreate(MobileCellTrackActivity.java:173)
05-10 17:55:35.350: E/LWUIT(9312): at android.app.Activity.performCreate(Activity.java:4465)
05-10 17:55:35.350: E/LWUIT(9312): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
05-10 17:55:35.350: E/LWUIT(9312): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920)
05-10 17:55:35.350: E/LWUIT(9312): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
05-10 17:55:35.350: E/LWUIT(9312): at android.app.ActivityThread.access$600(ActivityThread.java:123)
05-10 17:55:35.350: E/LWUIT(9312): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
05-10 17:55:35.350: E/LWUIT(9312): at android.os.Handler.dispatchMessage(Handler.java:99)
05-10 17:55:35.350: E/LWUIT(9312): at android.os.Looper.loop(Looper.java:137)
05-10 17:55:35.350: E/LWUIT(9312): at android.app.ActivityThread.main(ActivityThread.java:4424)
05-10 17:55:35.350: E/LWUIT(9312): at java.lang.reflect.Method.invokeNative(Native Method)
05-10 17:55:35.350: E/LWUIT(9312): at java.lang.reflect.Method.invoke(Method.java:511)
05-10 17:55:35.350: E/LWUIT(9312): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
05-10 17:55:35.350: E/LWUIT(9312): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
05-10 17:55:35.350: E/LWUIT(9312): at dalvik.system.NativeStart.main(Native Method)
05-10 17:55:44.440: W/InputManagerService(149): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy#4164f0b0
05-10 17:55:47.510: W/InputManagerService(149): Starting input on non-focused client com.android.internal.view.IInputMethodClient$Stub$Proxy#416f80f0 (uid=10012 pid=9312)
It's a crash issue (NoSuchMethodException).
Logs:
05-10 17:55:35.350: E/LWUIT(9312): problem with setHasAlpha
05-10 17:55:35.350: E/LWUIT(9312): java.lang.NoSuchMethodException: setHasAlpha [class java.lang.Boolean]

App camera crash

I use the next tutorial, in developer.android.com :
http://developer.android.com/training/camera/photobasics.html
with API 2.1
When I click in take a small picture, no problem
When I click in take a small picture and after I click in take a big picture, no problem
But, when I click directly in big picture, I take a picture and my app crash ...
In LogCat :
05-10 09:26:30.773: D/CameraSample(3407): failed to create directory
05-10 09:26:33.713: W/IInputConnectionWrapper(3407): showStatusIcon on inactive InputConnection
05-10 09:26:45.883: I/Parcours(3407): handleBigCameraPhoto
05-10 09:26:46.133: D/dalvikvm(3407): GC_EXTERNAL_ALLOC freed 124K, 52% free 2628K/5379K, external 1685K/2133K, paused 207ms
05-10 09:26:46.143: E/dalvikvm-heap(3407): 31961088-byte external allocation too large for this process.
05-10 09:26:46.163: E/GraphicsJNI(3407): VM won't let us allocate 31961088 bytes
05-10 09:26:46.213: D/dalvikvm(3407): GC_FOR_MALLOC freed 2K, 52% free 2625K/5379K, external 1685K/2133K, paused 55ms
05-10 09:26:46.213: D/skia(3407): --- decoder->decode returned false
05-10 09:26:46.213: D/AndroidRuntime(3407): Shutting down VM
05-10 09:26:46.223: W/dalvikvm(3407): threadid=1: thread exiting with uncaught exception (group=0x4001d560)
05-10 09:26:46.223: E/AndroidRuntime(3407): FATAL EXCEPTION: main
05-10 09:26:46.223: E/AndroidRuntime(3407): java.lang.OutOfMemoryError: bitmap size exceeds VM budget
05-10 09:26:46.223: E/AndroidRuntime(3407): at android.graphics.BitmapFactory.nativeDecodeStream(Native Method)
05-10 09:26:46.223: E/AndroidRuntime(3407): at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:470)
05-10 09:26:46.223: E/AndroidRuntime(3407): at android.graphics.BitmapFactory.decodeFile(BitmapFactory.java:284)
05-10 09:26:46.223: E/AndroidRuntime(3407): at rdaquin.apps.takephoto.TakePhotoActivity.setPic(TakePhotoActivity.java:124)
05-10 09:26:46.223: E/AndroidRuntime(3407): at rdaquin.apps.takephoto.TakePhotoActivity.handleBigCameraPhoto(TakePhotoActivity.java:195)
05-10 09:26:46.223: E/AndroidRuntime(3407): at rdaquin.apps.takephoto.TakePhotoActivity.onActivityResult(TakePhotoActivity.java:281)
05-10 09:26:46.223: E/AndroidRuntime(3407): at android.app.Activity.dispatchActivityResult(Activity.java:3908)
05-10 09:26:46.223: E/AndroidRuntime(3407): at android.app.ActivityThread.deliverResults(ActivityThread.java:2549)
05-10 09:26:46.223: E/AndroidRuntime(3407): at android.app.ActivityThread.handleSendResult(ActivityThread.java:2595)
05-10 09:26:46.223: E/AndroidRuntime(3407): at android.app.ActivityThread.access$2000(ActivityThread.java:121)
05-10 09:26:46.223: E/AndroidRuntime(3407): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:973)
05-10 09:26:46.223: E/AndroidRuntime(3407): at android.os.Handler.dispatchMessage(Handler.java:99)
05-10 09:26:46.223: E/AndroidRuntime(3407): at android.os.Looper.loop(Looper.java:123)
05-10 09:26:46.223: E/AndroidRuntime(3407): at android.app.ActivityThread.main(ActivityThread.java:3701)
05-10 09:26:46.223: E/AndroidRuntime(3407): at java.lang.reflect.Method.invokeNative(Native Method)
05-10 09:26:46.223: E/AndroidRuntime(3407): at java.lang.reflect.Method.invoke(Method.java:507)
05-10 09:26:46.223: E/AndroidRuntime(3407): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:862)
05-10 09:26:46.223: E/AndroidRuntime(3407): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:620)
05-10 09:26:46.223: E/AndroidRuntime(3407): at dalvik.system.NativeStart.main(Native Method)
If have you need a code, ask me.
I do not understand why my application crashes, I feel that this is a memory problem but I do not know what to do.
So that when I do "take a small image" and "take a big picture" it works. But if I reload the application and that I "take a big picture" does not work
I think it's pretty obvious from the stack trace, which says you ran out of memory because you tried to allocate 32MB on the heap. You can't do that. Not surprising since this happens when you take a big picture. You can't put it in memory. Write it to storage.

Categories

Resources