我在约束布局上收到膨胀异常,我不知道为什么



我的消息传递应用程序收到一个膨胀异常。我正在尝试使用户发送的消息向右对齐,收到的消息向左对齐。我使用本教程作为指南,但我不确定为什么我会收到它,非常感谢任何帮助。

我尝试将 Gradle 更新到 4.3.0,但这给了我一个不同的错误。

activity_subject_group_page.xml

<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/txtUsernameAdminStudentPage"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".SubjectGroupPage">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rvMessagesSubjectGroupPage"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintBottom_toTopOf="@+id/linearLayoutMessageInput"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/linearLayout"
app:layout_constraintVertical_bias="1.0">
</androidx.recyclerview.widget.RecyclerView>
</androidx.constraintlayout.widget.ConstraintLayout>

list_item_right.xml

<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="8dp">
<TextView
android:id="@+id/text_message_body"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxWidth="240dp"
android:padding="8dp"
android:textColor="#ffffff"
android:layout_marginRight="8dp"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/text_message_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="10sp"
android:layout_marginRight="4dp"
app:layout_constraintBottom_toBottomOf="@+id/text_message_body"
app:layout_constraintRight_toLeftOf="@+id/text_message_body" />
</android.support.constraint.ConstraintLayout>

list_item_left.xml

<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout 
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="8dp">
<TextView
android:id="@+id/text_message_name"
android:layout_width="157dp"
android:layout_height="49dp"
android:layout_marginLeft="8dp"
android:layout_marginTop="4dp"
android:textSize="12sp"
app:layout_constraintLeft_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/text_message_body"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginTop="4dp"
android:maxWidth="240dp"
android:padding="8dp"
android:textColor="#ffffff"
app:layout_constraintLeft_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@+id/text_message_name" />
<TextView
android:id="@+id/text_message_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="4dp"
android:textSize="10sp"
app:layout_constraintBottom_toBottomOf="@+id/text_message_body"
app:layout_constraintLeft_toRightOf="@+id/text_message_body" />
</android.support.constraint.ConstraintLayout>

消息对象.java

public class MessageObj {
private String message;
private String sender;
private String senderName;
private Timestamp timesent;
private boolean isCurrentUser;
public MessageObj() {}
public MessageObj(String message, String sender, String senderName, 
Timestamp timesent, boolean isCurrentUser) {
this.message = message;
this.sender = sender;
this.senderName = senderName;
this.timesent = timesent;
this.isCurrentUser = isCurrentUser;
}
public String getMessage() { return message; }
public String getSender() { return sender; }
public String getSenderName() { return senderName; }
public Timestamp getTimesent() { return timesent; }
public boolean getIsCurrentUser() { return isCurrentUser; }
}

发送消息持有者.java

public class SentMessageHolder extends RecyclerView.ViewHolder {
TextView messageText, timeText, nameText;
SentMessageHolder(View itemView) {
super(itemView);
messageText = (TextView) 
itemView.findViewById(R.id.text_message_body);
timeText = (TextView) itemView.findViewById(R.id.text_message_time);
nameText = (TextView) itemView.findViewById(R.id.text_message_name);
}
void bind(MessageObj message) {
messageText.setText(message.getMessage());
timeText.setText("" + message.getTimesent());
}
}

收到消息持有人.java

public class ReceivedMessageHolder extends RecyclerView.ViewHolder {
TextView messageText, timeText, nameText;
ReceivedMessageHolder(View itemView) {
super(itemView);
messageText = (TextView) 
itemView.findViewById(R.id.text_message_body);
timeText = (TextView) itemView.findViewById(R.id.text_message_time);
nameText = (TextView) itemView.findViewById(R.id.text_message_name);
}
void bind(MessageObj message) {
messageText.setText(message.getMessage());
timeText.setText("" + message.getTimesent());
nameText.setText(message.getSenderName());
}
}

消息列表适配器.java

public class MessageListAdapter extends RecyclerView.Adapter {
private static final int VIEW_TYPE_MESSAGE_SENT = 1;
private static final int VIEW_TYPE_MESSAGE_RECEIVED = 2;
private Context mContext;
private List<MessageObj> mMessageList;
public MessageListAdapter(Context context, List<MessageObj> messageList) 
{
mContext = context;
mMessageList = messageList;
}
@Override
public int getItemCount() {
return mMessageList.size();
}
// Determines the appropriate ViewType according to the sender of the message.
@Override
public int getItemViewType(int position) {
if (mMessageList.get(position).getSender().equals(FirebaseAuth.getInstance().getCurrentUser().getUid())) {
// If the current user is the sender of the message
return VIEW_TYPE_MESSAGE_SENT;
} else {
// If some other user sent the message
return VIEW_TYPE_MESSAGE_RECEIVED;
}
}
// Inflates the appropriate layout according to the ViewType.
public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View view;
if (viewType == VIEW_TYPE_MESSAGE_SENT) {
view = LayoutInflater.from(parent.getContext()).inflate(R.layout.list_item_right, parent, false);
return new SentMessageHolder(view);
} else if (viewType == VIEW_TYPE_MESSAGE_RECEIVED) {
view = LayoutInflater.from(parent.getContext()).inflate(R.layout.list_item_left, parent, false);
return new ReceivedMessageHolder(view);
}
return null;
}
// Passes the message object to a ViewHolder so that the contents can be bound to UI.
@Override
public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
MessageObj message = (MessageObj) mMessageList.get(position);
switch (holder.getItemViewType()) {
case VIEW_TYPE_MESSAGE_SENT:
((SentMessageHolder) holder).bind(message);
break;
case VIEW_TYPE_MESSAGE_RECEIVED:
((ReceivedMessageHolder) holder).bind(message);
}
}
private class SentMessageHolder extends RecyclerView.ViewHolder {
TextView messageText, timeText;
SentMessageHolder(View itemView) {
super(itemView);
messageText = (TextView) itemView.findViewById(R.id.text_message_body);
timeText = (TextView) itemView.findViewById(R.id.text_message_time);
}
void bind(MessageObj message) {
messageText.setText(message.getMessage());
// Format the stored timestamp into a readable String using method.
timeText.setText("" + message.getTimesent());
}
}
private class ReceivedMessageHolder extends RecyclerView.ViewHolder {
TextView messageText, timeText, nameText;
ReceivedMessageHolder(View itemView) {
super(itemView);
messageText = (TextView) itemView.findViewById(R.id.text_message_body);
timeText = (TextView) itemView.findViewById(R.id.text_message_time);
nameText = (TextView) itemView.findViewById(R.id.text_message_name);
}
void bind(MessageObj message) {
messageText.setText(message.getMessage());
// Format the stored timestamp into a readable String using method.
timeText.setText("" + message.getTimesent());
nameText.setText(message.getSenderName());
}
}
}

主题组页面.java

public class SubjectGroupPage extends AppCompatActivity {
private TextView mTextMessage;
private static final String TAG = "SubjectGroupPage.java";
private final FirebaseFirestore db = FirebaseFirestore.getInstance();
private FirebaseAuth mAuth = FirebaseAuth.getInstance();
private final FirebaseUser currentUser = mAuth.getCurrentUser();
public static final String MyPREFERENCES = "MyPrefs";
SharedPreferences sharedpreferences;
private RecyclerView mMessageRecycler;
private MessageListAdapter mMessageAdapter;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_subject_group_page);
BottomNavigationView navView = findViewById(R.id.nav_view);
mTextMessage = findViewById(R.id.message);
navView.setOnNavigationItemSelectedListener(mOnNavigationItemSelectedListener);
Intent intent = getIntent();
final String studentName = intent.getStringExtra("studentName");
BottomNavigationItemView navigationHome = (BottomNavigationItemView) findViewById(R.id.navigationHome);
BottomNavigationItemView navigationNotifications = (BottomNavigationItemView) findViewById(R.id.navigationNotifications);
final RecyclerView rvMessagesSubjectGroupPage = (RecyclerView) findViewById(R.id.rvMessagesSubjectGroupPage);
mMessageRecycler = (RecyclerView) findViewById(R.id.rvMessagesSubjectGroupPage);
mMessageRecycler.setLayoutManager(new LinearLayoutManager(this));

