app crashes when changing the font style of the device - android

I am facing a issue in Samsung mobile, the issue is this, i open the application that i have made and minimized the app now the app is running at the background, now i go to my mobile
settings-->Display--> font style,
Then i changed the font when i come back and open the app that was running at the back ground the app crashes
I do not know where the issue is can you please give some idea on how to move about
This was the error that i was able to see in my logcat
2-12 17:58:54.883 1473-1473/com.mysmcc E/AndroidRuntime: FATAL EXCEPTION: main Process: com.mysmcc, PID: 1473 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.mysmcc/com.mysmcc.activities.AppMainActivity}: java.lang.StringIndexOutOfBoundsException: length=0; index=0 at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2695) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2769) at android.app.ActivityThread.access$900(ActivityThread.java:177) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1430) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5910) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1405) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1200) Caused by: java.lang.StringIndexOutOfBoundsException: length=0; index=0 at java.lang.String.indexAndLength(String.java:500) at java.lang.String.charAt(String.java:494) at android.graphics.Color.parseColor(Color.java:209) at com.mysmcc.activities.AppMainActivity.onCreate(AppMainActivity.java:213) at android.app.Activity.performCreate(Activity.java:6178) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2648) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2769) at android.app.ActivityThread.access$900(ActivityThread.java:177) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1430) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5910) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1405) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1200)

Related

java.lang.NoClassDefFoundError Android

I was integrating XMPP in my project, it was working fine but it crashed some of the device like Moto G... Below i mentioned crash report
java.lang.NoClassDefFoundError: com.app.xmpp.MyXMPP$MMessageListener
at
com.app.xmpp.MyXMPP.init(MyXMPP.java:88)
at
com.app.xmpp.MyXMPP.<init>(MyXMPP.java:57)
at
com.app.xmpp.MyXMPP.getInstance(MyXMPP.java:63)
at
com.app.xmpp.XmppService.onCreate(XmppService.java:54)
at
android.app.ActivityThread.handleCreateService(ActivityThread.java:2791)
at
android.app.ActivityThread.access$1800(ActivityThread.java:155)
at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1400)
at
android.os.Handler.dispatchMessage(Handler.java:102)
at
android.os.Looper.loop(Looper.java:135)
at
android.app.ActivityThread.main(ActivityThread.java:5343)
at
java.lang.reflect.Method.invoke(Native Method)
at
java.lang.reflect.Method.invoke(Method.java:372) at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:905)
at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:700)
Help me out how to solve this issue.

SmartStoreSDKManager returns RuntimeException

I am trying to use smartStore in native android using Salesforce sdk development.
I have followed the Salesforce doc, and whenever i want to get the instance of SmartStoreSDKManager using
SmartStoreSDKManager sdkManager = SmartStoreSDKManager.getInstance();
My app crashes with exception:
FATAL EXCEPTION: main
Process: com.audi.audidrive, PID: 21152
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.audi.audidrive/com.audi.audidrive.activities.ClaimActivity}
:java.lang.ClassCastException: com.salesforce.androidsdk.app.SalesforceSDKManager cannot be cast to com.salesforce.androidsdk.smartstore.app.SmartStoreSDKManager
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3190)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3300)
at android.app.ActivityThread.access$1000(ActivityThread.java:211)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1705)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:6946)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
atcom.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1404)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199) Caused by: java.lang.ClassCastException: com.salesforce.androidsdk.app.SalesforceSDKManager cannot be cast to com.salesforce.androidsdk.smartstore.app.SmartStoreSDKManager
atcom.salesforce.androidsdk.smartstore.app.SmartStoreSDKManager.getInstance(SmartStoreSDKManager.java:132)
at com.audi.audidrive.activities.ClaimActivity.onCreate(ClaimActivity.java:88)
at android.app.Activity.performCreate(Activity.java:6575)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1134)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3143)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3300) 
at android.app.ActivityThread.access$1000(ActivityThread.java:211) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1705) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:145) 
at android.app.ActivityThread.main(ActivityThread.java:6946) 
at java.lang.reflect.Method.invoke(Native Method) 
at java.lang.reflect.Method.invoke(Method.java:372) 
atcom.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1404) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199) 
Can someone help me to use smartStore in native android? any source code to use ?
Thank you
What you have to do is change the initialization of the SDK Manager.
Basically, in your application changes
SalesForceSDKManager.initNative
for
SmartStoreSDKManager.initNative

