رونمایی از پخته‌ترین و کاربردی‌ترین محصولات آموزشی سون‌لرن با کلی آفرهای ویژه🔥
۰ ثانیه
۰ دقیقه
۰ ساعت
۶ سعید امیراحمدی
ارور هنگام اضافه کردن نستد نویگیشن
جامعه جاوا (اندروید) ایجاد شده در ۱۱ اسفند ۱۴۰۲

بعد از اضافه کردن نستد نویگیشن طبق آموزش برنامه بسته شد و این ارور داد

---------------------------- PROCESS STARTED (10470) for package com.example.myapplication ----------------------------
--------- beginning of system
2024-03-01 08:46:21.419  1938-1938  findSupportedAbi        system_server                        E  com.example.myapplication cost: 0 ms
--------- beginning of main
2024-03-01 08:48:03.179  2068-2068  ResourcesManager        com.android.systemui                 E  failed to add asset path /data/app/com.example.myapplication-1/base.apk
2024-03-01 08:48:03.180  2068-2068  ResourcesManager        com.android.systemui                 E  failed to add asset path /data/app/com.example.myapplication-1/base.apk
2024-03-01 08:48:03.180  2068-2068  ResourcesManager        com.android.systemui                 E  failed to add asset path /data/app/com.example.myapplication-1/base.apk
--------- beginning of crash
2024-03-01 08:48:03.287  4071-4071  AndroidRuntime          pid-4071                             E  FATAL EXCEPTION: main
                                                                                                   Process: com.example.myapplication, PID: 4071
                                                                                                   java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.myapplication/com.example.myapplication.MainActivity}: android.view.InflateException: Binary XML file line #22: Binary XML file line #22: Error inflating class androidx.fragment.app.FragmentContainerView
                                                                                                       at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2666)
                                                                                                       at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2727)
                                                                                                       at android.app.ActivityThread.-wrap12(ActivityThread.java)
                                                                                                       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1478)
                                                                                                       at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                                                       at android.os.Looper.loop(Looper.java:154)
                                                                                                       at android.app.ActivityThread.main(ActivityThread.java:6121)
                                                                                                       at java.lang.reflect.Method.invoke(Native Method)
                                                                                                       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:889)
                                                                                                       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:779)
                                                                                                   Caused by: android.view.InflateException: Binary XML file line #22: Binary XML file line #22: Error inflating class androidx.fragment.app.FragmentContainerView
                                                                                                   Caused by: android.view.InflateException: Binary XML file line #22: Error inflating class androidx.fragment.app.FragmentContainerView
                                                                                                   Caused by: java.lang.IllegalArgumentException: navigation destination com.example.myapplication:id/blankFragment is not a direct child of this NavGraph
                                                                                                       at androidx.navigation.NavGraphNavigator.navigate(NavGraphNavigator.kt:72)
                                                                                                       at androidx.navigation.NavGraphNavigator.navigate(NavGraphNavigator.kt:49)
                                                                                                       at androidx.navigation.NavController.navigateInternal(NavController.kt:260)
                                                                                                       at androidx.navigation.NavController.navigate(NavController.kt:1719)
                                                                                                       at androidx.navigation.NavController.onGraphCreated(NavController.kt:1161)
                                                                                                       at androidx.navigation.NavController.setGraph(NavController.kt:1086)
                                                                                                       at androidx.navigation.NavController.setGraph(NavController.kt:1039)
                                                                                                       at androidx.navigation.fragment.NavHostFragment.onCreate(NavHostFragment.kt:155)
                                                                                                       at androidx.fragment.app.Fragment.performCreate(Fragment.java:3090)
                                                                                                       at androidx.fragment.app.FragmentStateManager.create(FragmentStateManager.java:475)
                                                                                                       at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:257)
                                                                                                       at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:1899)
                                                                                                       at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:1823)
                                                                                                       at androidx.fragment.app.FragmentManager.execSingleAction(FragmentManager.java:1729)
                                                                                                       at androidx.fragment.app.BackStackRecord.commitNowAllowingStateLoss(BackStackRecord.java:323)
                                                                                                       at androidx.fragment.app.FragmentContainerView.<init>(FragmentContainerView.kt:158)
                                                                                                       at androidx.fragment.app.FragmentLayoutInflaterFactory.onCreateView(FragmentLayoutInflaterFactory.java:53)
                                                                                                       at androidx.fragment.app.FragmentController.onCreateView(FragmentController.java:136)
                                                                                                       at androidx.fragment.app.FragmentActivity.dispatchFragmentsOnCreateView(FragmentActivity.java:248)
                                                                                                       at androidx.fragment.app.FragmentActivity.onCreateView(FragmentActivity.java:227)
                                                                                                       at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:777)
                                                                                                       at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:727)
                                                                                                       at android.view.LayoutInflater.rInflate(LayoutInflater.java:858)
                                                                                                       at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:821)
                                                                                                       at android.view.LayoutInflater.inflate(LayoutInflater.java:518)
                                                                                                       at android.view.LayoutInflater.inflate(LayoutInflater.java:426)
                                                                                                       at android.view.LayoutInflater.inflate(LayoutInflater.java:377)
                                                                                                       at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:775)
                                                                                                       at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:197)
                                                                                                       at com.example.myapplication.MainActivity.onCreate(MainActivity.java:12)
                                                                                                       at android.app.Activity.performCreate(Activity.java:6760)
                                                                                                       at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)