navigationHome.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent i = new Intent(view.getContext(), StudentInfoPage.class);
startActivity(i);
}
});
navigationNotifications.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent i = new Intent(view.getContext(), SubjectGroupPage.class);
startActivity(i);
}
});
btnSubjectInfoSubjectGroupPage.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent i = new Intent(view.getContext(), SubjectInfoPage.class);
startActivity(i);
}
});
btnSendMessageSubjectGroupPage.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
String message = edtMessageInputSubjectGroupPage.getText().toString();
sendMessage(message, studentName);
edtMessageInputSubjectGroupPage.setText("");
}
});
rvMessagesSubjectGroupPage.setLayoutManager(new LinearLayoutManager(this, RecyclerView.VERTICAL, true));
final ArrayList<MessageObj> messages = new ArrayList<>();
ArrayList<MessageObj> messagesAdap = readMessages(rvMessagesSubjectGroupPage, messages);
mMessageAdapter = new MessageListAdapter(this, messagesAdap);
rvMessagesSubjectGroupPage.setAdapter(mMessageAdapter);
}
public ArrayList<MessageObj> readMessages(final RecyclerView rv, final ArrayList<MessageObj> messages) {
db.collection("messagesIT")
.orderBy("Timesent", Query.Direction.DESCENDING)
.get()
.addOnCompleteListener(new OnCompleteListener<QuerySnapshot>() {
@Override
public void onComplete(@NonNull Task<QuerySnapshot> task) {
if (task.isSuccessful()) {
for (QueryDocumentSnapshot document : task.getResult()) {
String message = document.getString("Message");
String senderName = document.getString("SenderName");
String sender = document.getString("Sender");
Timestamp timesent = document.getTimestamp("Timesent");
MessageObj mess;
sharedpreferences = getSharedPreferences(MyPREFERENCES, Context.MODE_PRIVATE);
SharedPreferences.Editor editor = sharedpreferences.edit();
if (currentUser.getUid().equals(sender)) {
mess = new MessageObj(message, sender, senderName, timesent, true);
editor.putBoolean("isCurrentUser", true);
editor.commit();
} else {
mess = new MessageObj(message, sender, senderName, timesent, false);
editor.putBoolean("isCurrentUser", false);
editor.commit();
}
messages.add(mess);
Log.d(TAG, "mmmmm: " + mess.getMessage());
Log.d(TAG, "sssss: " + mess.getSender());
Log.d(TAG, "ttttt:" + mess.getTimesent());
showToast("b");
}
} else {
Log.d(TAG, "Error getting documents: ", task.getException());
}
}
}).addOnFailureListener(new OnFailureListener() {
@Override
public void onFailure(@NonNull Exception e) {
showToast("There has been an error, please try again later.");
Log.d(TAG, "Error: " + e);
}
});
return messages;
}
public void sendMessage(String msg, String studentName) {
SharedPreferences pref = getPreferences(Context.MODE_PRIVATE);
//Message Details
Map<String, Object> messageMap = new HashMap<>();
messageMap.put("Message", msg);
messageMap.put("Timesent", new Timestamp(new Date()));
messageMap.put("Sender", currentUser.getUid());
messageMap.put("SenderName", studentName);
// Add a new document with a generated ID with user details
db.collection("messagesIT")
.add(messageMap)
.addOnSuccessListener(new OnSuccessListener<DocumentReference>() {
@Override
public void onSuccess(DocumentReference documentReference) {
Log.d(TAG, "Sending message was a success");
}
}).addOnFailureListener(new OnFailureListener() {
@Override
public void onFailure(@NonNull Exception e) {
Log.d(TAG, "There was an error sending the message");
}
});
}
}

项目级构建.gradle

buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.2'
classpath 'com.google.gms:google-services:4.2.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}

应用程序级 build.gradle

apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 29
defaultConfig {
applicationId "oxley.it.collectivelearning"
minSdkVersion 17
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'com.google.android.material:material:1.0.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.vectordrawable:vectordrawable:1.0.1'
implementation 'com.google.firebase:firebase-messaging:17.3.4'
implementation 'com.google.firebase:firebase-auth:17.0.0'
implementation 'com.google.firebase:firebase-storage:16.0.4'
implementation 'com.google.firebase:firebase-firestore:17.1.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation "androidx.constraintlayout:constraintlayout:1.1.3"
}

错误

E/AndroidRuntime: FATAL EXCEPTION: main
Process: oxley.it.collectivelearning, PID: 18952
android.view.InflateException: Binary XML file line #3: Binary XML file line #3: Error inflating class android.support.constraint.ConstraintLayout
Caused by: android.view.InflateException: Binary XML file line #3: Error inflating class android.support.constraint.ConstraintLayout
Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.constraint.ConstraintLayout" on path: DexPathList[[zip file "/data/app/oxley.it.collectivelearning-rBOYhtuR1Jj1cYDk7OIxvg==/base.apk", zip file "/data/app/oxley.it.collectivelearning-rBOYhtuR1Jj1cYDk7OIxvg==/split_lib_dependencies_apk.apk", zip file "/data/app/oxley.it.collectivelearning-rBOYhtuR1Jj1cYDk7OIxvg==/split_lib_resources_apk.apk", zip file "/data/app/oxley.it.collectivelearning-rBOYhtuR1Jj1cYDk7OIxvg==/split_lib_slice_0_apk.apk", zip file "/data/app/oxley.it.collectivelearning-rBOYhtuR1Jj1cYDk7OIxvg==/split_lib_slice_1_apk.apk", zip file "/data/app/oxley.it.collectivelearning-rBOYhtuR1Jj1cYDk7OIxvg==/split_lib_slice_2_apk.apk", zip file "/data/app/oxley.it.collectivelearning-rBOYhtuR1Jj1cYDk7OIxvg==/split_lib_slice_3_apk.apk", zip file "/data/app/oxley.it.collectivelearning-rBOYhtuR1Jj1cYDk7OIxvg==/split_lib_slice_4_apk.apk", zip file "/data/app/oxley.it.collectivelearning-rBOYhtuR1Jj1cYDk7OIxvg==/split_lib_slice_5_apk.apk", zip file "/data/app/oxley.it.collectivelearning-rBOYhtuR1Jj1cYDk7OIxvg==/split_lib_slice_6_apk.apk", zip file "/data/app/oxley.it.collectivelearning-rBOYhtuR1Jj1cYDk7OIxvg==/split_lib_slice_7_apk.apk", zip file "/data/app/oxley.it.collectivelearning-rBOYhtuR1Jj1cYDk7OIxvg==/split_lib_slice_8_apk.apk", zip file "/data/app/oxley.it.collectivelearning-rBOYhtuR1Jj1cYDk7OIxvg==/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/data/app/oxley.it.collectivelearning-rBOYhtuR1Jj1cYDk7OIxvg==/lib/arm64, /system/lib64, /vendor/lib64]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:125)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at android.view.LayoutInflater.createView(LayoutInflater.java:606)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:797)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:737)
at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
at oxley.it.collectivelearning.MessageListAdapter.onCreateViewHolder(MessageListAdapter.java:53)
at androidx.recyclerview.widget.RecyclerView$Adapter.createViewHolder(RecyclerView.java:6794)
at androidx.recyclerview.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline(RecyclerView.java:5975)
at androidx.recyclerview.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5858)
at androidx.recyclerview.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5854)
at androidx.recyclerview.widget.LinearLayoutManager$LayoutState.next(LinearLayoutManager.java:2230)
at androidx.recyclerview.widget.LinearLayoutManager.layoutChunk(LinearLayoutManager.java:1557)
at androidx.recyclerview.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1517)
at androidx.recyclerview.widget.LinearLayoutManager.onLayoutChildren(LinearLayoutManager.java:587)
at androidx.recyclerview.widget.RecyclerView.dispatchLayoutStep2(RecyclerView.java:3924)
at androidx.recyclerview.widget.RecyclerView.onMeasure(RecyclerView.java:3336)
at android.view.View.measure(View.java:22468)
at androidx.constraintlayout.widget.ConstraintLayout.internalMeasureChildren(ConstraintLayout.java:1227)
at 

