我正在尝试让distriqt Adverts扩展在我的AIR应用程序中工作。在我尝试我的应用程序的每个设备上,我都会得到Adverts.service.interstitials.isSupported返回false。在一台设备上,我也得到了这些Java错误,这可能是原因:
Error #2044: Unhandled error:. text=Attempt to invoke virtual method 'java.lang.String com.adobe.fre.FREObject.getAsString()' on a null object reference
Error #2044: Unhandled error:. text=Attempt to invoke interface method 'boolean com.distriqt.extension.adverts.platforms.AdvertPlatform.isInterstitialsSupported()' on a null object reference我反复检查了应用程序描述符XML的<extensions>部分中是否列出了所有必需的扩展,以及它们是否确实包含在APK中。
下面是AS代码的摘录:
if (Adverts.isSupported)
{
var r:int = GoogleApiAvailability.instance.isGooglePlayServicesAvailable();
if (r == ConnectionResult.SUCCESS)
{
Adverts.service.initialisePlatform(AdvertPlatform.PLATFORM_ADMOB, myAppId);
if (Adverts.service.interstitials.isSupported)
{
// etc...
}
else trace("Interstitials not supported");我做错了什么,或者我可以做些什么来找出我做错了什么?
(无法将adverts标记添加到此问题,因为没有足够的声誉)
发布于 2020-07-03 07:45:35
检查您的myAppId的值是什么。
第一个错误将指示它是null,并且initialisePlatform()调用失败。
https://stackoverflow.com/questions/62692433
复制相似问题