سلام عرض شد خسته نباشید همگی دوستان
من وقتی ران میگیرم در اندروید استودیو هیچ اروری مشاهده نمیشه،ولی تو ایمیلیتور اپ اجرا نمیشه و کرش میکنه
مشکل چیه؟!
سلام و احترام
لطفا از log cat قسمت error رو انتخاب کنید و سپس یک بار از اپلیکیشن run گرفته تا ارور در صفحه logcat نمایش داده شود
هنگامی که ارور نمایش داده شد متن ارور رو در اینجا بفرستید .
یا اینکه کد مربوط در main اکیتیوتی رو به صورت عکس یا خود کد ارسال کنید.
اررورتون رو بررسی کردم خط ۳۹ مربوط به لیوتتون رو بررسی کنید .
اگر پیدا نکردید از کد های xml مربوط به activity تان و همینطور کد های جاوا اسکرین شات مربوطه را پیوست کنید.
برای پیوست کردن از دکمه سبز پایین تاپیک استفاده کنید.
من عکس رو حذف کردم به کل بازم فرقی ایجاد نشد
کد ها رو هم اینجا قرار میدم
این کد های main activity جاوا
package com.example.myapplication;
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);
}
}
<?xml version="1.0" encoding="utf-8"?>
<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:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<CheckBox
android:id="@+id/checkBox3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/deepLearning"
app:layout_constraintStart_toStartOf="@+id/guideline3"
app:layout_constraintTop_toBottomOf="@+id/checkBox2" />
<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="100dp"
android:textColor="#000000"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:text="Purya Asghari" />
<Button
android:id="@+id/button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:background="@drawable/button2"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:text="@string/viewWebsite"
app:backgroundTint="@drawable/button2"
app:layout_constraintEnd_toStartOf="@+id/button2"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textView" />
<Button
android:id="@+id/button2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/button1"
android:text="@string/editProfile"
android:textColor="#FFFFFF"
app:backgroundTint="@color/ColorAccent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toEndOf="@+id/button"
app:layout_constraintTop_toTopOf="@+id/button" />
<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:text="@string/skills"
android:textColorHint="@color/gray600"
app:layout_constraintStart_toStartOf="@+id/guideline3"
app:layout_constraintTop_toBottomOf="@+id/button" />
<CheckBox
android:id="@+id/checkBox"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:text="@string/androidDevelopment"
app:layout_constraintStart_toStartOf="@+id/guideline3"
app:layout_constraintTop_toBottomOf="@+id/textView2" />
<CheckBox
android:id="@+id/checkBox2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/uiDesign"
app:layout_constraintStart_toStartOf="@+id/guideline3"
app:layout_constraintTop_toBottomOf="@+id/checkBox" />
<RadioButton
android:id="@+id/radioButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:text="@string/alborzKaraj"
app:layout_constraintStart_toStartOf="@+id/guideline3"
app:layout_constraintTop_toBottomOf="@+id/textView3" />
<RadioButton
android:id="@+id/radioButton2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="56dp"
android:text="@string/gilanRasht"
app:layout_constraintStart_toStartOf="@+id/guideline3"
app:layout_constraintTop_toBottomOf="@+id/textView3" />
<RadioButton
android:id="@+id/radioButton3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="104dp"
android:text="@string/tehran"
app:layout_constraintStart_toStartOf="@+id/guideline3"
app:layout_constraintTop_toBottomOf="@+id/textView3" />
<TextView
android:id="@+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:text="@string/provinceCity"
app:layout_constraintStart_toStartOf="@+id/guideline3"
app:layout_constraintTop_toBottomOf="@+id/checkBox3" />
<Button
android:id="@+id/button3"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:text="@string/saveInformation"
app:backgroundTint="@color/ColorAccent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
<androidx.constraintlayout.widget.Guideline
android:id="@+id/guideline3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_begin="20dp" />
</androidx.constraintlayout.widget.ConstraintLayout>
سلام و احترام
خدمتتون عرض کنم که من کد هاتون رو چک کردم و مشکلی رو ندیدم
من فکر میکنم ارور شما مربوط به پوشه drawable هست و اونم به این دلیل که هنگام کپی عکس یا وکتور از v21 یا v22 استفاده کردید .
که این دو ورژن از اندروید Lolipop به پایین کرش میکنند .
اگر ممکن هست عکسی از صفحه drawable تون پیوست کنین تا من این مشکل رو به شما نشان بدهم.
سلام و احترام
اروری که شما دریافت میکنید مربوط به این قسمت هستند
پیشنهاد من به شما: هنگام در نظر گرفتن نام برای id از اسم های خاص مثلا button استفاده نکنید(سعی کنید طبق اموزش جلو برید) .که علت ارور شما من فکر میکنم از همین نام گذاری ها باشد .
اگر نبود همین قسمت از کد که براتون در خط زیر ار پروژه خودتون قرار میدم خط به خط پاک کنید تا ارور رو شناسایی کنین ارور شما مربوط به خط #39 xml هست که اجازه inflate شدن لیوت را نمیدهد.
<Button
android:id="@+id/button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:background="@drawable/button2"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:text="@string/viewWebsite"
app:backgroundTint="@drawable/button2"
app:layout_constraintEnd_toStartOf="@+id/button2"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textView" />
<Button
android:id="@+id/button2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/button1"
android:text="@string/editProfile"
android:textColor="#FFFFFF"
app:backgroundTint="@color/ColorAccent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toEndOf="@+id/button"
app:layout_constraintTop_toTopOf="@+id/button" />
سلام عرض شد خدمت اقای شفیعی عزیز
بنده خودم مشکل رو پیدا کردم چی بود و مربوط به این بود که Button که برای View Website ست شده بود و دارای Stroke بود مشکل داشت،چون من مطابق آموزش در قسمت بک گراند کد @drawbale/"id" رو قرار میدادم،ولی خب stroke اعمال نمیشد،برا همین این کد رو در قسمت Background Tint قرار دادم و Stroke اعمال شد ولی نرم افزار داخل شبیه ساز کرش میکرد که با پاک کردن این کد در قسمت بکگراند تینت مشکل رفع شد
ولی خب الان مشکلی که هست نمیشه Stroke رو اعمال کنم،چاره چیه؟!
درضمن داخل شاتی که پیوست میشه اسم id ها رو همان طور که گفتین تغییر دادم
خسته نباشید اقای شفیعی عزیز،طبق آموزش کد های xml رو قرار میدم ولی خب بازم stroke اعمال نمیشه
مشکل از کجاست؟!