daimajia / daimajia/AndroidViewAnimations
Compiles without problem but crashes on phone with "there is a bug" error message
- Dominant language
- Java
- Stars
- 12.4k
- Forks
- 2.4k
- PR merge metrics
- No merged PRs in 30d
Description
App loads in phone but when pressing the button to start animation program crashes and closes. The phone displays message that the app "has a bug" and crashed. I've checked code against many online tutorials and cannot locate the issue.
MainActivity.java
```
package com.example.textreader6;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import com.daimajia.androidanimations.library.Techniques;
import com.daimajia.androidanimations.library.YoYo;
public class MainActivity extends AppCompatActivity {
Button button;
TextView textView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
button = findViewById(R.id.btn);
textView = findViewById(R.id.textview);
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
YoYo.with(Techniques.Swing).duration(1000).repeat(1).playOn(textView);
}
});
}
}
```
build.gradle:
```
dependencies {
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'com.google.android.material:material:1.6.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'com.daimajia.easing:library:2.0@aar'
implementation 'com.daimajia.androidanimations:library:2.3@aar'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}
```
activity_main.xml:
```
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.