Navigation Drawer android.content.res.Resources$NotFoundException 4.X error - android

My Navigation Drawer a part of this
And in Android 4.X actionBarDrawerToggle.syncState(); error , but Android 5.X not have this error...
actionBarDrawerToggle.setDrawerIndicatorEnabled(true);
drawerLayout.setDrawerListener(actionBarDrawerToggle);
actionBarDrawerToggle.syncState();
and this my error logcat
04-12 13:45:08.037 22518-22518/com.example.yi.flinkservice E/AndroidRuntime: FATAL EXCEPTION: main
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.yi.flinkservice/com.example.yi.flinkservice.MainActivity}: android.content.res.Resources$NotFoundException: String resource ID #0x7f070053
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2073)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2098)
at android.app.ActivityThread.access$600(ActivityThread.java:138)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1204)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4872)
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:790)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:557)
at dalvik.system.NativeStart.main(Native Method)
Caused by: android.content.res.Resources$NotFoundException: String resource ID #0x7f070053
at android.content.res.Resources.getText(Resources.java:230)
at android.content.Context.getText(Context.java:283)
at android.support.v7.widget.Toolbar.setNavigationContentDescription(Toolbar.java:718)
at android.support.v7.app.ActionBarDrawerToggle$ToolbarCompatDelegate.setActionBarDescription(ActionBarDrawerToggle.java:642)
at android.support.v7.app.ActionBarDrawerToggle$ToolbarCompatDelegate.setActionBarUpIndicator(ActionBarDrawerToggle.java:634)
at android.support.v7.app.ActionBarDrawerToggle.setActionBarUpIndicator(ActionBarDrawerToggle.java:457)
at android.support.v7.app.ActionBarDrawerToggle.syncState(ActionBarDrawerToggle.java:246)
at com.example.yi.flinkservice.MainActivity.onCreate(MainActivity.java:230)
at android.app.Activity.performCreate(Activity.java:5191)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1082)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2037)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2098) 
at android.app.ActivityThread.access$600(ActivityThread.java:138) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1204) 
at android.os.Handler.dispatchMessage(Handler.java:99) 
at android.os.Looper.loop(Looper.java:137) 
at android.app.ActivityThread.main(ActivityThread.java:4872) 
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:790) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:557) 
at dalvik.system.NativeStart.main(Native Method) 
thanks to Help !

Actually this is not a error of actionBarDrawerToggle.syncState(); method but when you call this, the string which you set is not found please check your string is available in both value folder value and value-21 and not then set in both.

Related

I am unable to run application via usb debugging .Earlier it was working fine

Usb debugging in my mobile has stopped working. The application is not installing via USB.Earlier It was working fine.I am attaching logs. Please help me to find out error.
FATAL EXCEPTION: main
java.lang.ExceptionInInitializerError
at
android.support.v4.app.SupportActivity.(SupportActivity.java:96)
at
android.support.v4.app.BaseFragmentActivityApi14.(BaseFragmentActivityApi14.java:28)
at
android.support.v4.app.BaseFragmentActivityApi16.(BaseFragmentActivityApi16.java:34)
at
android.support.v4.app.FragmentActivity.(FragmentActivity.java:67)
at
android.support.v7.app.AppCompatActivity.(AppCompatActivity.java:61)
at com.kpfactors_mbl.bizfactors.Login.(Login.java:68)
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:1027)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:794)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.UnsatisfiedLinkError: Cannot load library:
reloc_library[1307]: 1842 cannot locate '__isnanf'...at
java.lang.Runtime.loadLibrary(Runtime.java:370)
at java.lang.System.loadLibrary(System.java:535)
at
com.android.tools.profiler.support.ProfilerService.(ProfilerService.java:41)
at
android.support.v4.app.SupportActivity.(SupportActivity.java:96) 
at
android.support.v4.app.BaseFragmentActivityApi14.(BaseFragmentActivityApi14.java:28) 
at
android.support.v4.app.BaseFragmentActivityApi16.(BaseFragmentActivityApi16.java:34) 
at
android.support.v4.app.FragmentActivity.(FragmentActivity.java:67) 
at
android.support.v7.app.AppCompatActivity.(AppCompatActivity.java:61) 
at com.kpfactors_mbl.bizfactors.Login.(Login.java:68) 
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:1027) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:794) 
at dalvik.system.NativeStart.main(Native Method)

Android Studio : Class Not Found

I am building a chat app using Firebase. When I want to test my app this error shows and the app crashes. The error is:
09-26 17:27:38.437 29482-29482/shashoug.com.zoolisd E/AndroidRuntime: FATAL EXCEPTION: main
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2180)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2309)
at android.app.ActivityThread.access$700(ActivityThread.java:157)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1289)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:176)
at android.app.ActivityThread.main(ActivityThread.java:5317)
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:1102)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:869)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.ClassNotFoundException: Didn't find class "shashoug.com.zoolisd.MainActivity" on path: /data/app/shashoug.com.zoolisd-2.apk
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:65)
at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
at android.app.Instrumentation.newActivity(Instrumentation.java:1071)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2171)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2309) 
at android.app.ActivityThread.access$700(ActivityThread.java:157) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1289) 
at android.os.Handler.dispatchMessage(Handler.java:99) 
at android.os.Looper.loop(Looper.java:176) 
at android.app.ActivityThread.main(ActivityThread.java:5317) 
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:1102) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:869) 
at dalvik.system.NativeStart.main(Native Method) 
09-26 17:27:40.079 29482-29482/? I/Process: Sending signal. PID: 29482 SIG: 9
As it was said in earlier answers, just try:
Build - Clean project, after that
Build - Rebuild project.
Also, if it doesn't help, try File - Invalidate Caches/Restart - Invalidate.
After all of above, delete app from your device and install it again.

constraintset. java.lang.UnsupportedOperationException: Can't convert to dimension: type=0x3

I'm trying to use ConstraintSet.load (Context context, int resourceId) in my project. It works fine with api 19 and up, but causes error when tested with api 16.
I have tried replacing the dimensions with actual value (56dp, -1dp) and values in dimens resource file but always gives the java.lang.UnsupportedOperationException: Can't convert to dimension: type=0x3 error.
Here is the xml file: enter image description here
Here is the main activity: enter image description here
and this is the error:
07-08 13:51:02.730 14466-14466/help.logs.error.constrainterror E/AndroidRuntime: FATAL EXCEPTION: main
java.lang.RuntimeException: Unable to start activity ComponentInfo{help.logs.error.constrainterror/help.logs.error.constrainterror.MainActivity}: java.lang.UnsupportedOperationException: Can't convert to dimension: type=0x3
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2110)
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:1027)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:794)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.UnsupportedOperationException: Can't convert to dimension: type=0x3
at android.content.res.TypedArray.getDimensionPixelSize(TypedArray.java:463)
at android.support.constraint.ConstraintSet.populateConstraint(ConstraintSet.java:2040)
at android.support.constraint.ConstraintSet.fillFromAttributeList(ConstraintSet.java:1901)
at android.support.constraint.ConstraintSet.load(ConstraintSet.java:1870)
at help.logs.error.constrainterror.MainActivity.onCreate(MainActivity.java:16)
at android.app.Activity.performCreate(Activity.java:5206)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1094)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2074)
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)
I have not found the answer to the question yet but using "mConstraint.clone(this, R.layout.activity_main_second);" instead of "mConstraint.load()" as a work around did the trick.

Plivo API endpoint Exception In Initializer error