2024-03-01 08:48:30.283  4196-4196  AndroidRuntime          pid-4196                             E  FATAL EXCEPTION: main
                                                                                                   Process: com.example.myapplication, PID: 4196
                                                                                                   java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.myapplication/com.example.myapplication.MainActivity}: android.view.InflateException: Binary XML file line #22: Binary XML file line #22: Error inflating class androidx.fragment.app.FragmentContainerView
                                                                                                       at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2666)
                                                                                                       at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2727)
                                                                                                       at android.app.ActivityThread.-wrap12(ActivityThread.java)
                                                                                                       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1478)
                                                                                                       at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                                                       at android.os.Looper.loop(Looper.java:154)
                                                                                                       at android.app.ActivityThread.main(ActivityThread.java:6121)
                                                                                                       at java.lang.reflect.Method.invoke(Native Method)
                                                                                                       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:889)
                                                                                                       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:779)
                                                                                                   Caused by: android.view.InflateException: Binary XML file line #22: Binary XML file line #22: Error inflating class androidx.fragment.app.FragmentContainerView
                                                                                                   Caused by: android.view.InflateException: Binary XML file line #22: Error inflating class androidx.fragment.app.FragmentContainerView
                                                                                                   Caused by: java.lang.IllegalArgumentException: navigation destination com.example.myapplication:id/blankFragment is not a direct child of this NavGraph
                                                                                                       at androidx.navigation.NavGraphNavigator.navigate(NavGraphNavigator.kt:72)
                                                                                                       at androidx.navigation.NavGraphNavigator.navigate(NavGraphNavigator.kt:49)
                                                                                                       at androidx.navigation.NavController.navigateInternal(NavController.kt:260)
                                                                                                       at androidx.navigation.NavController.navigate(NavController.kt:1719)
                                                                                                       at androidx.navigation.NavController.onGraphCreated(NavController.kt:1161)
                                                                                                       at androidx.navigation.NavController.setGraph(NavController.kt:1086)
   
 

سلام،
مطمئن شو که blankFragment به عنوان یک مقصد (destination) در فایل NavGraph XML شما تعریف شده و همچنین بررسی کنید که FragmentContainerView در فایل layout به درستی تعریف شده و به NavGraph مرتبط است.

درضمن آخرین ورژن از Navigation Component رو در فایل build.gradle اضافه کنید.

محسن موحد ۱۴ اسفند ۱۴۰۲، ۰۰:۲۸

در مورد اول متوجه نشدم blank fragment چرا بعنوان مقصد باشه

مگه nested navigation نباید مقصد باشه؟

-------------------

در مورد آپدیت اگر از آخرین ورژن استفاده کنم در فایل NavGraph 

در تگ فرگمنت 

نیم رو قرمز میکنه و  وقتی با موس میرم روش ارور 

is not valid destination for tag fragment

نمایش میده

-------

FragmentContainerView بررسی کردم درست بود و ارتباط با navgraph داشت

سعید امیراحمدی ۱۴ اسفند ۱۴۰۲، ۱۷:۲۹

موقع بیلد گرفتن این ارور رو داد

سعید امیراحمدی ۱۴ اسفند ۱۴۰۲، ۱۸:۲۳

