1

SDKマネージャのExtrasに前提条件「Google play service」をインストールしました。実行時にバナーのないエミュレータにAppページが表示され、CLIログにエラーが表示されます。誰が私に何が欠けているか教えてくれますか?「Nativescript-admob」のNativescriptプラグインを入手する

admob.createBanner({ 
     // if this 'view' property is not set, the banner is overlayed on the current top most view 
     // view: .., 
     testing: true, // set to false to get real banners 
     size: admob.AD_SIZE.SMART_BANNER, // anything in admob.AD_SIZE, like admob.AD_SIZE.SMART_BANNER 
     iosBannerId: "ca-app-pub-XXXXXX/YYYYYY", // add your own 
     androidBannerId: "ca-app-pub-9495738740700511/5085446949", // add your own 
     // Android automatically adds the connected device as test device with testing:true, iOS does not 
     iosTestDeviceIds: ["yourTestDeviceUDIDs", "EAA5B49DBA3AD30CC27A343C86CD7ADF"], 
     margins: { 
      // if both are set, top wins 
      //top: 10 
      bottom: 50 
     } 
     }).then(
      function() { 
      console.log("admob createBanner done"); 
      }, 
      function(error) { 
      console.log("admob createBanner error: " + error); 
      } 
    ) 
  1. 私が作成した新しいプロジェクト "TNSは、作成ADTEST"
  2. は、TNS」で
  3. 追加プラットフォーム "TNSプラットフォーム追加アンドロイド"
  4. 実行している "TNSはnativescript-のAdMobを追加するプラグイン" プラグインを追加アンドロイド--watch」

--- ERRORログlivesync ---

Project successfully prepared 
The application with id "org.nativescript.adtest" is not installed on device with identifier emulator-5554. 
Project successfully prepared 
WARNING: The file: D:\GoogleDrive\PROJECTS\adtest\node_modules\nativescript-admob\platforms\android\AndroidManifest.xml is depricated, you can read more about what will be the expected plugin structure here: https://www.nativescript.org/blog/migrating-n-android-plugins-from-version-1.7-to-2.0 

:config phase: createDefaultIncludeFiles 
     +found plugins: nativescript-admob 
{ 
       "F0" { 
       dimension "nativescriptadmob" 
       } 
      } 
}  +found plugins: tns-core-modules-widgets 
{ 
      "F1" { 
       dimension "tnscoremoduleswidgets" 
      } 
      } 
     } 
:config phase: createPluginsConfigFile 
     Creating product flavors include.gradle file in D:\GoogleDrive\PROJECTS\adtest\platforms\android/configurations folder... 

:config phase: pluginExtend 
     +applying configuration from: D:\GoogleDrive\PROJECTS\adtest\platforms\android\configurations\include.gradle 
     +applying configuration from: D:\GoogleDrive\PROJECTS\adtest\platforms\android\configurations\nativescript-admob\include.gradle 
     +applying configuration from: D:\GoogleDrive\PROJECTS\adtest\platforms\android\configurations\tns-core-modules-widgets\include.gradle 

:config phase: copyAarDependencies 

:config phase: addAarDependencies 
     +adding dependency: D:\GoogleDrive\PROJECTS\adtest\platforms\android\libs\aar\widgets-release.aar 
:preBuild UP-TO-DATE 
:preF0F1DebugBuild UP-TO-DATE 
:checkF0F1DebugManifest 
:preF0F1ReleaseBuild UP-TO-DATE 
:prepareComAndroidSupportAnimatedVectorDrawable2330Library 
:prepareComAndroidSupportAppcompatV72330Library 
:prepareComAndroidSupportSupportV42330Library 
:prepareComAndroidSupportSupportVectorDrawable2330Library 
:prepareComGoogleAndroidGmsPlayServicesAds840Library 
:prepareComGoogleAndroidGmsPlayServicesBasement840Library 
:prepareWidgetsReleaseLibrary 
:prepareF0F1DebugDependencies 
:compileF0F1DebugAidl UP-TO-DATE 
:compileF0F1DebugRenderscript UP-TO-DATE 
:generateF0F1DebugBuildConfig UP-TO-DATE 
:cleanLocalAarFiles 
:ensureMetadataOutDir 
:collectAllJars 
:setProperties 
:asbg:generateInterfaceNamesList 
:asbg:runAstParser UP-TO-DATE 
:asbg:generateBindings UP-TO-DATE 
:generateF0F1DebugAssets UP-TO-DATE 
:mergeF0F1DebugAssets 
:generateF0F1DebugResValues UP-TO-DATE 
:generateF0F1DebugResources UP-TO-DATE 
:mergeF0F1DebugResources UP-TO-DATE 
:processF0F1DebugManifest UP-TO-DATE 
:processF0F1DebugResources 
:generateF0F1DebugSources 
:compileF0F1DebugJavaWithJavac UP-TO-DATE 
:compileF0F1DebugNdk UP-TO-DATE 
:compileF0F1DebugSources UP-TO-DATE 
:buildMetadata UP-TO-DATE 
:transformClassesWithDexForF0F1Debug UP-TO-DATE 
:mergeF0F1DebugJniLibFolders UP-TO-DATE 
:transformNative_libsWithMergeJniLibsForF0F1Debug UP-TO-DATE 
:processF0F1DebugJavaRes UP-TO-DATE 
:transformResourcesWithMergeJavaResForF0F1Debug UP-TO-DATE 
:validateDebugSigning 
:packageF0F1Debug 
:zipalignF0F1Debug 
:assembleF0F1Debug 
:assembleDebug 
:deleteExplodedAarFolder UP-TO-DATE 
:buildapk 

BUILD SUCCESSFUL 

Total time: 11.657 secs 
Project successfully built 
JS: Treating this deviceId as testdevice: CA5F7DA5D57FD0D05E676D0CD880FB80 
chromium: [INFO:library_loader_hooks.cc(120)] Chromium logging enabled: level = 0, default verbosity = 0 
05-06 03:27:04.304 3124 3124 I BrowserStartupController: Initializing chromium process, singleProcess=true 
chromium: [WARNING:resource_bundle.cc(285)] locale_file_path.empty() 
05-06 03:27:04.349 3124 3124 E DataReductionProxySettingListener: No DRP key due to exception:java.lang.ClassNotFoundException: com.android.webview.chromium.Drp 
JS: Error in admob.createBanner: TypeError: Cannot read property 'android' of null 
JS: admob createBanner error: TypeError: Cannot read property 'android' of null 
chromium: [WARNING:data_reduction_proxy_config.cc(423)] SPDY proxy OFF at startup 
chromium: [INFO:CONSOLE(0)] "Creating Application Cache with manifest https://googleads.g.doubleclick.net/mads/static/mad/sdk/native/sdk-core-v40.appcache", source: https://googleads.g.doubleclick.net/mads/static/mad/sdk/native/sdk-core-v40.html (0) 
chromium: [INFO:CONSOLE(0)] "Application Cache Checking event", source: https://googleads.g.doubleclick.net/mads/static/mad/sdk/native/sdk-core-v40.html (0) 
chromium: [INFO:CONSOLE(0)] "Application Cache Downloading event", source: https://googleads.g.doubleclick.net/mads/static/mad/sdk/native/sdk-core-v40.html (0) 
chromium: [INFO:CONSOLE(0)] "Application Cache Progress event (0 of 4) https://googleads.g.doubleclick.net/mads/static/mad/sdk/native/sdk-core-v40.js", source: https://googleads.g.doubleclick.net/mads/static/mad/sdk/native/sdk-core-v40.html (0) 
chromium: [INFO:CONSOLE(0)] "Application Cache Progress event (1 of 4) https://googleads.g.doubleclick.net/mads/static/mad/sdk/native/production/sdk-core-v40-impl.js", source: https://googleads.g.doubleclick.net/mads/static/mad/sdk/native/sdk-core-v40.html (0) 
chromium: [INFO:CONSOLE(0)] "Application Cache Progress event (2 of 4) https://googleads.g.doubleclick.net/mads/static/mad/sdk/native/canary/sdk-core-v40-impl.js", source: https://googleads.g.doubleclick.net/mads/static/mad/sdk/native/sdk-core-v40.html (0) 
chromium: [INFO:CONSOLE(0)] "Application Cache Progress event (3 of 4) https://googleads.g.doubleclick.net/mads/static/mad/sdk/native/native_ads.js", source: https://googleads.g.doubleclick.net/mads/static/mad/sdk/native/sdk-core-v40.html (0) 
chromium: [INFO:CONSOLE(0)] "Document was loaded from Application Cache with manifest https://googleads.g.doubleclick.net/mads/static/mad/sdk/native/sdk-core-v40.appcache", source: https://googleads.g.doubleclick.net/mads/static/mad/sdk/native/sdk-core-v40.html (0) 
chromium: [INFO:CONSOLE(0)] "Application Cache Checking event", source: https://googleads.g.doubleclick.net/mads/static/mad/sdk/native/sdk-core-v40.html (0) 
chromium: [INFO:CONSOLE(0)] "Application Cache NoUpdate event", source: https://googleads.g.doubleclick.net/mads/static/mad/sdk/native/sdk-core-v40.html (0) 

答えて

0

私の提案は、単純にtns android debugを使用することです。あなたはこのエラーの原因を見ることができます: ヌルのプロパティ 'android'を読み取ることができません

あなたはあまりにも早く呼び出され、すべてが初期化されていないようです。とにかく、単にそれをデバッグしてください:)

希望これは役立ちます。

+0

これは間違いないかもしれません。私はページnavigatingToにそれを配置し、おそらく初期化するのに十分な時間がありません。 TAPボタンで移動すると、単にクリックするだけで動作します。しかし、私の問題は今、ページが始まるときにロードしたいのです。 Nativescriptはpageloadのようなものを持っていますか?それを配置する最善の方法は何ですか?もちろん、 – user2224893

+0

。彼らのドキュメントhttps://docs.nativescript.org/をチェックしてください。 SOに投稿するよりも速く); – Miro

+0

もちろん、エクスポートされた関数はpageLoadedする必要があります –

関連する問題