03-24 10:51:22.425 20219-20219/com.mordred.call E/AndroidRuntime: FATAL EXCEPTION: main
java.lang.ExceptionInInitializerError
at com.plivo.endpoint.backend.PlivoAppCallback.<init>(PlivoAppCallback.java:114)
at com.plivo.endpoint.BackendListener.<init>(BackendListener.java:28)
at com.plivo.endpoint.Endpoint.initLib(Endpoint.java:150)
at com.plivo.endpoint.Endpoint.<init>(Endpoint.java:47)
at com.plivo.endpoint.Endpoint.newInstance(Endpoint.java:63)
at com.mordred.call.PstnActivity.<init>(PstnActivity.java:46)
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:1036)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:803)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.UnsatisfiedLinkError: Native method not found: com.plivo.endpoint.backend.plivoJNI.swig_module_init:()V
at com.plivo.endpoint.backend.plivoJNI.swig_module_init(Native Method)
at com.plivo.endpoint.backend.plivoJNI.<clinit>(plivoJNI.java:108)
at com.plivo.endpoint.backend.PlivoAppCallback.<init>(PlivoAppCallback.java:114) 
at com.plivo.endpoint.BackendListener.<init>(BackendListener.java:28) 
at com.plivo.endpoint.Endpoint.initLib(Endpoint.java:150) 
at com.plivo.endpoint.Endpoint.<init>(Endpoint.java:47) 
at com.plivo.endpoint.Endpoint.newInstance(Endpoint.java:63) 
at com.mordred.call.PstnActivity.<init>(PstnActivity.java:46) 
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)
I am using the plivo api, but when i open an activity, i get that error above, i know its coming from my endpoint instantiation, i.e i cannot do this
Endpoint endpoint = Endpoint.newInstance(true, this);
but i do not know what to do instead and i do not know what is causing the error
Plivo Sales Engineer here.
What's the processor architecture of the android phone that you're testing on? This error occurs when the libpjplivo.so file is incompatible with the processor architecture.
Please raise a ticket our support portal and we can help you debug this.

Resource not found excpetion for Android Style for Button

I want to set a button style programatically. This means without needing to define an xml file. I thought that by setting the background resource of the button with the predefined style IDs I could do this.
The line of code that fails is:
b1.setBackgroundResource(android.R.style.Widget_DeviceDefault_Light_Button_Borderless_Small);
There is an exception that states
android.content.res.Resources$NotFoundException: Resource ID #0x1030179.
What am I doing wrong?
EDIT:
I have tried to this:
Button b = new Button(context,null,android.R.style.Widget_DeviceDefault_Button_Borderless);
This no longer throws an exception but no real style is applied to the button. There is just text and there is no different states for when its pressed.
EDIT2:
Adding the original stack trace as requested:
03-03 08:17:58.810 5990-5990/legen.dary E/AndroidRuntime﹕ FATAL EXCEPTION: main
java.lang.RuntimeException: Unable to start activity ComponentInfo{legen.dary/legen.dary.MainActivity}: android.content.res.Resources$NotFoundException: Resource ID #0x103016c
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2059)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
at android.app.ActivityThread.access$600(ActivityThread.java:130)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4745)
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:786)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
at dalvik.system.NativeStart.main(Native Method)
Caused by: android.content.res.Resources$NotFoundException: Resource ID #0x103016c
at android.content.res.Resources.getValue(Resources.java:1013)
at android.content.res.Resources.getDrawable(Resources.java:658)
at android.view.View.setBackgroundResource(View.java:14179)
at legen.dary.TitleButtonView.<init>(TitleButtonView.java:24)
at legen.dary.MainActivity.onCreate(MainActivity.java:131)
at android.app.Activity.performCreate(Activity.java:5008)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2023)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
            at android.app.ActivityThread.access$600(ActivityThread.java:130)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
            at android.os.Handler.dispatchMessage(Handler.java:99)
            at android.os.Looper.loop(Looper.java:137)
            at android.app.ActivityThread.main(ActivityThread.java:4745)
            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:786)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
            at dalvik.system.NativeStart.main(Native Method)

Categories

Resources