Obsolete
Status Update
Comments
mt...@gmail.com <mt...@gmail.com> #2
I'd like to add that this automatic removal of the NavGraph at the top of the stack is also making it hard for me to implement proper lateral top-level navigation.
A practical case where this kind of navigation happens is with a Material Design bottom navigation bar, where I have a NavHost above the bottom bar.
Given this navigation scheme:
A - B (top-level)
B1 (first sub-level)
When starting the Activity, the back stack is
0. A
1. NavGraph
If I wanted to navigate to B laterally, I would do:
navController.popBackStack(R.id.navGraph, false)
navController.navigate(R.id.B)
But the resulting back stack is:
0. B
Now, navigating between top-level destinations actually works (though popBackStack returns false); the problem arises again if I navigate to B1:
0. B1
1. B
When navigating from B1 to a top-level destination like A, the stack becomes:
0. A
1. B1
2. B
That is, A is not a top-level destination in the back stack: if I press back from A, I intend to exit the app, but I'm taken back to B1.
It would be nice to have a fixed reference to the bottom of the stack. Right now I'm working around this with a horrible ` while (navController.popBackStack()) continue`.
A practical case where this kind of navigation happens is with a Material Design bottom navigation bar, where I have a NavHost above the bottom bar.
Given this navigation scheme:
A - B (top-level)
B1 (first sub-level)
When starting the Activity, the back stack is
0. A
1. NavGraph
If I wanted to navigate to B laterally, I would do:
navController.popBackStack(R.id.navGraph, false)
navController.navigate(R.id.B)
But the resulting back stack is:
0. B
Now, navigating between top-level destinations actually works (though popBackStack returns false); the problem arises again if I navigate to B1:
0. B1
1. B
When navigating from B1 to a top-level destination like A, the stack becomes:
0. A
1. B1
2. B
That is, A is not a top-level destination in the back stack: if I press back from A, I intend to exit the app, but I'm taken back to B1.
It would be nice to have a fixed reference to the bottom of the stack. Right now I'm working around this with a horrible ` while (navController.popBackStack()) continue`.
mt...@gmail.com <mt...@gmail.com> #3
Is this going to be fixed?
I have the same issue with a setup as follows:
Navigation graph.
<navigation 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 "
app:startDestination="@+id/startupGraph">
<navigation
android:id="@+id/startupGraph"
app:startDestination="@id/launcher_home">
<fragment
android:id="@+id/launcher_home"
android:name="com.example.android.codelabs.navigation.MainFragment"
android:label="@string/home"
tools:layout="@layout/main_fragment" />
</navigation>
<navigation
android:id="@+id/homeGraph"
app:startDestination="@id/flow_step_one">
<fragment
android:id="@+id/flow_step_one"
android:name="com.example.android.codelabs.navigation.FlowStepOneFragment"
tools:layout="@layout/flow_step_one_fragment" />
<fragment
android:id="@+id/flow_step_two"
android:name="com.example.android.codelabs.navigation.FlowStepTwoFragment"
tools:layout="@layout/flow_step_two_fragment" />
</navigation>
</navigation>
MainFragment.
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
view.findViewById<Button>(R.id.navigate_dest_bt).setOnClickListener{
Navigation.findNavController(it)
.navigate(R.id.homeGraph, null, NavOptions.Builder()
.setPopUpTo(R.id.startupGraph, false)
.build())
}
}
FlowStepOneFragment.
view.findViewById<View>(R.id.next_button).setOnClickListener {
Navigation.findNavController(it)
.navigate(R.id.flow_step_two, null, NavOptions.Builder()
.setPopUpTo(R.id.flow_step_one, true)
.build())
}
}
}
Causes the following error:
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.android.codelabs.navigation, PID: 12579
java.lang.IllegalArgumentException: Navigator androidx.navigation.fragment.FragmentNavigator@d70ec6f reported navigation to unknown destination id com.example.android.codelabs.navigation:id/flow_step_two
I have the same issue with a setup as follows:
Navigation graph.
<navigation xmlns:android="
xmlns:app="
xmlns:tools="
app:startDestination="@+id/startupGraph">
<navigation
android:id="@+id/startupGraph"
app:startDestination="@id/launcher_home">
<fragment
android:id="@+id/launcher_home"
android:name="com.example.android.codelabs.navigation.MainFragment"
android:label="@string/home"
tools:layout="@layout/main_fragment" />
</navigation>
<navigation
android:id="@+id/homeGraph"
app:startDestination="@id/flow_step_one">
<fragment
android:id="@+id/flow_step_one"
android:name="com.example.android.codelabs.navigation.FlowStepOneFragment"
tools:layout="@layout/flow_step_one_fragment" />
<fragment
android:id="@+id/flow_step_two"
android:name="com.example.android.codelabs.navigation.FlowStepTwoFragment"
tools:layout="@layout/flow_step_two_fragment" />
</navigation>
</navigation>
MainFragment.
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
view.findViewById<Button>(R.id.navigate_dest_bt).setOnClickListener{
Navigation.findNavController(it)
.navigate(R.id.homeGraph, null, NavOptions.Builder()
.setPopUpTo(R.id.startupGraph, false)
.build())
}
}
FlowStepOneFragment.
view.findViewById<View>(R.id.next_button).setOnClickListener {
Navigation.findNavController(it)
.navigate(R.id.flow_step_two, null, NavOptions.Builder()
.setPopUpTo(R.id.flow_step_one, true)
.build())
}
}
}
Causes the following error:
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.android.codelabs.navigation, PID: 12579
java.lang.IllegalArgumentException: Navigator androidx.navigation.fragment.FragmentNavigator@d70ec6f reported navigation to unknown destination id com.example.android.codelabs.navigation:id/flow_step_two
uc...@google.com <uc...@google.com> #4
The original issue was fixed as a result of https://android-review.googlesource.com/833717 and a number of other internal changes and that will be available in alpha08.
Discovered another issue when doing this specific set of navigation actions, so leaving this open until that part is also fixed.
Discovered another issue when doing this specific set of navigation actions, so leaving this open until that part is also fixed.
pe...@gmail.com <pe...@gmail.com> #5
Project: platform/frameworks/support
Branch: androidx-master-dev
commit d3507cb9dab82264070c72a37dbde1dfb43ef578
Author: Ian Lake <ilake@google.com>
Date: Tue Dec 04 14:24:32 2018
Split pop and dispatch logic
When using popUpTo, navigate() would
internally call popBackStack(), resulting
in additional dispatch calls to
OnDestinationChangedListener before the
navigate() operation itself was done.
By separating the logic, we can ensure that
we don't prematurely remove NavGraph destinations
that should still exist after the navigate()
operation and that developers only see a
single final OnDestinationChangedListener callback.
Test: new test
BUG: 113611083
Change-Id: Ib63e4156521259a945ffecf679ccb404ac192017
M navigation/runtime/src/androidTest/java/androidx/navigation/NavControllerTest.kt
M navigation/runtime/src/androidTest/res/navigation/nav_nested_start_destination.xml
M navigation/runtime/src/main/java/androidx/navigation/NavController.java
https://android-review.googlesource.com/840996
https://goto.google.com/android-sha1/d3507cb9dab82264070c72a37dbde1dfb43ef578
Branch: androidx-master-dev
commit d3507cb9dab82264070c72a37dbde1dfb43ef578
Author: Ian Lake <ilake@google.com>
Date: Tue Dec 04 14:24:32 2018
Split pop and dispatch logic
When using popUpTo, navigate() would
internally call popBackStack(), resulting
in additional dispatch calls to
OnDestinationChangedListener before the
navigate() operation itself was done.
By separating the logic, we can ensure that
we don't prematurely remove NavGraph destinations
that should still exist after the navigate()
operation and that developers only see a
single final OnDestinationChangedListener callback.
Test: new test
BUG: 113611083
Change-Id: Ib63e4156521259a945ffecf679ccb404ac192017
M navigation/runtime/src/androidTest/java/androidx/navigation/NavControllerTest.kt
M navigation/runtime/src/androidTest/res/navigation/nav_nested_start_destination.xml
M navigation/runtime/src/main/java/androidx/navigation/NavController.java
pe...@gmail.com <pe...@gmail.com> #6
AS 3.1 beta 2
mt...@gmail.com <mt...@gmail.com> #7
hmm, I removed line by line and finally the problem is caused by:
apply plugin: 'com.jakewharton.hugo'
mobile.gradle:
allprojects {
repositories {
jcenter()
google()
}
}
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.jakewharton.hugo:hugo-plugin:1.2.1'
}
}
apply plugin: 'com.android.application'
apply plugin: 'com.jakewharton.hugo'
android {
compileSdkVersion 27
buildToolsVersion "27.0.3"
defaultConfig {
applicationId "com.droid4you.application.wallet"
minSdkVersion 16
targetSdkVersion 27
}
}
apply plugin: 'com.jakewharton.hugo'
mobile.gradle:
allprojects {
repositories {
jcenter()
google()
}
}
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.jakewharton.hugo:hugo-plugin:1.2.1'
}
}
apply plugin: 'com.android.application'
apply plugin: 'com.jakewharton.hugo'
android {
compileSdkVersion 27
buildToolsVersion "27.0.3"
defaultConfig {
applicationId "com.droid4you.application.wallet"
minSdkVersion 16
targetSdkVersion 27
}
}
mt...@gmail.com <mt...@gmail.com> #9
but AS should write proper file/lib and not mobile.gradle I think...
uc...@google.com <uc...@google.com>
gr...@kochaniak.com <gr...@kochaniak.com> #10
Getting the same problem in full release version 3.1 of Android Studio.
an...@gmail.com <an...@gmail.com> #11
I updated to version 3.1 and I am with the same issue. I have tons of library, I changed all to implementation. I don't know what is the library that is giving me this "compile problem". Gradle should give me an indication what library is giving me the issue.
pi...@gmail.com <pi...@gmail.com> #12
same issue here! please, fix it!
ch...@gmail.com <ch...@gmail.com> #13
Possible duplicate of https://issuetracker.google.com/issues/76440680
When double-clicking the warning, the editor opens App module's build.gradle and indicates "compileSdkVersion" is the error.
All other "compile"s were updated to "implementation"s e.g. compile -> implementation, androidTestCompile -> androidTestImplementation, testCompile -> testImplementation, etc.
When double-clicking the warning, the editor opens App module's build.gradle and indicates "compileSdkVersion" is the error.
All other "compile"s were updated to "implementation"s e.g. compile -> implementation, androidTestCompile -> androidTestImplementation, testCompile -> testImplementation, etc.
ch...@gmail.com <ch...@gmail.com> #14
mt...@gmail.com <mt...@gmail.com> #15
It's not possible to fix by Google, it must fix developers of libraries which you use, like Hugo!
from #13: When double-clicking the warning, the editor opens App module's: No it not indicate to "compileSdkVersion" it just open some (maybe random) gradle file :D. Because problem is in annotation processors, which is used, like Hugo. Just remove Hugo from your project and you will be ok again :)
it's mentioned in comment#8
from #13: When double-clicking the warning, the editor opens App module's: No it not indicate to "compileSdkVersion" it just open some (maybe random) gradle file :D. Because problem is in annotation processors, which is used, like Hugo. Just remove Hugo from your project and you will be ok again :)
it's mentioned in
an...@gmail.com <an...@gmail.com> #16
The problem is Gradle is not indicating what library is using "compile" command. You need to figure out a way to test each library separately.
mo...@gmail.com <mo...@gmail.com> #17
i hate my self coz of this problem ..
mo...@gmail.com <mo...@gmail.com> #18
all my dependencies .. please help me .. i hate my self
2 days and i cant fix this problem
implementation 'com.mcxiaoke.volley:library-aar:1.0.0'
implementation 'com.commit451:PhotoView:1.2.4'
implementation 'de.hdodenhof:circleimageview:2.2.0'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.11'
2 days and i cant fix this problem
implementation 'com.mcxiaoke.volley:library-aar:1.0.0'
implementation 'com.commit451:PhotoView:1.2.4'
implementation 'de.hdodenhof:circleimageview:2.2.0'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.11'
pe...@gmail.com <pe...@gmail.com> #19
You didn't read the answers did you? The warning is a bug in Studio, you cannot do anything. The problem is coming from one of the dependencies you use.
Find out which one is adding this warning to your project and let the developer know!
Find out which one is adding this warning to your project and let the developer know!
xy...@gmail.com <xy...@gmail.com> #20
dependencies {
//classpath 'com.google.gms:google-services:3.1.0' - causes Warning
classpath 'com.google.gms:google-services:3.2.0' - OK
}
for me, after update the google-services version, warning was gone.
Description
Build #AI-173.4559767, built on January 23, 2018
JRE: 1.8.0_152-release-1024-b02 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Windows 10 10.0
I search all files for text: debugCompile and in our project is no text 'debugCompile' so I have no idea why warning is shown :/
In message is no file mentioned or line...
Warning:Configuration 'compile' is obsolete and has been replaced with 'implementation'.
It will be removed at the end of 2018
Warning:Configuration 'debugCompile' is obsolete and has been replaced with 'debugImplementation'.
It will be removed at the end of 2018