deckameron / Ti.Android.Admob

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

google-play-services-base.jar version error #7

Closed ottopic closed 6 years ago

ottopic commented 6 years ago

After last appcelerator sdk update it doesn't work yet. Is it possibile update it?

[ERROR] Application Installer abnormal process termination. Process exit value was 1 [ERROR] : Conflicting jar files detected: [ERROR] :
[ERROR] : The following modules have different "google-play-services-base.jar" files [ERROR] : ti.android.admob (version 2.0) (hash=730a1d6196847cb5b1067ac02a875876) [ERROR] : ti.cloudpush (version 4.0.4) (hash=d256136c03c8f78d47ddb73739493aea) [ERROR] :
[ERROR] : You can either select a version of these modules where the conflicting jar file is the same or you [ERROR] : can try copying the jar file from one module's "lib" folder to the other module's "lib" folder.

albwebbergate commented 6 years ago

I've got the exact same problem and I, temporarily, solved this issue by using ti.cloudpush 4.0.3 and copying the google-play-services-base.jar from the lib folder of ti.android.admob to the lib folder of ti.cloudpush (i overwrite it).

It's related with this issue opened by me #2

deckameron commented 6 years ago

Hi folks,

I bump into this issue a LOT while using modules with google-play-services.jar, and the only solution that works everytime is Proguard. ti.cloudpush uses com.google.android.gms.gcm ti.android.admob uses com.google.android.gms.ads

Follow the tutorial and create a Proguard with this config:

-keep public class com.google.android.gms.ads.** {
  public protected *;
}

-keep public class com.google.android.gms.gcm.** {
  public protected *;
}
ottopic commented 6 years ago

Hello, can I use https://github.com/appcelerator-modules/ti.playservices to solve the problem?

albwebbergate commented 6 years ago

I think that @deckameron have to change the module itself to support ti.playservices or am I wrong?

Because in tiapp.xml we have to put the exact version of com.google.android.gms.version to make the module work.

kerberosargos commented 6 years ago

Firstly, thank you very much for your module. Can you update it for SDK 7.0?

deckameron commented 6 years ago

@kerbooo could you try this one, please?

kerberosargos commented 6 years ago

@deckameron Thank you very much your support. It is working very well with SDK 7.0.2 but I can not show smart BANNER and INTERSTITIAL ADVIEW same window together. Smart banner shown but INTERSTITIAL does not shown. Is there any specific setting?

My sample code as below;

$Admob = require("ti.android.admob");

var $AdmobView = $Admob.createView({
                top : 0,
                adSizeType : "SMART", //RECTANGLE, FULLBANNER, LEADERBOARD, SMART
                publisherId : "ca-app-pub-my-id", 
                testing : false
            });

$.AdmobView.add($AdmobView); //> 

var $AdmobInterstitial = $Admob.createView({
    top : 0,
    adSizeType : "INTERSTITIALAD",
    publisherId : "ca-app-pub-my-INTERSTITIALAD-id", 
    testing : false
});

$AdmobInterstitial.addEventListener('ad_received', function(e) {
    Titanium.API.warn("Interstital Ad Received");
});

$AdmobInterstitial.addEventListener('ad_not_received', function(e) {
    Titanium.API.error("Interstital Ad failed");
});

$AdmobInterstitial.addEventListener('ad_ready_to_be_shown', function(e) {
    Titanium.API.warn("Interstital Ad is READY!");
    $AdmobInterstitial.showAdNow();
});

$AdmobInterstitial.addEventListener('ad_not_ready_yet', function(e) {
    Titanium.API.warn("Interstital Ad is not ready yet!");
});

$AdmobInterstitial.addEventListener('ad_being_shown', function(e) {
    Titanium.API.warn("Interstital Ad being shown right now!");
});

$AdmobInterstitial.addEventListener('ad_closed', function(e) {
    Titanium.API.warn("Interstital ad close successfully. RIP!");
});

I am getting warns as below

[WARN] :   DynamiteModule: Local module descriptor class for com.google.android.gms.ads.dynamite not found.
[WARN] :   chromium: [WARNING:render_frame_host_impl.cc(2750)] OnDidStopLoading was called twice.
ottopic commented 6 years ago

