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]
Related
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 { *; }
If I hit a https url in Android 2.3, does it automatically use SSL? I'm having trouble with an application I've written between Android 2.2 and Android 2.3. When I hit the https url on Android 2.2, it bombs out and gives me the below, but when I use the same code on Android 2.3, I get nothing. So from the reading I've done around what I'm thinking is the type of certificate at this url is a type accepted by Android 2.3 by default, but not by Android 2.2, is that right?
05-10 13:04:37.659: WARN/System.err(2177): javax.net.ssl.SSLException: Not trusted server certificate
05-10 13:04:37.659: WARN/System.err(2177): at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:371)
05-10 13:04:37.659: WARN/System.err(2177): at org.apache.http.conn.ssl.AbstractVerifier.verify(AbstractVerifier.java:92)
05-10 13:04:37.659: WARN/System.err(2177): at org.apache.http.conn.ssl.SSLSocketFactory.createSocket(SSLSocketFactory.java:381)
05-10 13:04:37.659: WARN/System.err(2177): at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:164)
05-10 13:04:37.659: WARN/System.err(2177): at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:164)
05-10 13:04:37.659: WARN/System.err(2177): at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:119)
05-10 13:04:37.659: WARN/System.err(2177): at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:348)
05-10 13:04:37.659: WARN/System.err(2177): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:555)
05-10 13:04:37.659: WARN/System.err(2177): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:487)
05-10 13:04:37.659: WARN/System.err(2177): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:465)
05-10 13:04:37.667: WARN/System.err(2177): at giat.hermes.network.IntelinkConnector.connect(IntelinkConnector.java:120)
05-10 13:04:37.667: WARN/System.err(2177): at giat.hermes.view.CreateAccount$ThreadLogMeIn.run(CreateAccount.java:77)
05-10 13:04:37.667: WARN/System.err(2177): Caused by: java.security.cert.CertificateException: java.security.cert.CertPathValidatorException: TrustAnchor for CertPath not found.
05-10 13:04:37.667: WARN/System.err(2177): at org.apache.harmony.xnet.provider.jsse.TrustManagerImpl.checkServerTrusted(TrustManagerImpl.java:168)
05-10 13:04:37.674: WARN/System.err(2177): at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:366)
05-10 13:04:37.674: WARN/System.err(2177): ... 11 more
05-10 13:04:37.674: WARN/System.err(2177): Caused by: java.security.cert.CertPathValidatorException: TrustAnchor for CertPath not found.
05-10 13:04:37.698: WARN/System.err(2177): at org.bouncycastle.jce.provider.PKIXCertPathValidatorSpi.engineValidate(PKIXCertPathValidatorSpi.java:225)
05-10 13:04:37.698: WARN/System.err(2177): at java.security.cert.CertPathValidator.validate(CertPathValidator.java:202)
05-10 13:04:37.698: WARN/System.err(2177): at org.apache.harmony.xnet.provider.jsse.TrustManagerImpl.checkServerTrusted(TrustManagerImpl.java:164)
05-10 13:04:37.698: WARN/System.err(2177): ... 12 more
And I don't want to just accept all server certs
Also, if this is what's causing the problem, would it be enough to cover backwards compatibility? I'm not likely to run into this with future updates of Android right?
If you want/need your app to to work with 2.2 and lower, you need to include the CA certificate in your app and set up HttpClient to trust it. You don't need to (and shouldn't) accept all certificates. As for future updates, the certificate could be removed if it is compromised, but otherwise it's unlikely.
And yes, if you are accessing an HTTPS URL, data will be sent and received using SSL (encrypted). You can capture packets to verify.
05-10 22:12:43.572: E/dalvikvm(566): Could not find class 'com.commonsware.cwac.merge.MergeAdapter', referenced from method FXPAL.Unity.Android.UnityMain.updateView
05-10 22:12:43.862: E/dalvikvm(566): Could not find class 'com.xtify.android.sdk.PersistentLocationManager', referenced from method FXPAL.Unity.Android.ReportingService.onCreate
05-10 22:12:44.182: E/AndroidRuntime(566): FATAL EXCEPTION: main
05-10 22:12:44.182: E/AndroidRuntime(566): java.lang.NoClassDefFoundError: com.xtify.android.sdk.PersistentLocationManager
05-10 22:12:44.182: E/AndroidRuntime(566): at FXPAL.Unity.Android.ReportingService.onCreate(ReportingService.java:240)
05-10 22:12:44.182: E/AndroidRuntime(566): at android.app.ActivityThread.handleCreateService(ActivityThread.java:2253)
05-10 22:12:44.182: E/AndroidRuntime(566): at android.app.ActivityThread.access$1600(ActivityThread.java:123)
05-10 22:12:44.182: E/AndroidRuntime(566): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1201)
05-10 22:12:44.182: E/AndroidRuntime(566): at android.os.Handler.dispatchMessage(Handler.java:99)
05-10 22:12:44.182: E/AndroidRuntime(566): at android.os.Looper.loop(Looper.java:137)
05-10 22:12:44.182: E/AndroidRuntime(566): at android.app.ActivityThread.main(ActivityThread.java:4424)
05-10 22:12:44.182: E/AndroidRuntime(566): at java.lang.reflect.Method.invokeNative(Native Method)
05-10 22:12:44.182: E/AndroidRuntime(566): at java.lang.reflect.Method.invoke(Method.java:511)
05-10 22:12:44.182: E/AndroidRuntime(566): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
05-10 22:12:44.182: E/AndroidRuntime(566): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
05-10 22:12:44.182: E/AndroidRuntime(566): at dalvik.system.NativeStart.main(Native Method)
05-10 22:12:55.702: E/dalvikvm(589): Could not find class 'com.xtify.android.sdk.PersistentLocationManager', referenced from method FXPAL.Unity.Android.ReportingService.onCreate
05-10 22:12:55.992: E/AndroidRuntime(589): FATAL EXCEPTION: main
05-10 22:12:55.992: E/AndroidRuntime(589): java.lang.NoClassDefFoundError: com.xtify.android.sdk.PersistentLocationManager
05-10 22:12:55.992: E/AndroidRuntime(589): at FXPAL.Unity.Android.ReportingService.onCreate(ReportingService.java:240)
05-10 22:12:55.992: E/AndroidRuntime(589): at android.app.ActivityThread.handleCreateService(ActivityThread.java:2253)
05-10 22:12:55.992: E/AndroidRuntime(589): at android.app.ActivityThread.access$1600(ActivityThread.java:123)
05-10 22:12:55.992: E/AndroidRuntime(589): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1201)
05-10 22:12:55.992: E/AndroidRuntime(589): at android.os.Handler.dispatchMessage(Handler.java:99)
05-10 22:12:55.992: E/AndroidRuntime(589): at android.os.Looper.loop(Looper.java:137)
05-10 22:12:55.992: E/AndroidRuntime(589): at android.app.ActivityThread.main(ActivityThread.java:4424)
05-10 22:12:55.992: E/AndroidRuntime(589): at java.lang.reflect.Method.invokeNative(Native Method)
05-10 22:12:55.992: E/AndroidRuntime(589): at java.lang.reflect.Method.invoke(Method.java:511)
05-10 22:12:55.992: E/AndroidRuntime(589): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
05-10 22:12:55.992: E/AndroidRuntime(589): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
05-10 22:12:55.992: E/AndroidRuntime(589): at dalvik.system.NativeStart.main(Native Method)
05-10 22:13:01.262: E/dalvikvm(605): Could not find class 'com.commonsware.cwac.merge.MergeAdapter', referenced from method FXPAL.Unity.Android.UnityMain.updateView
05-10 22:13:01.502: E/dalvikvm(605): Could not find class 'com.xtify.android.sdk.PersistentLocationManager', referenced from method FXPAL.Unity.Android.ReportingService.onCreate
05-10 22:13:01.722: E/AndroidRuntime(605): FATAL EXCEPTION: main
05-10 22:13:01.722: E/AndroidRuntime(605): java.lang.NoClassDefFoundError: com.xtify.android.sdk.PersistentLocationManager
05-10 22:13:01.722: E/AndroidRuntime(605): at FXPAL.Unity.Android.ReportingService.onCreate(ReportingService.java:240)
05-10 22:13:01.722: E/AndroidRuntime(605): at android.app.ActivityThread.handleCreateService(ActivityThread.java:2253)
05-10 22:13:01.722: E/AndroidRuntime(605): at android.app.ActivityThread.access$1600(ActivityThread.java:123)
05-10 22:13:01.722: E/AndroidRuntime(605): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1201)
05-10 22:13:01.722: E/AndroidRuntime(605): at android.os.Handler.dispatchMessage(Handler.java:99)
05-10 22:13:01.722: E/AndroidRuntime(605): at android.os.Looper.loop(Looper.java:137)
05-10 22:13:01.722: E/AndroidRuntime(605): at android.app.ActivityThread.main(ActivityThread.java:4424)
05-10 22:13:01.722: E/AndroidRuntime(605): at java.lang.reflect.Method.invokeNative(Native Method)
05-10 22:13:01.722: E/AndroidRuntime(605): at java.lang.reflect.Method.invoke(Method.java:511)
05-10 22:13:01.722: E/AndroidRuntime(605): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
05-10 22:13:01.722: E/AndroidRuntime(605): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
05-10 22:13:01.722: E/AndroidRuntime(605): at dalvik.system.NativeStart.main(Native Method)
I am new to android development.I am upgrading an android application from 2.2 Android to 4.0.3. The application is not starting and saying "Unfortunately myUnity application has stopped", but previously the application was good.The above is the error log i am getting while I debug the application.I am also pasting my manifest file below. Please help me out guys as I am facing this problem since many days.
Thanks in advance.
Android manifest file is
-->
Thanks in advance.... i am also new to stackflow... i am really sorry if I posted the question in wrong format.
Regards,
Rakesh.
LogCat
05-15 06:52:35.898: E/dalvikvm(1436): Could not find class 'com.commonsware.cwac.merge.MergeAdapter', referenced from method FXPAL.Unity.Android.UnityMain.updateView
05-15 06:52:36.187: E/dalvikvm(1436): Could not find class 'com.xtify.android.sdk.PersistentLocationManager', referenced from method FXPAL.Unity.Android.ReportingService.onCreate
The above is my logcat. Looking forward to your help guyz. The below is my android Manifest
Well I had made changes in my Android Environment. I was using some external libraries (JARs) and I was also getting this "NoClassDef" error. I made a folder by name of "libs" copied the libraries into it. Right clicked on "libs" then buildpath -> add as source folder.
I hope this helps :)
Your problem is `
java.lang.NoClassDefFoundError: com.xtify.android.sdk.PersistentLocationManager
`
Copied from documentation:
Thrown if the Java Virtual Machine or a ClassLoader instance tries to
load in the definition of a class (as part of a normal method call or
as part of creating a new instance using the new expression) and no
definition of the class could be found. The searched-for class
definition existed when the currently executing class was compiled,
but the definition can no longer be found.
Reason of NoClassDefFoundError is that a particular class is not available in Classpath, so u need to add that into Classpath. Try it.
No apologies needed, posting the logcat is the right thing to do. The first line says "Could not find class 'com.commonsware.cwac.merge.MergeAdapter', referenced from method FXPAL.Unity.Android.UnityMain.updateView". Be sure you are still linking that package into your app.
BTW, I can't see your manifest file.
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.
I have recently taken up Android Development and I was looking to using the WebView display webpages. I picked up from the sample that was given on Google site and for some reason the emulator kept saying page was not available. I searched in StackOverflow and found links relating to WebViewClient. I tried that also but no luck there, I have checked multiple times about the manifest entry for internet permission and its there. As a test I ran the browser available within the emulator and sure enough my firewall popped up a question on whether to allow it access or not. The pop up never came to me when I was running it from program. The code that I have is what is there Google pages
mWebView = (WebView) findViewById(R.id.webview);
mWebView.getSettings().setJavaScriptEnabled(true);
mWebView.loadUrl("http://www.google.com");
mWebView.setWebViewClient(new HelloWebViewClient());
private class HelloWebViewClient extends WebViewClient {
#Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
view.loadUrl(url);
return true;
}
I tried loading simple html directly using loadData and it worked fine. I am at loss as to what is happening and how this can be resolved. I would appreciate any help on this.
Adding the Android Manifest here
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.hellowebview"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="8" />
<application android:icon="#drawable/icon" android:label="#string/app_name">
<activity android:name=".HelloWebView"
android:label="#string/app_name"
android:theme="#android:style/Theme.NoTitleBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<uses-permission android:name="android.permission.INTERNET" />
</application>
</manifest>
To check if its just a WebView thingy, I tried accessing the internet using httpGet and httpResonse classes and got the same problem, the code was not able to connect to the given site. It failed stating the below
05-10 00:37:53.191: WARN/System.err(294): java.net.UnknownHostException: feeds.feedburner.com
05-10 00:37:53.230: WARN/System.err(294): at java.net.InetAddress.lookupHostByName(InetAddress.java:513)
05-10 00:37:53.230: WARN/System.err(294): at java.net.InetAddress.getAllByNameImpl(InetAddress.java:278)
05-10 00:37:53.230: WARN/System.err(294): at java.net.InetAddress.getAllByName(InetAddress.java:242)
05-10 00:37:53.250: WARN/System.err(294): at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:136)
05-10 00:37:53.250: WARN/System.err(294): at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:164)
05-10 00:37:53.250: WARN/System.err(294): at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:119)
05-10 00:37:53.271: WARN/System.err(294): at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:348)
05-10 00:37:53.271: WARN/System.err(294): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:555)
05-10 00:37:53.280: WARN/System.err(294): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:487)
05-10 00:37:53.291: WARN/System.err(294): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:465)
05-10 00:37:53.301: WARN/System.err(294): at com.example.hellowebview.HelloWebView.onCreate(HelloWebView.java:43)
05-10 00:37:53.301: WARN/System.err(294): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
05-10 00:37:53.309: WARN/System.err(294): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
05-10 00:37:53.322: WARN/System.err(294): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
05-10 00:37:53.330: WARN/System.err(294): at android.app.ActivityThread.access$2300(ActivityThread.java:125)
05-10 00:37:53.340: WARN/System.err(294): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
05-10 00:37:53.350: WARN/System.err(294): at android.os.Handler.dispatchMessage(Handler.java:99)
05-10 00:37:53.350: WARN/System.err(294): at android.os.Looper.loop(Looper.java:123)
05-10 00:37:53.361: WARN/System.err(294): at android.app.ActivityThread.main(ActivityThread.java:4627)
05-10 00:37:53.361: WARN/System.err(294): at java.lang.reflect.Method.invokeNative(Native Method)
05-10 00:37:53.372: WARN/System.err(294): at java.lang.reflect.Method.invoke(Method.java:521)
05-10 00:37:53.380: WARN/System.err(294): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
05-10 00:37:53.380: WARN/System.err(294): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
05-10 00:37:53.401: WARN/System.err(294): at dalvik.system.NativeStart.main(Native Method)
05-10 00:37:56.773: WARN/ActivityManager(58): Launch timeout has expired, giving up wake lock!
05-10 00:37:58.083: WARN/ActivityManager(58): Activity idle timeout for HistoryRecord{44fc9108 com.example.hellowebview/.HelloWebView}
05-10 00:38:06.300: DEBUG/KeyguardViewMediator(58): pokeWakelock(5000)
05-10 00:38:06.651: INFO/ARMAssembler(58): generated scanline__00000077:03545404_00000004_00000000 [ 47 ipp] (67 ins) at [0x3724c8:0x3725d4] in 7266287 ns
05-10 00:38:06.720: INFO/ARMAssembler(58): generated scanline__00000177:03515104_00001001_00000000 [ 91 ipp] (114 ins) at [0x371380:0x371548] in 1486222 ns
05-10 00:38:30.430: DEBUG/AndroidRuntime(294): Shutting down VM
05-10 00:38:30.430: WARN/dalvikvm(294): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
05-10 00:38:30.752: ERROR/AndroidRuntime(294): FATAL EXCEPTION: main
05-10 00:38:30.752: ERROR/AndroidRuntime(294): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.hellowebview/com.example.hellowebview.HelloWebView}: java.lang.NullPointerException
05-10 00:38:30.752: ERROR/AndroidRuntime(294): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
05-10 00:38:30.752: ERROR/AndroidRuntime(294): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
05-10 00:38:30.752: ERROR/AndroidRuntime(294): at android.app.ActivityThread.access$2300(ActivityThread.java:125)
05-10 00:38:30.752: ERROR/AndroidRuntime(294): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
05-10 00:38:30.752: ERROR/AndroidRuntime(294): at android.os.Handler.dispatchMessage(Handler.java:99)
05-10 00:38:30.752: ERROR/AndroidRuntime(294): at android.os.Looper.loop(Looper.java:123)
05-10 00:38:30.752: ERROR/AndroidRuntime(294): at android.app.ActivityThread.main(ActivityThread.java:4627)
05-10 00:38:30.752: ERROR/AndroidRuntime(294): at java.lang.reflect.Method.invokeNative(Native Method)
05-10 00:38:30.752: ERROR/AndroidRuntime(294): at java.lang.reflect.Method.invoke(Method.java:521)
05-10 00:38:30.752: ERROR/AndroidRuntime(294): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
05-10 00:38:30.752: ERROR/AndroidRuntime(294): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
05-10 00:38:30.752: ERROR/AndroidRuntime(294): at dalvik.system.NativeStart.main(Native Method)
05-10 00:38:30.752: ERROR/AndroidRuntime(294): Caused by: java.lang.NullPointerException
05-10 00:38:30.752: ERROR/AndroidRuntime(294): at com.example.hellowebview.HelloWebView.onCreate(HelloWebView.java:51)
05-10 00:38:30.752: ERROR/AndroidRuntime(294): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
05-10 00:38:30.752: ERROR/AndroidRuntime(294): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
05-10 00:38:30.752: ERROR/AndroidRuntime(294): ... 11 more
Got it. For some reason the order in which the permission is set matters a lot. I changed the order of my permission setting in manifest file and it worked. Here's the modified manifest
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.hellowebview"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="8" />
<uses-permission android:name="android.permission.INTERNET" />
<application android:icon="#drawable/icon" android:label="#string/app_name">
<activity android:name=".HelloWebView"
android:label="#string/app_name"
android:theme="#android:style/Theme.NoTitleBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
I am not sure what is the significance of this but would appreciate if anyone could elaborate.
Got it. For some reason the order in which the permission is set matters a lot. I changed the order of my permission setting in manifest file and it worked. Here's the modified manifest
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.hellowebview"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="8" />
<uses-permission android:name="android.permission.INTERNET" />
<application android:icon="#drawable/icon" android:label="#string/app_name">
<activity android:name=".HelloWebView"
android:label="#string/app_name"
android:theme="#android:style/Theme.NoTitleBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
mWebView = (WebView) findViewById(R.id.webview);
WebSettings setting =mWebView.getSettings();
mWebView.setWebViewClient(new WebViewClient() {
public boolean shouldOverrideUrlLoading(WebView view, String url) {
return true;
}
mWebView.loadUrl("http://www.google.com");
Use this code .shouldOverrideUrlLoading() not use compulsary.use this code and please reply me this code work or not
Your code looks fine. I would make sure internet is working correctly on the emulator by browsing a few pages on the Android Browser. I have had problems before where the emulator would lose network access.