googleads-mobile-unity icon indicating copy to clipboard operation
googleads-mobile-unity copied to clipboard

VTable setup of type GoogleMobileAds.GoogleMobileAdsClientFactory failed

Open mfadlanridho opened this issue 3 years ago • 4 comments

  • Unity version: 2021.3.4
  • Google Mobile Ads Unity plugin version: 7.1.0
  • Platform: Android
  • Platform OS version: Android 11
  • Any specific devices issue occurs on: None
  • Mediation ad networks used, and their versions: None

Ad is showing in editor but not in build. So I tried to set status text to "setting config" before setting request configuration at Start then "done config" after setting config, but status text is stuck at "setting config". Did a logcat and showed this error:

06-20 05:23:34.192 23941 23970 E Unity : AdManager with error: System.TypeLoadException: VTable setup of type GoogleMobileAds.GoogleMobileAdsClientFactory failed 06-20 05:23:34.192 23941 23970 E Unity : at System.Reflection.RuntimeConstructorInfo.InternalInvoke (System.Object obj, System.Object[] parameters, System.Boolean wrapExceptions) [0x00029] in <7fb66c41b6e641fb91b7fd5e48b4c50d>:0 06-20 05:23:34.192 23941 23970 E Unity : at System.RuntimeType.CreateInstanceMono (System.Boolean nonPublic, System.Boolean wrapExceptions) [0x00095] in <7fb66c41b6e641fb91b7fd5e48b4c50d>:0 06-20 05:23:34.192 23941 23970 E Unity : at System.RuntimeType.CreateInstanceSlow (System.Boolean publicOnly, System.Boolean wrapExceptions, System.Boolean skipCheckThis, System.Boolean fillCache) [0x00009] in <7fb66c41b6e641fb91b7fd5e48b4c50d>:0 06-20 05:23:34.192 23941 23970 E Unity : at System.RuntimeType.CreateInstanceDefaultCtor (System.Boolean publicOnly, System.Boolean skipCheckThis, System.Boolean fillCache, System.Boolean wrapExceptions, System.Threading.StackCrawlMark& stackMark) [0x00027] in <7fb66c41b6e641fb91b7fd5e48b4c50d>:0 06-20 05:23:34.192 23941 23970 E Unity : at System.Activator.CreateInstance (System.Type type, System.Boolean nonPublic, System.B 06-20 05:23:34.199 23941 23970 E Unity : TypeLoadException: VTable setup of type GoogleMobileAds.GoogleMobileAdsClientFactory failed 06-20 05:23:34.199 23941 23970 E Unity : at System.Reflection.RuntimeConstructorInfo.InternalInvoke (System.Object obj, System.Object[] parameters, System.Boolean wrapExceptions) [0x00029] in <7fb66c41b6e641fb91b7fd5e48b4c50d>:0 06-20 05:23:34.199 23941 23970 E Unity : at System.RuntimeType.CreateInstanceMono (System.Boolean nonPublic, System.Boolean wrapExceptions) [0x00095] in <7fb66c41b6e641fb91b7fd5e48b4c50d>:0 06-20 05:23:34.199 23941 23970 E Unity : at System.RuntimeType.CreateInstanceSlow (System.Boolean publicOnly, System.Boolean wrapExceptions, System.Boolean skipCheckThis, System.Boolean fillCache) [0x00009] in <7fb66c41b6e641fb91b7fd5e48b4c50d>:0 06-20 05:23:34.199 23941 23970 E Unity : at System.RuntimeType.CreateInstanceDefaultCtor (System.Boolean publicOnly, System.Boolean skipCheckThis, System.Boolean fillCache, System.Boolean wrapExceptions, System.Threading.StackCrawlMark& stackMark) [0x00027] in <7fb66c41b6e641fb91b7fd5e48b4c50d>:0 06-20 05:23:34.199 23941 23970 E Unity : at System.Activator.CreateInstance (System.Type type, System.Boolean nonPublic, System.Boolean wrapExceptions) [0x000 06-20 05:23:34.221 1081 1081 D DisplayFeatureHal: dataCallback value=< 0.8100, 6.0000, 0.0000>,time=564138024956976, sensor=5, temperature(K)= 6.0000

I've tried to delete resolved library and force resolve but it didn't fix the error. Fixed the error by reverting back to version 7.0.1.

class AdManager : MonoBehaviour {
    void Start() {
        statusText = "setting config";

            RequestConfiguration requestConfiguration =
                new RequestConfiguration.Builder()
                .SetTagForChildDirectedTreatment(TagForChildDirectedTreatment.Unspecified)
                .SetTestDeviceIds(deviceIds).build();
            MobileAds.SetRequestConfiguration(requestConfiguration);

        statusText = "done config";
     }
}

mfadlanridho avatar Jun 19 '22 23:06 mfadlanridho

@mfadlanridho

Can you try uninstalling by completely removing it, especially the `/plugin/' folder and reinstalling the plugin.

NVentimiglia avatar Jun 21 '22 15:06 NVentimiglia

@NVentimiglia

Deleted everything that was going to be imported by the unitypackage and everything in /Plugins/Android directory. Then I reimported the package and resolved but it still didnt fix the error.

mfadlanridho avatar Jun 23 '22 00:06 mfadlanridho

I had a problem before with gradle failing to fetch dependecies and fixed it by deleting the gradle-5.1.1-bin folder in wrapper then resolve will redownload the folder. I tried doing the same thing but it doesnt fix this error.

mfadlanridho avatar Jun 23 '22 01:06 mfadlanridho

same issue

Difficulty-in-naming avatar Jul 22 '22 07:07 Difficulty-in-naming

same issue

phuongdmp7 avatar Oct 24 '22 02:10 phuongdmp7