GoogleSign in error only on Xiomi Devices

Using com.google.android.gms:play-services-auth:10.0.1 for google signin in android app and its not working on xiomi devices and on other devices its working.
Stacktrace :
Fatal Exception: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.myapp/com.google.android.gms.auth.api.signin.internal.SignInHubActivity}: java.lang.IllegalStateException: Bad magic number for Bundle: 0xffff4f45
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2332)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2394)
at android.app.ActivityThread.access$800(ActivityThread.java:154)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1308)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5276)
at java.lang.reflect.Method.invoke(Method.java)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:911)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:706) Caused by java.lang.IllegalStateException: Bad magic number for Bundle: 0xffff4f45
at android.os.Parcel.readException(Parcel.java:1554)
at android.os.Parcel.readException(Parcel.java:1499)
at android.app.ActivityManagerProxy.startActivity(ActivityManagerNative.java:2441)
at android.app.Instrumentation.execStartActivity(Instrumentation.java:1500)
at android.app.Activity.startActivityForResult(Activity.java:3796)
at android.app.Activity.startActivityForResult(Activity.java:3757)
at android.support.v4.app.FragmentActivity.startActivityForResult(SourceFile:842)
at com.google.android.gms.auth.api.signin.internal.SignInHubActivity.zzj(Unknown Source)
at com.google.android.gms.auth.api.signin.internal.SignInHubActivity.onCreate(Unknown Source)
at android.app.Activity.performCreate(Activity.java:6041)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1109)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2285)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2394)
at android.app.ActivityThread.access$800(ActivityThread.java:154)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1308)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5276)
at java.lang.reflect.Method.invoke(Method.java)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:911)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:706)

Strange error on first startup Backendless

I'm trying to run my app with Backendless for the first time. I recieve this error:
java.lang.NoClassDefFoundError: Failed resolution of: Lcom/backendless/BackendlessCollection;
at com.backendless.Persistence.<init>(Persistence.java:72)
at com.backendless.Persistence.<clinit>(Persistence.java:62)
at com.backendless.Persistence.getInstance(Persistence.java:66)
at com.backendless.Backendless.<clinit>(Backendless.java:43)
at com.asd.asd.android.AndroidLauncher.onCreate(AndroidLauncher.java:89)
at android.app.Activity.performCreate(Activity.java:6289)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1119)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2646)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2758)
at android.app.ActivityThread.access$900(ActivityThread.java:177)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1448)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:5942)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1400)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1195)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.backendless.BackendlessCollection" on path: DexPathList[[zip file "/data/app/com.asd.asd.android-1/base.apk"],nativeLibraryDirectories=[/data/app/com.asd.asd.android-1/lib/arm, /vendor/lib, /system/lib]]
The stacktrace gives me no clue on what may be wrong since I don't even use the BackendlessCollection class.
The error points at:
Backendless.initApp(this,app_ID,android_ID, version_id);
That is a known issue in Backendless, it has been fixed in their newer SDK. Here`s link on maven central http://mvnrepository.com/artifact/com.backendless/backendless/3.0.8.1

UnsatisfiedLinkError when opening app in the emulator

I keep getting this error whenever I open my app in the emulator:
05-06 18:52:13.640 2861-2861/? E/AndroidRuntime﹕ FATAL EXCEPTION:
main
Process: scan.test, PID: 2861
java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file
"/data/app/scan.test-2/base.apk"],nativeLibraryDirectories=[/vendor/lib,
/system/lib]]] couldn't find "libtiny-tools.so"
at java.lang.Runtime.loadLibrary(Runtime.java:366)
at java.lang.System.loadLibrary(System.java:988)
at android.hardware.barcode.Scanner.(Scanner.java:136)
at scan.test.scan_v1activity.onStart(scan_v1activity.java:97)
at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1236)
at android.app.Activity.performStart(Activity.java:6006)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2288)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2390)
at android.app.ActivityThread.access$800(ActivityThread.java:151)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5257)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
I am not sure this is the exact solution but I had same issue, this is solved my issue You are missing libtiny-tools.so file in armeabi folder in libs.
if you are using android studio
add like above picture indicates.

Categories

Resources