googleads / googleads-mobile-unity

Official Unity Plugin for the Google Mobile Ads SDK
https://developers.google.com/admob/unity
Apache License 2.0
1.34k stars 1.09k forks source link

VTable setup of type GoogleMobileAds.GoogleMobileAdsClientFactory failed #2109

Closed mfadlanridho closed 1 year ago

mfadlanridho commented 2 years ago

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";
     }
}
NVentimiglia commented 2 years ago

@mfadlanridho

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

mfadlanridho commented 2 years ago

@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 commented 2 years ago

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.

Difficulty-in-naming commented 1 year ago

same issue

phuongdmp7 commented 1 year ago

same issue