Status Update
Comments
vs...@google.com <vs...@google.com>
[Deleted User] <[Deleted User]> #2
[Deleted User] <[Deleted User]> #3
Thanks for reporting this!
un...@gmail.com <un...@gmail.com> #4
Same here, any update? Stuck at alpha02 for a long time.
un...@gmail.com <un...@gmail.com> #5
A few notes:
- Should be using
viewLifecyclerOwner.lifecycleScope
instead of justlifecycleScope
in aFragment
. - Cancellation is happening as a result of the fragment automatically paging over when they are initially created / added to viewpager2 (this is expected as far as I can tell)
- Right now
RemoteMediator
kind of acts as a dumb callback wheneverPagingSource
runs out of items to load, soREFRESH
error doesn't prevent remotePREPEND
/APPEND
. It's not clear to me yet whether it should or if we should change guidance to just handleAPPEND
. This is due to us changing the behavior of Remote REFRESH after the codelab was produced, so I'm very sorry for that. REFRESH is meant to handle any init that needs to happen, technically the initial network page fetch happens as a result of running out of items on the APPEND side.
e.g., Here is a modified sample from the opening post / #1's repro project that fixes the issue:
PageKeyedRemoteMediator.kt
override suspend fun load(
loadType: LoadType,
state: PagingState<Int, RedditPost>
): MediatorResult {
try {
// Get the closest item from PagingState that we want to load data around.
val loadKey = when (loadType) {
REFRESH -> {
db.withTransaction {
postDao.deleteBySubreddit(subredditName)
remoteKeyDao.deleteBySubreddit(subredditName)
}
return MediatorResult.Success(endOfPaginationReached = false)
}
PREPEND -> return MediatorResult.Success(endOfPaginationReached = true)
APPEND -> {
// Query DB for SubredditRemoteKey for the subreddit.
// SubredditRemoteKey is a wrapper object we use to keep track of page keys we
// receive from the Reddit API to fetch the next or previous page.
val remoteKey = db.withTransaction {
remoteKeyDao.remoteKeyByPost(subredditName)
}
when {
remoteKey == null -> null
// We must explicitly check if the page key is null after initial load, since the
// Reddit API informs the end of the list by returning null for page key, but
// passing a null key to Reddit API will fetch the initial page.
remoteKey.nextPageKey == null -> {
return MediatorResult.Success(endOfPaginationReached = true)
}
else -> remoteKey.nextPageKey
}
}
}
val data = redditApi.getTop(
subreddit = subredditName,
after = loadKey,
before = null,
limit = state.config.pageSize * 3
).data
val items = data.children.map { it.data }
db.withTransaction {
remoteKeyDao.insert(SubredditRemoteKey(subredditName, data.after))
postDao.insertAll(items)
}
return MediatorResult.Success(endOfPaginationReached = items.isEmpty())
} catch (e: IOException) {
return MediatorResult.Error(e)
} catch (e: HttpException) {
return MediatorResult.Error(e)
} catch (e: CancellationException) {
Log.d("RemoteMediator","$subredditName $loadType canceled")
throw e
}
}
un...@gmail.com <un...@gmail.com> #6
Will keep this bug open to track the decision on blocking RemoteMediator
PREPEND
/ APPEND
after remote REFRESH error and any possible updates to the Codelab / Github samples.
The inconvenience of blocking on REFRESH is going to surface via needing to call retry()
, but it's possible there's something better we can do to handle cancellation more gracefully since we don't want to keep creating new PagingData
and also support loading in the background. (the thing to change to control this is when you start collecting from Pager.flow
, and the scope collection happens in).
st...@gmail.com <st...@gmail.com> #7
I have a question about the modified sample. Shouldn't deleteByXXX
be moved to after redditApi
execute successfully?
The UI side will see blink twice in this sample: Show db cache first then disappeared, show data again after redditApi
successful and insert data. The user experience is pretty bad.
re...@gmail.com <re...@gmail.com> #8
To be clear the above sample is a workaround a deeper issue in Paging which isn't handling cancellation gracefully due to Remote REFRESH errors not blocking remote PREPEND / APPEND.
tn...@google.com <tn...@google.com> #9
I found that if using fragment.lifecycleScope.launchWhenResume to collect each page data then it will work normally. ViewPager2 FragmentStatePager will move fragment to onResume/onPause.
he...@gmail.com <he...@gmail.com> #10
Good to hear, I think we can still do a better job of handling cancellation and propagating remote state, e.g., if you have many pages in viewpager and flip back and forth I think you'll still eventually get stuck, since the collector on PagingData will get canceled and there's no invalidate signal to restart it without manually calling adapter.refresh()
.
in...@solati.se <in...@solati.se> #11
Branch: androidx-master-dev
commit c97e21810e49b3f8043c8d7c3951b16e8b38e6db
Author: Yigit Boyar <yboyar@google.com>
Date: Fri Oct 16 10:39:22 2020
Add priority to single runner
This CL adds ability to accept priority to SingleRunner.
It will be necessary for the new remote mediator implementation
where it will rely on single runner to cancel lower priority
requests.
Bug: 162252536
Test: SingleRunnerTest
Change-Id: I01351ac385b252f80ab6079d42f2cf0edf8d6667
M paging/common/src/main/kotlin/androidx/paging/SingleRunner.kt
M paging/common/src/test/kotlin/androidx/paging/SingleRunnerTest.kt
tn...@google.com <tn...@google.com> #12
Branch: androidx-master-dev
commit f86129d60bb33243d06837291f0e2bd0f26f4bd3
Author: Yigit Boyar <yboyar@google.com>
Date: Fri Oct 09 11:34:07 2020
RemoteMediatorAccessor Refactor
This CL changes how remote mediator and snapshots interact.
Previously, all calls to remote mediator were done in a
snapshot's scope and snapshot was also responsible to track
load states.
It created a problem where remote mediator calls would be
cancelled when snapshot is replaced by a newer one. It also
made the load state logic fairly complicated in PageFetcherSnapshot.
This CL de-couples the two as much as possible.
With this change, RemoteMediatorAcccessor uses the scope of
the `Pager.flow` collection instead of the scope from the
PageFetcherSnapshot. PageFetcherSnapshot is now only responsible
to send events to the accessor when it needs more data.
RemoteMediatorAccessor manages its own loading state.
We still need some syncronization between the two to ensure certain
load events are not dispatched before data is loaded (e.g. after a
pull to refresh, you don't want refresh state to go idle before the
new local data is loaded for UI consistency). This logic is now
handled by the PageFetcher where it appends the load states to each
insert page and for other events (loading, error), directly sends them
to the downstream.
Bug: 162252536
Test: RemoteMediatorAccessorTest, PageFetcherSnapshotTest
Relnote: "Paging will no longer cancel a `RemoteMediator#load` call
due to a page invalidation. It will also no longer make an
append/prepend load request, *if REFRESH is required*, until REFRESH
request completes successfully."
Change-Id: I6390be0c0c1073005456f928a2a8afa81c16d3ef
M paging/common/api/current.txt
M paging/common/api/public_plus_experimental_current.txt
M paging/common/api/restricted_current.txt
M paging/common/src/main/kotlin/androidx/paging/CachedPageEventFlow.kt
M paging/common/src/main/kotlin/androidx/paging/LoadStates.kt
M paging/common/src/main/kotlin/androidx/paging/MutableLoadStateCollection.kt
M paging/common/src/main/kotlin/androidx/paging/PageEvent.kt
M paging/common/src/main/kotlin/androidx/paging/PageFetcher.kt
M paging/common/src/main/kotlin/androidx/paging/PageFetcherSnapshot.kt
M paging/common/src/main/kotlin/androidx/paging/PageFetcherSnapshotState.kt
M paging/common/src/main/kotlin/androidx/paging/PagingDataDiffer.kt
M paging/common/src/main/kotlin/androidx/paging/RemoteMediator.kt
M paging/common/src/main/kotlin/androidx/paging/RemoteMediatorAccessor.kt
M paging/common/src/test/kotlin/androidx/paging/PageEventTest.kt
M paging/common/src/test/kotlin/androidx/paging/PageFetcherSnapshotStateTest.kt
M paging/common/src/test/kotlin/androidx/paging/PageFetcherSnapshotTest.kt
M paging/common/src/test/kotlin/androidx/paging/RemoteMediatorAccessorTest.kt
M testutils/testutils-paging/src/main/java/androidx/paging/RemoteMediatorMock.kt
jh...@gmail.com <jh...@gmail.com> #13
[Deleted User] <[Deleted User]> #14
The problem was that there was a file named 'README' in one directory, i.e. a file with no extension. As soon as I renamed it to README.txt, the problem disappeared.
zh...@gmail.com <zh...@gmail.com> #15
he...@gmail.com <he...@gmail.com> #16
I must have had an other problem. None of the above solved it, but I readded my project folder by folder and the problem went away. Strange.
hi...@gmail.com <hi...@gmail.com> #17
am...@gmail.com <am...@gmail.com> #18
* * Subversive SVN JDT Ignore Extensions (Optional)
* * Subversive SVN Team Provider
Thanks to the author.
wr...@gmail.com <wr...@gmail.com> #19
Is it possible to download an older sdk some where?
to...@gmail.com <to...@gmail.com> #20
rh...@cruxis.be <rh...@cruxis.be> #21
rh...@cruxis.be <rh...@cruxis.be> #22
I had to remove all the .svn directories to get the project back on the rails.
What a complete mess...
tn...@google.com <tn...@google.com> #23
Btw the fix for this was
tn...@google.com <tn...@google.com> #24
me...@googlemail.com <me...@googlemail.com> #25
I think comment 22 have not updated the Eclipse Plugins to 21.1 Preview 1.
Thanks for fixing!
rh...@cruxis.be <rh...@cruxis.be> #26
Everything now working fine.
pa...@appade.com <pa...@appade.com> #27
Upgrading to 21.1 rc1 was required for me to get my environment working again (Mac OS).
Just to make the steps a little clearer:
1. Follow instructions here:
2. Make sure update both SDK Manager and ADT
The last couple SDK releases have been terribly frustrating breaking my environment and causing a lot of down time, I hope the Android Tool Team strives to test better before pushing out the next release...
ga...@skype.net <ga...@skype.net> #28
Any word on when the changes in this preview (beta) release will be pushed live? I am hoping it will be soon.
be...@gmail.com <be...@gmail.com> #29
[Deleted User] <[Deleted User]> #30
[Deleted User] <[Deleted User]> #31
But there is new problem my eclipse UI not showing properly. it loosed some window features. now i don't have any idea how to correct it. but at least functionality working properly.
be...@gmail.com <be...@gmail.com> #32
- I can't ctrl-click layout ids from java code to open corresponding xml files. Error log reports an exception (see attache file)
- XML windows don't have any title (see attached image)
yu...@gmail.com <yu...@gmail.com> #33
installed * Subversive SVN JDT Ignore Extensions (Optional)
installed * Subversive SVN Team Provider
and i still get the error
tn...@google.com <tn...@google.com> #34
#32 benjamin.orsini: The problem you're getting is
java.lang.NoSuchMethodError: com.android.ide.common.resources.ResourceRepository.parseResource(Ljava/lang/String;)Lcom/android/utils/Pair;
That looks like the kind of problem which would happen if you install the plugin without restarting the IDE (or if not, some sort of botched installation, where the .jar files are not matching). Can you double check that restarting the IDE does not fix the problem?
If not, we should file a new issue to track this bug; it's unrelated to the NPE issue here.
an...@gmail.com <an...@gmail.com> #35
Thanks guys for the help, it was making me crazy
be...@gmail.com <be...@gmail.com> #37
Ok I managed to fix it.
Problem was I only installed the Eclipse Preview Development tool and not the others (DDMS, Hierarchy, etc.). After doing that and restarting Eclipse, everything's ok now :)
re...@gmail.com <re...@gmail.com> #38
mr...@gmail.com <mr...@gmail.com> #40
mi...@gmail.com <mi...@gmail.com> #41
I also had to manually delete the bin folder.
Also deleted and re-imported the project.
Finally it worked :)
gu...@multiniche.org <gu...@multiniche.org> #42
ca...@gmail.com <ca...@gmail.com> #43
tn...@google.com <tn...@google.com> #44
ca...@gmail.com <ca...@gmail.com> #45
* unable to run project when in XML layout editor, I need to change to any .java file to run it
* icon bar (Toggle Fill Width to Show All Relationships) in xml layout editor sometimes starts blinking when editing e.g. Text property and keeps blinking after editing is done. Stops only when I click into editor area.
* in properties panel a value (e.g. "To Right Of" value) doesn't re-draw when scrolling in properties panel - I mean the value itself is visible while the rest of the panel scrolls underneath. This happens just once so far after expanding a property column width.
aa...@gmail.com <aa...@gmail.com> #47
aa...@gmail.com <aa...@gmail.com> #48
aa...@gmail.com <aa...@gmail.com> #49
ry...@gmail.com <ry...@gmail.com> #50
jo...@gmail.com <jo...@gmail.com> #51
do...@gmail.com <do...@gmail.com> #52
su...@gmail.com <su...@gmail.com> #53
Thanks a lot
as...@gmail.com <as...@gmail.com> #54
1. Open properties of project in Eclipse then Resources > Resource filters.
2. Check "Exclude all", "Files and folders", "All children" in edit box input ".svn".
3. Restart Eclipse.
di...@gmail.com <di...@gmail.com> #55
m....@gmail.com <m....@gmail.com> #56
Thanks a lot!
ka...@gmail.com <ka...@gmail.com> #57
[Deleted User] <[Deleted User]> #58
Using MacOS 10.8.2, tried 21.1 rc, exlude .svn etc
tn...@google.com <tn...@google.com> #59
"(and just to make sure: you're updated not only the *tools* 21.1 bits via the SDK manager, but also the ADT plugin via the separate plugin preview channel Eclipse update site, correct? The fact that there are two separate mechanisms that both must be used is far from intuitive.)"
[Deleted User] <[Deleted User]> #60
is...@gmail.com <is...@gmail.com> #61
gu...@multiniche.org <gu...@multiniche.org> #62
xa...@android.com <xa...@android.com> #63
[Deleted User] <[Deleted User]> #64
(Basically same as #54 Asha...@gmail.com comment, but added .git files)
project properties - opening resources - add: exclude all (including subdirectories),
name matches .git
name matches .svn
and restarted eclipse to correct.
====================================================
hm...@gmail.com <hm...@gmail.com> #65
ERROR:
Errors occurred during the build.
Errors running builder 'Android Resource Manager' on project 'test'.
java.lang.NullPointerException
Please can anyone help!!
Thanks
How do I install the SVN
Subversive SVN JDT Ignore Extensions (Optional)
installed * Subversive SVN Team Provider
Description
SDK tools version (available in the "About" section of the 'android' tool
UI): 21.0.1
Eclipse version: 3.8.0
ADT plug-in version: ADT v21.0.1-543035
Platform targeted by your project: 8
Version of the platform running in the emulator: (emulator not used)
I have downloaded the latest ADT bundle for Windows x86_64 from
STEPS TO REPRODUCE:
1. Create new android application, call it foobar, set it to use API level 8 and select default choices in wizard
2. Close and open Eclipse and verify that project builds with no errors
3. Open the src folder in Windows Explorer
4. Create a folder called .svn (you need to use the command line for this) and set it to hidden.
5. Open the .svn folder and add a file (call it entries with no extension)
6. Refresh the foobar project
7. Close and open Eclipse
8. Build of project will fail
EXPECTED RESULTS:
Subversion is a widely used for source control. I have used it with earlier versions of the Android SDK and Eclipse with no problems, so the build of the project should succeed.
OBSERVED RESULTS:
A pop-up notifying of an error during the build. Pressing Details reveals the following message:
Errors occurred during the build.
Errors running builder 'Android Pre Compiler' on project 'foobar'.
java.lang.NullPointerException
ADDITIONAL INFORMATION:
A workspace with a sample project has been attached.
Output from .log:
!SESSION 2012-12-29 00:37:36.223 -----------------------------------------------
eclipse.buildId=v21.0.1-543035
java.version=1.6.0_37
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_GB
Framework arguments: -product com.android.ide.eclipse.adt.package.product
Command-line arguments: -os win32 -ws win32 -arch x86_64 -product com.android.ide.eclipse.adt.package.product
!ENTRY com.android.ide.eclipse.ddms 4 0 2012-12-29 00:37:41.741
!MESSAGE DDMS files not found: C:\Development\eclipse\platform-tools\adb.exe C:\Development\eclipse\tools\hprof-conv.exe C:\Development\eclipse\tools\traceview.bat
!ENTRY com.android.ide.eclipse.adt 4 0 2012-12-29 00:38:16.281
!MESSAGE Failed to load properties file for project 'foobar'
!SESSION 2012-12-29 00:39:21.319 -----------------------------------------------
eclipse.buildId=v21.0.1-543035
java.version=1.6.0_37
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_GB
Framework arguments: -product com.android.ide.eclipse.adt.package.product
Command-line arguments: -os win32 -ws win32 -arch x86_64 -product com.android.ide.eclipse.adt.package.product
!ENTRY com.android.ide.eclipse.adt 4 0 2012-12-29 00:39:31.877
!MESSAGE Failed to finish PrecompilerBuilder#startupOnInitialize()
!STACK 0
java.lang.NullPointerException
at com.android.ide.eclipse.adt.internal.build.SourceProcessor.scanFolderForSourceFiles(SourceProcessor.java:374)
at com.android.ide.eclipse.adt.internal.build.SourceProcessor.scanFolderForSourceFiles(SourceProcessor.java:380)
at com.android.ide.eclipse.adt.internal.build.SourceProcessor.buildSourceFileList(SourceProcessor.java:353)
at com.android.ide.eclipse.adt.internal.build.SourceProcessor.<init>(SourceProcessor.java:97)
at com.android.ide.eclipse.adt.internal.build.SourceProcessor.<init>(SourceProcessor.java:113)
at com.android.ide.eclipse.adt.internal.build.AidlProcessor.<init>(AidlProcessor.java:85)
at com.android.ide.eclipse.adt.internal.build.builders.PreCompilerBuilder.startupOnInitialize(PreCompilerBuilder.java:800)
at org.eclipse.core.internal.events.BuildManager.getBuilder(BuildManager.java:542)
at org.eclipse.core.internal.events.BuildManager.getBuilder(BuildManager.java:567)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:237)
at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:292)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:295)
at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:351)
at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:374)
at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:143)
at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:241)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
!ENTRY org.eclipse.core.resources 4 2 2012-12-29 00:39:35.432
!MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.core.resources".
!STACK 0
java.lang.NullPointerException
at com.android.ide.eclipse.adt.internal.build.builders.PreCompilerBuilder.build(PreCompilerBuilder.java:673)
at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:728)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:199)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:239)
at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:292)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:295)
at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:351)
at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:374)
at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:143)
at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:241)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
!ENTRY org.eclipse.core.resources 4 75 2012-12-29 00:39:35.452
!MESSAGE Errors occurred during the build.
!SUBENTRY 1 com.android.ide.eclipse.adt 4 75 2012-12-29 00:39:35.452
!MESSAGE Errors running builder 'Android Pre Compiler' on project 'foobar'.
!STACK 0
java.lang.NullPointerException
at com.android.ide.eclipse.adt.internal.build.builders.PreCompilerBuilder.build(PreCompilerBuilder.java:673)
at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:728)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:199)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:239)
at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:292)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:295)
at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:351)
at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:374)
at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:143)
at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:241)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)