material design 하려고 며칠째 고생중인데...뭔가 이제 되는것 같아서 기대하면서 빌드후 에뮬레이터가 실되면 앱이 실행되기도 전에 다이얼로그 창?이 뜨면서 (APP이름)가 중지됨 이러한 창을 띄우는데..이러한 경우에는
어디가 문제인지도 모르겠는데..어떻게 오류를 잡아야하나요? 빌드에는 아무런 문제가 없는데 ㅠㅠ
소스를 잠깐 올려드리면
MainActivity.java
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
}
activity_main.xml
<androidx.coordinatorlayout.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.google.android.material.bottomappbar.BottomAppBar
android:id="@+id/bottomAppBar"
android:layout_width="378dp"
android:layout_height="80dp"
/>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
build.gradle
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.0.0-alpha05'
implementation 'com.google.android.material:material:1.1.0-alpha06'
implementation 'androidx.constraintlayout:constraintlayout:1.1.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
BottomAppBar를 추가하는 소스인데요. https://material.io/develop/android/components/bottom-app-bar/
여기껄 보고 실험적으로 되는지 안되는지 보기위해 따라하려고 했습니다.
ConstraintLayout이 안드로이드 스튜디오에서 Empty Project로 생성했을경우 디폴트 레이아웃이기때문에
이 레이아웃을 쓰기위해서 gradle에서 androidx로
바뀐 implementation'androidx.constraintlayout:constraintlayout:1.1.2' 이걸 추가해줬습니다.
그다음 위 링크따라 BottomAppbar를 main xml파일에서 design탭에서 BottomAppBar를 드래그해서
설치해주고.. 되는지 확인하기위해 빌드까지하고 에뮬레이터를 실행했더니..
자꾸 앱을 다시 실행해보라는데...빌드는 잘 되는데 뭐가 문제인지 잘모르겠습니다..ㅠㅠ
도와주세요!