androidx.constraintlayout.widget.ConstraintLayout.onMeasure(ConstraintLayout.java:1572)
at android.view.View.measure(View.java:22468)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6794)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:185)
E/AndroidRuntime: at 
androidx.appcompat.widget.ContentFrameLayout.onMeasure(ContentFrameLayout.java:143)
at android.view.View.measure(View.java:22468)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6794)
at 
androidx.appcompat.widget.ActionBarOverlayLayout.onMeasure(ActionBarOverlayLayout.java:401)
at android.view.View.measure(View.java:22468)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6794)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:185)
at android.view.View.measure(View.java:22468)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6794)
at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1514)
at android.widget.LinearLayout.measureVertical(LinearLayout.java:806)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:685)
at android.view.View.measure(View.java:22468)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6794)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:185)
at com.android.internal.policy.DecorView.onMeasure(DecorView.java:807)
at android.view.View.measure(View.java:22468)
at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:2833)
at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1771)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2043)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1659)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7596)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:920)
at android.view.Choreographer.doCallbacks(Choreographer.java:732)
at android.view.Choreographer.doFrame(Choreographer.java:664)
at 
android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:906)
at android.os.Handler.handleCallback(Handler.java:790)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:187)
at android.app.ActivityThread.main(ActivityThread.java:7025)
at java.lang.reflect.Method.invoke(Native Method)
at 
com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:514)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:888)
Suppressed: java.io.IOException: No original dex files found for dex 
location /data/app/oxley.it.collectivelearning-rBOYhtuR1Jj1cYDk7OIxvg==/split_lib_resources_apk.apk
at dalvik.system.DexFile.openDexFileNative(Native Method)
at dalvik.system.DexFile.openDexFile(DexFile.java:353)
at dalvik.system.DexFile.<init>(DexFile.java:100)
at dalvik.system.DexFile.<init>(DexFile.java:74)
at dalvik.system.DexPathList.loadDexFile(DexPathList.java:374)
at dalvik.system.DexPathList.makeDexElements(DexPathList.java:337)
at dalvik.system.DexPathList.<init>(DexPathList.java:157)
at dalvik.system.BaseDexClassLoader.<init>(BaseDexClassLoader.java:65)
at dalvik.system.PathClassLoader.<init>(PathClassLoader.java:64)
at 
com.android.internal.os.ClassLoaderFactory.createClassLoader(ClassLoaderFactory.java:73)
at 
com.android.internal.os.ClassLoaderFactory.createClassLoader(ClassLoaderFactory.java:88)
at 
android.app.ApplicationLoaders.getClassLoader(ApplicationLoaders.java:69)
at 
android.app.ApplicationLoaders.getClassLoader(ApplicationLoaders.java:35)
at 
android.app.LoadedApk.createOrUpdateClassLoaderLocked(LoadedApk.java:743)
at android.app.LoadedApk.getClassLoader(LoadedApk.java:777)
at android.app.LoadedApk.getResources(LoadedApk.java:1017)
at android.app.ContextImpl.createAppContext(ContextImpl.java:2390)
at 
android.app.ActivityThread.handleBindApplication(ActivityThread.java:6069)
at android.app.ActivityThread.-wrap1(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1861)
at android.os.Handler.dispatchMessage(Handler.java:106)
... 5 more

只需替换list_item_left.xml

<android.support.constraint.ConstraintLayout>

<androidx.constraintlayout.widget.ConstraintLayout>

相关内容

最新更新