@kerbooo you need to use ti.admob because it supports ti.playservices . ti.android.admob doesn’t support it.

kerberosargos commented 6 years ago

No 3.0 relase which is above link working very well with SDK 7.0.2 I can not shows 2 banner at same time.

12 Mar 2018 Pzt 04:30 tarihinde Lorenzo notifications@github.com şunu yazdı:

@kerbooo https://github.com/kerbooo you need to use ti.admob because it supports ti.playservices . ti.android.admob doesn’t support it.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/deckameron/Ti.Android.Admob/issues/7#issuecomment-372169490, or mute the thread https://github.com/notifications/unsubscribe-auth/AK1n0GO2GcbwJyuQX8LSXVWXiUunSFXnks5tdc_HgaJpZM4QSNWy .

ottopic commented 6 years ago

It works if it is the unique module that use play service. If you use more then one services it can’t works. This is about the issue that I opened 4 months ago.

kerberosargos commented 6 years ago

@ottopic My problem about showing two banners in same window at same time. I mean I have a window which is include a SMART banner and it is working. Extra I would like to show INTERSTITIAL banner in same window too. But INTERSTITIAL banner is not showing.

deckameron commented 6 years ago

@ottopic the 3.0 on dist folder is now using ti.playservices and I have also implemented the Advanced Native Ads.

@kerbooo I didn't know of this issue. I will take a look asap.

kerberosargos commented 6 years ago

@deckameron Hi again. Firstly thank you for great support. Could you check error?

deckameron commented 6 years ago

Hi @kerbooo, I have been struggling with the issue you stated before but unfortunately I could not reproduce it. This is the code I am using and it works perfectly. Both ads are shown.

var admob = require("ti.android.admob");

var window = Titanium.UI.createWindow({
    backgroundColor : '#F2F2F2'
});

//TRADITIONAL ADVIEW
var smartAd = admob.createView({
    top : 0,
    left : 0,
    right : 0,
    adSizeType : 'SMART', //RECTANGLE, FULLBANNER, LEADERBOARD, SMART, FLUID
    publisherId : "ca-app-pub-XXXXXXXXXXX/AAAAAA",
    testing : true,
    backgroundColor : '#DEDEDE',
    zIndex : 1000
}); 
window.add(smartAd);   

smartAd.addEventListener('ad_received', function(e) {
    Titanium.API.info(JSON.stringify(e));
    Titanium.API.info("Ad received");
});

smartAd.addEventListener('ad_not_received', function(e) {
    Titanium.API.info(JSON.stringify(e));
    Titanium.API.error("Ad failed");
});

//===================================
//INTERSTITIAL ADVIEW
var interstitialAd = admob.createView({
    adSizeType: 'INTERSTITIALAD',
    publisherId: 'ca-app-pub-XXXXXXXXXXX-BBBBBBB',
}); 
window.add(interstitialAd);   

interstitialAd.addEventListener('ad_received', function(e) {
    Titanium.API.warn("Interstital Ad Received");
});

interstitialAd.addEventListener('ad_not_received', function(e) {
    Titanium.API.error("Interstital Ad failed");
});

interstitialAd.addEventListener('ad_ready_to_be_shown', function(e) {
    Titanium.API.warn("Interstital Ad is READY!");
    interstitialAd.showAdNow();
});

interstitialAd.addEventListener('ad_not_ready_yet', function(e) {
    Titanium.API.warn("Interstital Ad is not ready yet!");
});

interstitialAd.addEventListener('ad_being_shown', function(e) {
    Titanium.API.warn("Interstital Ad being shown right now!");
});

interstitialAd.addEventListener('ad_closed', function(e) {
    Titanium.API.warn("Interstital ad close successfully. RIP!");
});

window.open();
kerberosargos commented 6 years ago

@deckameron Really very very thank you. I will try it as you wrote. Cheers.

kerberosargos commented 6 years ago

@deckameron Yes it is working very well. Thank you again.

deckameron commented 6 years ago

@kerbooo glad to know! :)