4.0.0-RC1:
ButterKnife 8.4.0:
LG Nexus 5X / Android 8.0.0 Beta 3:
I try to upgrde drom ver 3.7.0 to 4.0.0-RC1 but got errors which Glide can't understand DiskCacheStrategy.SOURCE. I got and errors say Error:(62, 180) error: cannot find symbol method diskCacheStrategy(DiskCacheStrategy).:
Glide load line / GlideModule (if any) / list Adapter code (if any):
Glide.with(this).load("https://firebasestorage.googleapis.com/v0/b/travel-and-go-93552.appspot.com/o/My_Victoria_beach1_620.jpg?alt=media&token=1e9cd6db-9d36-4fda-b0d4-283eaa1f3aff").diskCacheStrategy(DiskCacheStrategy.SOURCE).into(img1);
Layout XML:
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/vict"
android:scaleType="fitXY"
android:alpha="0.65"
/>
Stack trace / LogCat:
Error:(62, 180) error: cannot find symbol method diskCacheStrategy(DiskCacheStrategy)
You have to use
RequestOptions requestOptions = new RequestOptions();
requestOptions.diskCacheStrategy(DiskCacheStrategy.SOURCE)
then
`Glide.with(this).load("https://firebasestorage.googleapis.com/v0/b/travel-and-go-93552.appspot.com/o/My_Victoria_beach1_620.jpg?alt=media&token=1e9cd6db-9d36-4fda-b0d4-283eaa1f3aff").apply(requestOptions).into(img1);
`
From v4 we have to add option
See http://bumptech.github.io/glide/doc/migrating.html#requestoptions.
To inline those options methods, see also: http://bumptech.github.io/glide/doc/generatedapi.html
Oh, you mean in v4 diskCacheStrategy need to be separated from Glide call? declare diskCacheStrategy and call the method back in Glide call...? It kinda looks the same as before.
I also did saw that cache strategy type of ALL and SOURCE being replaced by AUTOMATIC and RESOURCE respectively... any internal changes about that..?
@Starscream9559 Use generated api to call it without request options.
Strategies got smarter: https://github.com/bumptech/glide/compare/v3.8.0...v4.0.0-RC1#diff-dfd10e58078a83f42eee8f6aeb17d5c1
Ok, now Ive applied all activities that use Glide with that RequestOptions. and .apply(requestOptions) after .load(url)...
RequestOptions req = new RequestOptions();
req.diskCacheStrategy(DiskCacheStrategy.RESOURCE);
My Java file got no errors, but the app force close without even open first activity (ANR).. what's wrong..?
Logcat says that I got error on this line;
Glide.with(this).load("https://firebasestorage.googleapis.com/v0/b/travel-and-go-93552.appspot.com/o/buku.png?alt=media&token=bad59236-e4ff-44e0-81ac-32adf9c1aea4").apply(req).into(buku);
But the IDE shows no error.
Well without an error it's pretty hard to tell. I usually diagnose infinite loops/deadlocks by attaching the debugger, letting it hang for a few seconds and then pausing the app (in Debugger hit the || button). After this you can check each Thread's state/stack. Find out the one that's busy. Also check CPU/Memory monitors near LogCat in AS.
Well @TWiStErRob of course debugging has been done and as I stop at the Glide line, the screen is displayed but no content. so that make me thing the root of error (which is regarding to the new version).
Letme try revoke to 3.7.0 and make that activity as usual.
as I stop at the Glide line
which one? it's unlikely that the debugger will stop on your Glide.with... unless you are running that code in a loop.
displayed but no content
Have you just tried https://github.com/bumptech/glide/wiki/Debugging-and-Error-Handling to see the logs / add a listener?
Guys my bad!
I found my mistake so feels free to delete this submission.
It was related to ButterKnife as I forgot to
Butterknife.bind(this)
in the current activity. But the error line shows in Glide... Anyway, I should wait for stable version of 4.0 first then migrate.
Most helpful comment
You have to use
then
From v4 we have to add option