I wrote the code for this lesson, the application should rotate the FrameLayout at the touch of a button. When you press the same button, the application crashes here:

FATAL EXCEPTION: main java.lang.NumberFormatException: Invalid int: "@2131427329" at java.lang.Integer.invalidInt(Integer.java:138) at java.lang.Integer.parse(Integer.java:375) at java.lang.Integer.parseInt(Integer.java:366) at com.android.internal.util.XmlUtils.convertValueToInt(XmlUtils.java:122) at android.content.res.TypedArray.getInt(TypedArray.java:254) at android.animation.AnimatorInflater.loadAnimator(AnimatorInflater.java:188) at android.animation.AnimatorInflater.loadObjectAnimator(AnimatorInflater.java:161) at android.animation.AnimatorInflater.createAnimatorFromXml(AnimatorInflater.java:117) at android.animation.AnimatorInflater.createAnimatorFromXml(AnimatorInflater.java:126) at android.animation.AnimatorInflater.createAnimatorFromXml(AnimatorInflater.java:93) at android.animation.AnimatorInflater.loadAnimator(AnimatorInflater.java:72) at android.app.FragmentManagerImpl.loadAnimator(FragmentManager.java:738) at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:953) at android.app.FragmentManagerImpl.removeFragment(FragmentManager.java:1162) at android.app.BackStackRecord.run(BackStackRecord.java:639) at android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1435) at android.app.FragmentManagerImpl$1.run(FragmentManager.java:441) at android.os.Handler.handleCallback(Handler.java:730) at android.os.Handler.dispatchMessage(Handler.java:92) 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) 

There is only 1 class in the application and there are no int variables. There are only 2 resources. What could be the error in this case?

  • 2
    Check out the markup of the fragment, where the animation is created. there is somewhere @ at the beginning of the element id. - pavel
  • @pavel so android: id = "@ + id / text" is also impossible? - Amir Shabanov
  • @pavel checked several times all id is normal - Amir Shabanov
  • @pavel you are right only @ was not in id, but in android: duration, there was a link to a resource that contained 2 int values, after changing the link to the corresponding numbers everything worked - Amir Shabanov
  • @pavel taken idea from the Google example, we ought to see why this design worked for them - Amir Shabanov

1 answer 1

NumberFormatExeption in this case means that the string with the number from the resources could not be converted to an integer (the string contains characters not suitable for conversion). See how you indicated the value, you can download the source of their project and compare it with yours.