Status Update
Comments
tm...@gmail.com <tm...@gmail.com> #2
To investigate further, can you share more details on your use case where you are using the Glide? Kindly also note that Glide is "An image loading and caching library for Android focused on smooth scrolling", this may have implementations against the Terms of Service of Google Maps Platform[1] under "3.2.4(b) No Caching. Customer will not cache Google Maps Content except as expressly permitted under the Maps Service Specific Terms.".
Kindly review the ToS of Google Maps Platform, once confirmed that your use case is compliant, we will be glad to proceed with the investigation.
[1]
ca...@pinterest.com <ca...@pinterest.com> #3
ma...@gmail.com <ma...@gmail.com> #4
java.lang.ClassCastException: com.bumptech.glide.GeneratedAppGlideModuleImpl cannot be cast to com.google.android.libraries.maps.c.zza
at com.google.android.libraries.maps.c.zzb.zzb(Glide.java:96)
at com.google.android.libraries.maps.c.zzb.zza(Glide.java:11)
at com.google.android.libraries.maps.c.zzb.zzb(Glide.java:218)
at com.google.android.libraries.maps.cf.zzi.zza(ResourceManagerImpl.java:7)
at com.google.android.libraries.maps.hi.zzas.zza(Suppliers.java:7)
at com.google.android.libraries.maps.cf.zzf.run(Unknown Source:7)
at com.google.android.libraries.maps.fc.zzc.run(CancelableRunnable.java:7)
at com.google.android.libraries.maps.fc.zzad.run(Task.java:9)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at com.google.android.libraries.maps.fc.zzv.run(GmmThread.java:10)
at java.lang.Thread.run(Thread.java:919)
Glide in the maps SDK still tries to find the generated module by its non-shaded name, with and then tries to cast it to the shaded class, which blows up:
(com.google.android.libraries.maps.c.zza) Class.forName("com.bumptech.glide.GeneratedAppGlideModuleImpl")
ti...@gmail.com <ti...@gmail.com> #5
ra...@gmail.com <ra...@gmail.com> #6
ra...@gmail.com <ra...@gmail.com> #7
za...@gmail.com <za...@gmail.com> #8
za...@gmail.com <za...@gmail.com> #9
to...@gmail.com <to...@gmail.com> #10
Does anyone else facing this issue have a workaround they've implemented in the meantime? Aside from pulling out Glide from your project...
kk...@gmail.com <kk...@gmail.com> #11
implementation 'com.github.bumptech.glide:glide:4.9.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.9.0'
implementation 'com.squareup.okhttp3:okhttp:3.12.0'
implementation ('com.github.bumptech.glide:okhttp3-integration:4.9.0') {
exclude group: 'glide-parent'
}
implementation ('com.github.bumptech.glide:annotations:4.9.0')
implementation name:'maps-sdk-3.0.0-beta', ext:'aar'
Stack trace:
java.lang.IllegalStateException: tname=DefaultPool6 - GeneratedAppGlideModuleImpl is implemented incorrectly. If you've manually implemented this class, remove your implementation. The Annotation processor will generate a correct implementation.
at com.google.android.libraries.maps.c.zzb.zzb(Glide.java:103)
at com.google.android.libraries.maps.c.zzb.zza(Glide.java:11)
at com.google.android.libraries.maps.c.zzb.zzb(Glide.java:218)
at com.google.android.libraries.maps.cf.zzi.zza(ResourceManagerImpl.java:7)
at com.google.android.libraries.maps.hi.zzas.zza(Suppliers.java:7)
at com.google.android.libraries.maps.cf.zzf.run(Unknown Source)
at com.google.android.libraries.maps.fc.zzc.run(CancelableRunnable.java:7)
at com.google.android.libraries.maps.fc.zzad.run(Task.java:9)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at com.google.android.libraries.maps.fc.zzv.run(GmmThread.java:10)
at java.lang.Thread.run(Thread.java:818)
Caused by: java.lang.IllegalAccessException: java.lang.Class<com.bumptech.glide.GeneratedAppGlideModuleImpl> is not accessible from java.lang.Class<com.google.android.libraries.maps.c.zzb>
at java.lang.reflect.Constructor.newInstance(Native Method)
at com.google.android.libraries.maps.c.zzb.zzb(Glide.java:96)
[Deleted User] <[Deleted User]> #12
sa...@gmail.com <sa...@gmail.com> #13
kk...@gmail.com <kk...@gmail.com> #14
ox...@gmail.com <ox...@gmail.com> #15
apparently the issue is that newer glide versions will generate a com.bumptech.glide.GeneratedAppGlideModuleImpl class with context inside constructor
and google maps 3 will try to instantiate without passing the constructor -> hence the reflection exception. not sure how to fix that from the outside though, it would help if we knew the actual glide version they're using
here the glide generated class glide:
com.github.bumptech.glide:glide:4.11.0 com.github.bumptech.glide:compiler:4.11.0
@SuppressWarnings("deprecation")
final class GeneratedAppGlideModuleImpl extends GeneratedAppGlideModule {
private final AppGlideModule appGlideModule;
public GeneratedAppGlideModuleImpl(Context context) {
appGlideModule = new AppGlideModule();
if (Log.isLoggable("Glide", Log.DEBUG)) {
Log.d("Glide", "Discovered AppGlideModule from annotation: com.europapark.services.glide.AppGlideModule");
Log.d("Glide", "Discovered LibraryGlideModule from annotation: com.bumptech.glide.integration.okhttp3.OkHttpLibraryGlideModule");
Log.d("Glide", "Discovered LibraryGlideModule from annotation: net.kibotu.mediagallery.internal.progress.GlideConfiguration");
}
}
@Override
public void applyOptions(@NonNull Context context, @NonNull GlideBuilder builder) {
appGlideModule.applyOptions(context, builder);
}
@Override
public void registerComponents(@NonNull Context context, @NonNull Glide glide,
@NonNull Registry registry) {
new OkHttpLibraryGlideModule().registerComponents(context, glide, registry);
new GlideConfiguration().registerComponents(context, glide, registry);
appGlideModule.registerComponents(context, glide, registry);
}
@Override
public boolean isManifestParsingEnabled() {
return appGlideModule.isManifestParsingEnabled();
}
@Override
@NonNull
public Set<Class<?>> getExcludedModuleClasses() {
return Collections.emptySet();
}
@Override
@NonNull
GeneratedRequestManagerFactory getRequestManagerFactory() {
return new GeneratedRequestManagerFactory();
}
}
and here the call within the gmaps 3 library
private static com.google.android.libraries.maps.c.zza zzb() {
com.google.android.libraries.maps.c.zza var0 = null;
try {
var0 = (com.google.android.libraries.maps.c.zza)Class.forName("com.bumptech.glide.GeneratedAppGlideModuleImpl").getDeclaredConstructor().newInstance();
} catch (ClassNotFoundException var2) {
if (Log.isLoggable("Glide", 5)) {
Log.w("Glide", "Failed to find GeneratedAppGlideModule. You should include an annotationProcessor compile dependency on com.github.bumptech.glide:compiler in your application and a @GlideModule annotated AppGlideModule implementation or LibraryGlideModules will be silently ignored");
}
} catch (IllegalAccessException | NoSuchMethodException | InvocationTargetException | InstantiationException var3) {
throw new IllegalStateException("GeneratedAppGlideModuleImpl is implemented incorrectly. If you've manually implemented this class, remove your implementation. The Annotation processor will generate a correct implementation.", var3);
}
return var0;
}
wa...@gmail.com <wa...@gmail.com> #16
en...@google.com <en...@google.com>
fl...@polarsteps.com <fl...@polarsteps.com> #17
ry...@gmail.com <ry...@gmail.com> #18
This is still happening with glide 4.11.0
na...@rea-group.com <na...@rea-group.com> #19
We tried understanding the issue, it seems that a glide module is generated through reflection:
Some thing like this
try {
var0 = (com.google.android.libraries.maps.c.zza)Class.forName("com.bumptech.glide.GeneratedAppGlideModuleImpl").getDeclaredConstructor().newInstance();
} catch (ClassNotFoundException var2) {
if (Log.isLoggable("Glide", 5)) {
Log.w("Glide", "Failed to find GeneratedAppGlideModule. You should include an annotationProcessor compile dependency on com.github.bumptech.glide:compiler in your application and a @GlideModule annotated AppGlideModule implementation or LibraryGlideModules will be silently ignored");
}
} catch (IllegalAccessException | NoSuchMethodException | InvocationTargetException | InstantiationException var3) {
throw new IllegalStateException("GeneratedAppGlideModuleImpl is implemented incorrectly. If you've manually implemented this class, remove your implementation. The Annotation processor will generate a correct implementation.", var3);
}
Glide has a constructor of this method with context, but google tries to create an instance of this class without any parameters, that is why an exception is occurred.
Someone can think of a workaround or time till this is fixed?
Description
By using FragmentStatePagerAdapter with custom View, BadParcelableException may be thrown.
This error is similar to the following:
Reason:
Fragment.mSavedFragmentState.mClassLoader is bootstrap class loader.
This class loader cannot resolve custom View's SavedState class.
Workaround:
Create custom FragmentStatePagerAdapter in project's src/android/support/v4/app folder and use it.
-----
package
import android.os.Bundle;
import android.view.ViewGroup;
public abstract class MyFragmentStatePagerAdapter extends FragmentStatePagerAdapter {
public FixedFragmentStatePagerAdapter(FragmentManager fm) {
super(fm);
}
@Override
public Object instantiateItem(ViewGroup container, int position) {
Fragment f = (Fragment)super.instantiateItem(container, position);
Bundle savedFragmentState = f.mSavedFragmentState;
if (savedFragmentState != null) {
savedFragmentState.setClassLoader(f.getClass().getClassLoader());
}
return f;
}
}
-----