[MOD-2541] ti.playservices 16.1.3 and later versions are not compatible with ti.admob and i get the following:
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Open |
Resolution | Unresolved |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Admob |
Labels | 8.1.0.GA, android |
Reporter | Andreas Pingas |
Assignee | Unknown |
Created | 2019-08-27T12:14:53.000+0000 |
Updated | 2019-09-18T23:23:59.000+0000 |
Description
Please check the following example.
<modules>
<module platform="android" version="4.4.0">ti.admob</module>
<module platform="android" version="16.1.3">ti.playservices</module>
</modules>
Admob = require('ti.admob');
PlayServices = require('ti.playservices');
var win = Ti.UI.createWindow();
if (PlayServices.isGooglePlayServicesAvailable() == PlayServices.RESULT_SUCCESS) {
var ad = Admob.createView({
height:400,
testing:true,
adType:Admob.AD_TYPE_BANNER,
adUnitId:'ca-app-pub-3940256099942544/6300978111',
adBackgroundColor:'#FFF',
testDevices:[Admob.SIMULATOR_ID],
requestAgent:'Test',
tagForChildDirectedTreatment:false
});
win.add(ad);
}
win.open();
[ERROR] : TiExceptionHandler: (main) [251,645] Failed resolution of: Lcom/google/android/gms/ads/AdSize;
[ERROR] : TiExceptionHandler:
[ERROR] : TiExceptionHandler: dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:93)
[ERROR] : TiExceptionHandler: java.lang.ClassLoader.loadClass(ClassLoader.java:379)
[ERROR] : TiExceptionHandler: java.lang.ClassLoader.loadClass(ClassLoader.java:312)
[ERROR] : TiExceptionHandler: ti.admob.View.<init>(View.java:34)
[ERROR] : TiExceptionHandler: ti.admob.ViewProxy.createView(ViewProxy.java:52)
[ERROR] : TiExceptionHandler: org.appcelerator.titanium.proxy.TiViewProxy.handleGetView(TiViewProxy.java:492)
[ERROR] : TiExceptionHandler: org.appcelerator.titanium.proxy.TiViewProxy.getOrCreateView(TiViewProxy.java:464)
[ERROR] : TiExceptionHandler: org.appcelerator.titanium.proxy.TiViewProxy.realizeViews(TiViewProxy.java:515)
[ERROR] : TiExceptionHandler: org.appcelerator.titanium.proxy.TiViewProxy.handleGetView(TiViewProxy.java:498)
[ERROR] : TiExceptionHandler: org.appcelerator.titanium.proxy.TiViewProxy.getOrCreateView(TiViewProxy.java:464)
[ERROR] : TiExceptionHandler: org.appcelerator.titanium.proxy.TiViewProxy.add(TiViewProxy.java:604)
[ERROR] : TiExceptionHandler: ti.modules.titanium.ui.WindowProxy.windowCreated(WindowProxy.java:321)
[ERROR] : TiExceptionHandler: org.appcelerator.titanium.TiActivityWindows.windowCreated(TiActivityWindows.java:57)
[ERROR] : TiExceptionHandler: org.appcelerator.titanium.TiBaseActivity.windowCreated(TiBaseActivity.java:578)
[ERROR] : TiExceptionHandler: org.appcelerator.titanium.TiBaseActivity.onCreate(TiBaseActivity.java:726)
[ERROR] : TiExceptionHandler: org.appcelerator.titanium.TiActivity.onCreate(TiActivity.java:47)
[ERROR] : TiExceptionHandler: android.app.Activity.performCreate(Activity.java:7040)
[ERROR] : TiExceptionHandler: android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1214)
[ERROR] : TiExceptionHandler: android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2809)
[ERROR] : TiExceptionHandler: android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2931)
[ERROR] : TiExceptionHandler: android.app.ActivityThread.-wrap11(Unknown Source:0)
[ERROR] : TiExceptionHandler: android.app.ActivityThread$H.handleMessage(ActivityThread.java:1620)
[ERROR] : TiExceptionHandler: android.os.Handler.dispatchMessage(Handler.java:105)
[ERROR] : TiExceptionHandler: android.os.Looper.loop(Looper.java:173)
[ERROR] : TiExceptionHandler: android.app.ActivityThread.main(ActivityThread.java:6698)
[ERROR] : TiExceptionHandler: java.lang.reflect.Method.invoke(Native Method)
[ERROR] : TiExceptionHandler: com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
[ERROR] : TiExceptionHandler: com.android.internal.os.ZygoteInit.main(ZygoteInit.java:782)
Is the exception thrown if you use ti.admob with ti.playservices 16.1.4 ? That version was released specifically for these missing classes. Also have in mind that 16.1.14 may require you to provide your Admob App ID in the manifest as shown here: https://developers.google.com/admob/android/quick-start#update_your_androidmanifestxml It would look like that in
tiapp.xml
When i use ti.playservices 16.1.4 works properly. However, ti.playservices 16.1.4 is not compatible with firebase.core 4.0.0 or 5.0.0. The only combination that works properly is ti.playservices 11.0.40, firebase.core 3.0.2 and ti.admob 4.4.0.