Duplicate class kotlin.collections.jdk8.CollectionsJDK8Kt found in modules kotlin-stdlib-1.8.22 (org.jetbrains.kotlin:kotlin-stdlib:1.8.22) and kotlin-stdlib-jdk8-1.6.21 (org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.21)
Duplicate class kotlin.internal.jdk7.JDK7PlatformImplementations found in modules kotlin-stdlib-1.8.22 (org.jetbrains.kotlin:kotlin-stdlib:1.8.22) and kotlin-stdlib-jdk7-1.6.21 (org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.6.21)
Duplicate class kotlin.internal.jdk7.JDK7PlatformImplementations$ReflectSdkVersion found in modules kotlin-stdlib-1.8.22 (org.jetbrains.kotlin:kotlin-stdlib:1.8.22) and kotlin-stdlib-jdk7-1.6.21 (org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.6.21)
Duplicate class kotlin.internal.jdk8.JDK8PlatformImplementations found in modules kotlin-stdlib-1.8.22 (org.jetbrains.kotlin:kotlin-stdlib:1.8.22) and kotlin-stdlib-jdk8-1.6.21 (org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.21)
Duplicate class kotlin.internal.jdk8.JDK8PlatformImplementations$ReflectSdkVersion found in modules kotlin-stdlib-1.8.22 (org.jetbrains.kotlin:kotlin-stdlib:1.8.22) and kotlin-stdlib-jdk8-1.6.21 (org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.21)
Duplicate class kotlin.io.path.ExperimentalPathApi found in modules kotlin-stdlib-1.8.22 (org.jetbrains.kotlin:kotlin-stdlib:1.8.22) and kotlin-stdlib-jdk7-1.6.21 (org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.6.21)
Duplicate class kotlin.io.path.PathRelativizer found in modules kotlin-stdlib-1.8.22 (org.jetbrains.kotlin:kotlin-stdlib:1.8.22) and kotlin-stdlib-jdk7-1.6.21 (org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.6.21)
Duplicate class kotlin.io.path.PathsKt found in modules kotlin-stdlib-1.8.22 (org.jetbrains.kotlin:kotlin-stdlib:1.8.22) and kotlin-stdlib-jdk7-1.6.21 (org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.6.21)
Duplicate class kotlin.io.path.PathsKt__PathReadWriteKt found in modules kotlin-stdlib-1.8.22 (org.jetbrains.kotlin:kotlin-stdlib:1.8.22) and kotlin-stdlib-jdk7-1.6.21 (org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.6.21)
Duplicate class kotlin.io.path.PathsKt__PathUtilsKt found in modules kotlin-stdlib-1.8.22 (org.jetbrains.kotlin:kotlin-stdlib:1.8.22) and kotlin-stdlib-jdk7-1.6.21 (org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.6.21)
Duplicate class kotlin.jdk7.AutoCloseableKt found in modules kotlin-stdlib-1.8.22 (org.jetbrains.kotlin:kotlin-stdlib:1.8.22) and kotlin-stdlib-jdk7-1.6.21 (org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.6.21)
Duplicate class kotlin.jvm.jdk8.JvmRepeatableKt found in modules kotlin-stdlib-1.8.22 (org.jetbrains.kotlin:kotlin-stdlib:1.8.22) and kotlin-stdlib-jdk8-1.6.21 (org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.21)
Duplicate class kotlin.random.jdk8.PlatformThreadLocalRandom found in modules kotlin-stdlib-1.8.22 (org.jetbrains.kotlin:kotlin-stdlib:1.8.22) and kotlin-stdlib-jdk8-1.6.21 (org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.21)
Duplicate class kotlin.streams.jdk8.StreamsKt found in modules kotlin-stdlib-1.8.22 (org.jetbrains.kotlin:kotlin-stdlib:1.8.22) and kotlin-stdlib-jdk8-1.6.21 (org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.21)
Duplicate class kotlin.streams.jdk8.StreamsKt$asSequence$$inlined$Sequence$1 found in modules kotlin-stdlib-1.8.22 (org.jetbrains.kotlin:kotlin-stdlib:1.8.22) and kotlin-stdlib-jdk8-1.6.21 (org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.21)
Duplicate class kotlin.streams.jdk8.StreamsKt$asSequence$$inlined$Sequence$2 found in modules kotlin-stdlib-1.8.22 (org.jetbrains.kotlin:kotlin-stdlib:1.8.22) and kotlin-stdlib-jdk8-1.6.21 (org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.21)
Duplicate class kotlin.streams.jdk8.StreamsKt$asSequence$$inlined$Sequence$3 found in modules kotlin-stdlib-1.8.22 (org.jetbrains.kotlin:kotlin-stdlib:1.8.22) and kotlin-stdlib-jdk8-1.6.21 (org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.21)
Duplicate class kotlin.streams.jdk8.StreamsKt$asSequence$$inlined$Sequence$4 found in modules kotlin-stdlib-1.8.22 (org.jetbrains.kotlin:kotlin-stdlib:1.8.22) and kotlin-stdlib-jdk8-1.6.21 (org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.21)
Duplicate class kotlin.text.jdk8.RegexExtensionsJDK8Kt found in modules kotlin-stdlib-1.8.22 (org.jetbrains.kotlin:kotlin-stdlib:1.8.22) and kotlin-stdlib-jdk8-1.6.21 (org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.21)
Duplicate class kotlin.time.jdk8.DurationConversionsJDK8Kt found in modules kotlin-stdlib-1.8.22 (org.jetbrains.kotlin:kotlin-stdlib:1.8.22) and kotlin-stdlib-jdk8-1.6.21 (org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.21)

Go to the documentation to learn how to Fix dependency resolution errors.
 

سعید امیراحمدی ۱۴ اسفند ۱۴۰۲، ۱۸:۲۴

سلام وقت بخیر این اررور هنگام بیلد مربوط به ورژن جاوای پروژه هست یا مربوط به تداخل ورژن لایبرری و دیپندسی‌های اضافه شده به پروژه هست.

این ورژن‌های دیگه استفاده کنید تا دچار این تداخل نشه

میلاد عزیززاده ۱۵ اسفند ۱۴۰۲، ۰۸:۰۵

از ورژن 2.5.3 استفاده کردم

وقت start destination  رو گذاشتم روی auth_navigatin یا match برنامه بالا اومد (قبلا روی فرگمنت اول یا تایتل اسکرین بود)

ولی مشکلی که هست اینه که وقتی از فرگمنت رجیستر میخوام برم به مچ دوباره بر میگرده به فرگمنت اول

سعید امیراحمدی ۱۵ اسفند ۱۴۰۲، ۱۴:۵۴