Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Library not working for me #11

Open
manpreetsinghsodhi opened this issue Apr 28, 2015 · 4 comments
Open

Library not working for me #11

manpreetsinghsodhi opened this issue Apr 28, 2015 · 4 comments

Comments

@manpreetsinghsodhi
Copy link

I tried to use this library in my project. I added your library dependency and tried to use the following code
new BounceAnimation(yourView)
.setBounceDistance(50)
.setBounces(5)
.setDuration(500)
.animate();
with my imageview but it is giving me following error

04-28 12:07:50.211: E/AndroidRuntime(487): FATAL EXCEPTION: main
04-28 12:07:50.211: E/AndroidRuntime(487): java.lang.NoSuchFieldError: android.view.View.SCALE_X
04-28 12:07:50.211: E/AndroidRuntime(487): at com.easyandroidanimations.library.ScaleInAnimation.getAnimatorSet(ScaleInAnimation.java:48)
04-28 12:07:50.211: E/AndroidRuntime(487): at com.easyandroidanimations.library.ParallelAnimator.animate(ParallelAnimator.java:58)
04-28 12:07:50.211: E/AndroidRuntime(487): at com.example.nanocarnavigator.MainActivity.onCreate(MainActivity.java:26)
04-28 12:07:50.211: E/AndroidRuntime(487): at android.app.Activity.performCreate(Activity.java:4397)
04-28 12:07:50.211: E/AndroidRuntime(487): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1048)
04-28 12:07:50.211: E/AndroidRuntime(487): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1779)
04-28 12:07:50.211: E/AndroidRuntime(487): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1831)
04-28 12:07:50.211: E/AndroidRuntime(487): at android.app.ActivityThread.access$500(ActivityThread.java:122)
04-28 12:07:50.211: E/AndroidRuntime(487): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1024)
04-28 12:07:50.211: E/AndroidRuntime(487): at android.os.Handler.dispatchMessage(Handler.java:99)
04-28 12:07:50.211: E/AndroidRuntime(487): at android.os.Looper.loop(Looper.java:132)
04-28 12:07:50.211: E/AndroidRuntime(487): at android.app.ActivityThread.main(ActivityThread.java:4123)
04-28 12:07:50.211: E/AndroidRuntime(487): at java.lang.reflect.Method.invokeNative(Native Method)
04-28 12:07:50.211: E/AndroidRuntime(487): at java.lang.reflect.Method.invoke(Method.java:491)
04-28 12:07:50.211: E/AndroidRuntime(487): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:841)
04-28 12:07:50.211: E/AndroidRuntime(487): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:599)
04-28 12:07:50.211: E/AndroidRuntime(487): at dalvik.system.NativeStart.main(Native Method)

Here is xml of mainactivity

<ImageView
    android:id="@+id/img"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:scaleType="fitXY"
    android:src="@drawable/screen1"
   />

Can you help me why it is giving exception?

@umairvatao
Copy link
Contributor

What is the Android version of your test device? The library is not supposed to work below ICS.

@manpreetsinghsodhi
Copy link
Author

<uses-sdk
    android:minSdkVersion="13"
    android:targetSdkVersion="21" />

@umairvatao
Copy link
Contributor

Can you try minSdkVersion="14" and also can you provide more details about your test device.

@manpreetsinghsodhi
Copy link
Author

Yes you were right. Library worked for 14 and above and i tried two samples

  1. new BounceAnimation(yourView).animate(); (which worked)
  2. new ExplodeAnimation(yourView)
    .setExplodeMatrix(ExplodeAnimation.MATRIX_2X2)
    .setInterpolator(new DecelerateInterpolator())
    .setDuration(500)
    .setListener(new AnimationListener() {
    @OverRide
    public void onAnimationEnd(Animation animation) {
    perform your own functions here when animation ends
    }
    })
    .animate();

The second one didint worked for me with following exception

04-28 16:50:19.206: E/AndroidRuntime(15064): FATAL EXCEPTION: main
04-28 16:50:19.206: E/AndroidRuntime(15064): Process: com.example.nanocarnavigator, PID: 15064
04-28 16:50:19.206: E/AndroidRuntime(15064): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.nanocarnavigator/com.example.nanocarnavigator.MainActivity}: java.lang.NullPointerException
04-28 16:50:19.206: E/AndroidRuntime(15064): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2252)
04-28 16:50:19.206: E/AndroidRuntime(15064): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2301)
04-28 16:50:19.206: E/AndroidRuntime(15064): at android.app.ActivityThread.access$800(ActivityThread.java:144)
04-28 16:50:19.206: E/AndroidRuntime(15064): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1246)
04-28 16:50:19.206: E/AndroidRuntime(15064): at android.os.Handler.dispatchMessage(Handler.java:106)
04-28 16:50:19.206: E/AndroidRuntime(15064): at android.os.Looper.loop(Looper.java:136)
04-28 16:50:19.206: E/AndroidRuntime(15064): at android.app.ActivityThread.main(ActivityThread.java:5196)
04-28 16:50:19.206: E/AndroidRuntime(15064): at java.lang.reflect.Method.invokeNative(Native Method)
04-28 16:50:19.206: E/AndroidRuntime(15064): at java.lang.reflect.Method.invoke(Method.java:515)
04-28 16:50:19.206: E/AndroidRuntime(15064): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
04-28 16:50:19.206: E/AndroidRuntime(15064): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:602)
04-28 16:50:19.206: E/AndroidRuntime(15064): at dalvik.system.NativeStart.main(Native Method)
04-28 16:50:19.206: E/AndroidRuntime(15064): Caused by: java.lang.NullPointerException
04-28 16:50:19.206: E/AndroidRuntime(15064): at com.easyandroidanimations.library.ExplodeAnimation.animate(ExplodeAnimation.java:73)
04-28 16:50:19.206: E/AndroidRuntime(15064): at com.example.nanocarnavigator.MainActivity.onCreate(MainActivity.java:34)
04-28 16:50:19.206: E/AndroidRuntime(15064): at android.app.Activity.performCreate(Activity.java:5240)
04-28 16:50:19.206: E/AndroidRuntime(15064): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1088)
04-28 16:50:19.206: E/AndroidRuntime(15064): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2216)
04-28 16:50:19.206: E/AndroidRuntime(15064): ... 11 more
What i did was nothing more than putting your demonstration code for explode animation in my activity on create method

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants