deckameron / Ti.Android.Admob

Appcelerator Android module wrapping Admob functionalities
17 stars 7 forks source link

Error using 16.x ti.playservices #15

Closed Astrovic closed 4 years ago

Astrovic commented 5 years ago

Hi, I'm trying to use module with SDK 7.5.0.GA, and all the 8.x.x.GA, but I receive the error below. I'm not using any other module. I created a clean project and only added this module to test it. Does anyone know what the problem might be?

[ERROR] TiExceptionHandler: (main) [20,217] No field zzckj of type Lcom/google/android/gms/internal/ads/zzwe; in class Lcom/google/android/gms/internal/ads/zzwe; or its superclasses (declaration of 'com.google.android.gms.internal.ads.zzwe' appears in base.apk)
[ERROR] TiExceptionHandler:
[ERROR] TiExceptionHandler:     com.google.android.gms.internal.ads.zzyz.<init>(Unknown Source:2)
[ERROR] TiExceptionHandler:     com.google.android.gms.ads.doubleclick.PublisherAdView.<init>(Unknown Source:2)
[ERROR] TiExceptionHandler:     ti.android.admob.AdmobView.createAdView(AdmobView.java:130)
[ERROR] TiExceptionHandler:     ti.android.admob.AdmobView.processProperties(AdmobView.java:864)
[ERROR] TiExceptionHandler:     org.appcelerator.kroll.KrollProxy.setModelListener(KrollProxy.java:1277)
[ERROR] TiExceptionHandler:     org.appcelerator.titanium.proxy.TiViewProxy.realizeViews(TiViewProxy.java:602)
[ERROR] TiExceptionHandler:     org.appcelerator.titanium.proxy.TiViewProxy.handleGetView(TiViewProxy.java:593)
[ERROR] TiExceptionHandler:     org.appcelerator.titanium.proxy.TiViewProxy.getOrCreateView(TiViewProxy.java:556)
[ERROR] TiExceptionHandler:     org.appcelerator.titanium.proxy.TiViewProxy.realizeViews(TiViewProxy.java:609)
[ERROR] TiExceptionHandler:     org.appcelerator.titanium.proxy.TiViewProxy.handleGetView(TiViewProxy.java:593)
[ERROR] TiExceptionHandler:     org.appcelerator.titanium.proxy.TiViewProxy.getOrCreateView(TiViewProxy.java:556)
[ERROR] TiExceptionHandler:     org.appcelerator.titanium.proxy.TiViewProxy.handleAdd(TiViewProxy.java:798)
[ERROR] TiExceptionHandler:     org.appcelerator.titanium.proxy.TiViewProxy.add(TiViewProxy.java:693)
[ERROR] TiExceptionHandler:     ti.modules.titanium.ui.WindowProxy.windowCreated(WindowProxy.java:269)
[ERROR] TiExceptionHandler:     org.appcelerator.titanium.TiActivityWindows.windowCreated(TiActivityWindows.java:33)
[ERROR] TiExceptionHandler:     org.appcelerator.titanium.TiBaseActivity.windowCreated(TiBaseActivity.java:624)
[ERROR] TiExceptionHandler:     org.appcelerator.titanium.TiBaseActivity.onCreate(TiBaseActivity.java:783)
[ERROR] TiExceptionHandler:     org.appcelerator.titanium.TiActivity.onCreate(TiActivity.java:23)
[ERROR] TiExceptionHandler:     android.app.Activity.performCreate(Activity.java:7136)
[ERROR] TiExceptionHandler:     android.app.Activity.performCreate(Activity.java:7127)
[ERROR] TiExceptionHandler:     android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1271)
[ERROR] TiExceptionHandler:     android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2893)
[ERROR] TiExceptionHandler:     android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3048)
[ERROR] TiExceptionHandler:     android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
[ERROR] TiExceptionHandler:     android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
[ERROR] TiExceptionHandler:     android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
[ERROR] TiExceptionHandler:     android.app.ActivityThread$H.handleMessage(ActivityThread.java:1808)
[ERROR] TiExceptionHandler:     android.os.Handler.dispatchMessage(Handler.java:106)
[ERROR] TiExceptionHandler:     android.os.Looper.loop(Looper.java:193)
[ERROR] TiExceptionHandler:     android.app.ActivityThread.main(ActivityThread.java:6669)
[ERROR] TiExceptionHandler:     java.lang.reflect.Method.invoke(Native Method)
[ERROR] TiExceptionHandler:     com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
[ERROR] TiExceptionHandler:     com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
[WARN]  InputMethodManager: Ignoring onBind: cur seq=831, given seq=830
Astrovic commented 5 years ago

The problem seems to be in ti.playservices. It only works if you set the ti.playservices version to 11.0.40 in tiapp.xml. I've tried all the other new 16.x versions (from 16.1.0 to 16.5.0), and it doesn't work with any of them. @deckameron have you done a test, or could you do it?

deckameron commented 5 years ago

Thank you @Astrovic ! I will look into it asap.

Astrovic commented 4 years ago

Did you have time to do any tests?

deckameron commented 4 years ago

Hi @Astrovic I have done a few tests and could get it working with 16.1.4. Could you test this version, please?

Astrovic commented 4 years ago

Hi @deckameron thanks for your tests. I tried your 5.1.2 version with ti.playservices 16.1.4, but it still doesn't work. I'm trying with TiSDK 8.2.0.GA.

This is the example code I use: https://gist.github.com/Astrovic/2be16544a9f905fd5d68e8983daec6ea

These are the errors:

rewarded error:

[ERROR] [android, 9, 192.168.232.2] {
  "sourceName": null,
  "title": "Runtime Error",
  "message": "Uncaught Error: Failed resolution of: Lcom/google/android/gms/ads/internal/zzc;",
  "line": 56,
  "lineSource": "            rewarded.loadRewardedAd();",
  "lineOffset": 22
}

banner error:

[ERROR] [android, 9, 192.168.232.2] {
  "sourceName": null,
  "title": "Runtime Error",
  "message": "Failed resolution of: Lcom/google/android/gms/ads/internal/zzc;",
  "line": 0,
  "lineSource": null,
  "lineOffset": 0
}
Astrovic commented 4 years ago

Hi @deckameron,

I noticed that the error appears only in the emulator, I was doing tests on an emulator without Google Play!

I've tested it on an emulator with Google Play, but there's another problem. If in the window I add the banner, the rewarded will not work. While if I add only the rewarded, it works correctly. If you have made some changes to version 5.1.2, could you kindly add them to the master branch or to another branch of the repository? So maybe I can also do tests, or integrate your module with the official ti.admob.

Thanks a lot.

deckameron commented 4 years ago

Hi @Astrovic I haven't made any substantial changes, but only tested different PlayServices versions and with other updated libs.

I have been trying to reproduce the error regarding the two types of ads in the same window and I can't do it. I have an in production running this exact scenario. I don't know what could be going on. :-(

One thing you could try is to add the Banner Ad in a scrollview inside the Window. Window -> Rewarded |------> Scrollview -> Banner

Did you have any luck with that?