找不到类“ android.support.constraint.ConstraintLayout”

时间:2018-07-29 05:52:05

标签: android-studio-3.0

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.0.0-beta01'
implementation 'androidx.constraintlayout:constraintlayout:1.1.2'

testImplementation 'junit:junit:4.12'
//androidTestImplementation 'androidx.test:runner:1.1.0-beta01'
//androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0-beta01'

implementation 'com.google.android.material:material:1.0.0-beta01'
implementation 'androidx.cardview:cardview:1.0.0-beta01'

我正在尝试使用androidx库。尽管我添加了“ 实现'androidx.constraintlayout:constraintlayout:1.1.2'“我收到此错误。

2 个答案:

答案 0 :(得分:0)

检查您的xml,看看您是否正在使用void updateAppointment(Context context, DatabaseReference reference, int selectedDayIndex, Hour hour, int position) { if (hour.isAvailable()) { hour.setAvailable(false); hour.setBookTime(getCurrentTime()); hour.setUserId(firebaseUser.getUid()); hour.setUserName(firebaseUser.getDisplayName()); } else { hour.setAvailable(true); } reference.child(getChildName()).child(selectedDayIndex + PATH_HOURS + position).setValue(hour) .addOnSuccessListener(aVoid -> showShortToastMsg(context, context.getString(R.string.done_label))) .addOnFailureListener(e -> { showShortToastMsg(context, context.getString(R.string.error_update_firebase_db_msg)); }); }

答案 1 :(得分:0)

只需检查.xml文件。如果您使用的是android.support.constraint.ConstraintLayout,请替换为androidx.constraintlayout.widget.ConstraintLayout