简体   繁体   English

当我运行带有离子性的window.chartboost.setup(appId,appSignature)时,应用程序崩溃

[英]app crash when i run window.chartboost.setup( appId,appSignature ) with ionic

After i re-test and re-test again, now i managed to scope down my problem. 在我重新测试并再次测试之后,现在我设法解决了问题。 What i want to achieve is to run chartboost ads in my ionic apps, but i'm facing this problem. 我想要实现的是在离子应用程序中运行chartboost广告,但是我正面临着这个问题。

.controller('chapter1Ctrl', ['$scope', '$stateParams', 
function ($scope, $stateParams) {
    $scope.appId = "xxxxxxxxxxxx";
    $scope.appSignature = "xxxxxxxxxxxxxxxxxxxx";

    $scope.testobject = function() {

        alert("window.chartboost :"+ window.chartboost );
     }

    $scope.preloadads = function() {

       if( window.chartboost )
        {
          window.chartboost.setUp($scope.appId, $scope.appSignature);
          window.chartboost.preloadInterstitialAd('Default');         
        }
     }

     $scope.showads = function() {

       if( window.chartboost )
        {
            window.chartboost.showInterstitialAd('Default');
        }
     }

}])

To troubleshoot it, i have created 3 buttons (testobject , prelaod, showads ). 为了解决这个问题,我创建了3个按钮(testobject,prelaod和showads)。 After i run testobject, it shows [Object object] seems like i can reach the plugin that i have installed. 运行testobject之后,它显示[Object object]似乎可以到达我已安装的插件。 Then when i run the second button "preload" the apps crash, i guess it crash because of running the method "window.chartboost.setup". 然后,当我运行第二个按钮“预加载”时,应用程序崩溃,我猜它由于运行方法“ window.chartboost.setup”而崩溃。 I really have no clue here, i really need some help is anyone faced this problem and know the solution? 我在这里真的没有头绪,我真的需要一些帮助,有人遇到这个问题并且知道解决方案吗?

I found the error message in logcat 我在logcat中发现了错误消息

"java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/ads/identifier/AdvertisingIdClient" “ java.lang.NoClassDefFoundError:无法解决以下问题:Lcom / google / android / gms / ads / identifier / AdvertisingIdClient”

I solved it by just installing the google play services plugin. 我只安装了Google Play服务插件即可解决此问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM