nativescript-onesignal无法安装android

时间:2017-09-27 06:47:01

标签: nativescript onesignal

我尝试安装包nativescript-onesignal。之后,我收到了像UNMET PEER DEPENDANCY这样的错误。然后我在GitHub和StackOverflow上的一些帖子后更新了我的模块。但是,现在当我尝试构建并运行应用程序时,我遇到了BUILD FAILED错误。无法理解出了什么问题。我按照一些帖子来解决这个问题但没有成功。 以下是我在控制台中遇到的错误。

tns run android
Searching for devices...
Preparing project...
Successfully prepared plugin nativescript-camera for android.
Successfully prepared plugin nativescript-carousel for android.
Successfully prepared plugin nativescript-drop-down for android.
Successfully prepared plugin nativescript-filter-select for android.
Successfully prepared plugin nativescript-geolocation for android.
Successfully prepared plugin nativescript-gradient for android.
Successfully prepared plugin nativescript-imagepicker for android.
nativescript-iqkeyboardmanager is not supported for android.
Successfully prepared plugin nativescript-iqkeyboardmanager for android.
Successfully prepared plugin nativescript-loading-indicator for android.
Successfully prepared plugin nativescript-localstorage for android.
Successfully prepared plugin nativescript-locate-address for android.
Successfully prepared plugin nativescript-numeric-keyboard for android.
Successfully prepared plugin nativescript-onesignal for android.
Successfully prepared plugin nativescript-phone for android.
Successfully prepared plugin nativescript-social-share for android.
Successfully prepared plugin nativescript-telerik-ui for android.
Successfully prepared plugin nativescript-theme-core for android.
Successfully prepared plugin nativescript-webview-interface for android.
Successfully prepared plugin tns-core-modules for android.
Successfully prepared plugin tns-i18n for android.
Successfully prepared plugin nativescript-permissions for android.
Successfully prepared plugin tns-core-modules-widgets for android.
Starting a Gradle Daemon, 2 incompatible and 2 stopped Daemons could not be reused, use --status for details
> Configuring > 0/3 projects > root project
 :config phase:  createDefaultIncludeFiles
> Configuring > 0/3 projects > root project
 :config phase:  addAarDependencies
        +adding dependency: C:\Users\Rajdeep\Documents\aqua-app\src\platforms\android\libs\aar\Common-2017.1.719-dev-release.aar
        +adding dependency: C:\Users\Rajdeep\Documents\aqua-app\src\platforms\android\libs\aar\Data-2017.1.719-dev-release.aar
        +adding dependency: C:\Users\Rajdeep\Documents\aqua-app\src\platforms\android\libs\aar\List-2017.1.719-dev-release.aar
        +adding dependency: C:\Users\Rajdeep\Documents\aqua-app\src\platforms\android\libs\aar\Primitives-2017.1.719-dev-release.aar
        +adding dependency: C:\Users\Rajdeep\Documents\aqua-app\src\platforms\android\libs\aar\widgets-release.aar
The JavaCompile.setDependencyCacheDir() method has been deprecated and is scheduled to be removed in Gradle 4.0.
The TaskInputs.source(Object) method has been deprecated and is scheduled to be removed in Gradle 4.0. Please use TaskInputs.file(Object).skipWhenEmpty() instead.
Incremental java compilation is an incubating feature.
The Task.leftShift(Closure) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use Task.doLast(Action) instead.
        at build_2xnifqnj4smqh1ggt6ywlsjt4.run(C:\Users\Rajdeep\Documents\aqua-app\src\platforms\android\build-tools\android-static-binding-generator\build.gradle:144)
:asbg:clean UP-TO-DATE
:deleteMetadata
:deleteFlavors
:deleteConfigurations UP-TO-DATE
:deleteGeneratedBindings UP-TO-DATE
:clean

BUILD SUCCESSFUL

Total time: 30.954 secs
Project successfully prepared (Android)
Building project...
> Configuring > 0/3 projects > root project
 :config phase:  createDefaultIncludeFiles
        +found plugins: nativescript-camera
         + creating include.gradle file for C:\Users\Rajdeep\Documents\aqua-app\src\platforms\android\configurations\nativescript-camera
Renaming plugin directory to flavor name: C:\Users\Rajdeep\Documents\aqua-app\src\platforms\android\src\nativescript-camera -> C:\Users\Rajdeep\Documents\aqua-app\src\platforms\android\src\F0
        +found plugins: nativescript-carousel
Renaming plugin directory to flavor name: C:\Users\Rajdeep\Documents\aqua-app\src\platforms\android\src\nativescript-carousel -> C:\Users\Rajdeep\Documents\aqua-app\src\platforms\android\src\F1
        +found plugins: nativescript-geolocation
         + creating include.gradle file for C:\Users\Rajdeep\Documents\aqua-app\src\platforms\android\configurations\nativescript-geolocation
Renaming plugin directory to flavor name: C:\Users\Rajdeep\Documents\aqua-app\src\platforms\android\src\nativescript-geolocation -> C:\Users\Rajdeep\Documents\aqua-app\src\platforms\android\src\F2
        +found plugins: nativescript-imagepicker
Renaming plugin directory to flavor name: C:\Users\Rajdeep\Documents\aqua-app\src\platforms\android\src\nativescript-imagepicker -> C:\Users\Rajdeep\Documents\aqua-app\src\platforms\android\src\F3
        +found plugins: nativescript-onesignal
Renaming plugin directory to flavor name: C:\Users\Rajdeep\Documents\aqua-app\src\platforms\android\src\nativescript-onesignal -> C:\Users\Rajdeep\Documents\aqua-app\src\platforms\android\src\F4
        +found plugins: nativescript-phone
         + creating include.gradle file for C:\Users\Rajdeep\Documents\aqua-app\src\platforms\android\configurations\nativescript-phone
Renaming plugin directory to flavor name: C:\Users\Rajdeep\Documents\aqua-app\src\platforms\android\src\nativescript-phone -> C:\Users\Rajdeep\Documents\aqua-app\src\platforms\android\src\F5
        +found plugins: nativescript-telerik-ui
Renaming plugin directory to flavor name: C:\Users\Rajdeep\Documents\aqua-app\src\platforms\android\src\nativescript-telerik-ui -> C:\Users\Rajdeep\Documents\aqua-app\src\platforms\android\src\F6
        +found plugins: nativescript-webview-interface
         + creating include.gradle file for C:\Users\Rajdeep\Documents\aqua-app\src\platforms\android\configurations\nativescript-webview-interface
Renaming plugin directory to flavor name: C:\Users\Rajdeep\Documents\aqua-app\src\platforms\android\src\nativescript-webview-interface -> C:\Users\Rajdeep\Documents\aqua-app\src\platforms\android\src\F7
        +found plugins: tns-core-modules-widgets
         + creating include.gradle file for C:\Users\Rajdeep\Documents\aqua-app\src\platforms\android\configurations\tns-core-modules-widgets
Renaming plugin directory to flavor name: C:\Users\Rajdeep\Documents\aqua-app\src\platforms\android\src\tns-core-modules-widgets -> C:\Users\Rajdeep\Documents\aqua-app\src\platforms\android\src\F8
> Configuring > 0/3 projects > root project
:config phase:  createPluginsConfigFile
         Creating product flavors include.gradle file in C:\Users\Rajdeep\Documents\aqua-app\src\platforms\android/configurations folder...

:config phase:  pluginExtend
        +applying configuration from: C:\Users\Rajdeep\Documents\aqua-app\src\platforms\android\configurations\include.gradle
        +applying configuration from: C:\Users\Rajdeep\Documents\aqua-app\src\platforms\android\configurations\nativescript-camera\include.gradle
        +applying configuration from: C:\Users\Rajdeep\Documents\aqua-app\src\platforms\android\configurations\nativescript-carousel\include.gradle
        +applying configuration from: C:\Users\Rajdeep\Documents\aqua-app\src\platforms\android\configurations\nativescript-geolocation\include.gradle
        +applying configuration from: C:\Users\Rajdeep\Documents\aqua-app\src\platforms\android\configurations\nativescript-imagepicker\include.gradle
        +applying configuration from: C:\Users\Rajdeep\Documents\aqua-app\src\platforms\android\configurations\nativescript-onesignal\include.gradle
        +applying configuration from: C:\Users\Rajdeep\Documents\aqua-app\src\platforms\android\configurations\nativescript-phone\include.gradle
        +applying configuration from: C:\Users\Rajdeep\Documents\aqua-app\src\platforms\android\configurations\nativescript-telerik-ui\include.gradle
        +applying configuration from: C:\Users\Rajdeep\Documents\aqua-app\src\platforms\android\configurations\nativescript-webview-interface\include.gradle
        +applying configuration from: C:\Users\Rajdeep\Documents\aqua-app\src\platforms\android\configurations\tns-core-modules-widgets\include.gradle
> Configuring > 0/3 projects > root project
 :config phase:  addAarDependencies
        +adding dependency: C:\Users\Rajdeep\Documents\aqua-app\src\platforms\android\libs\aar\Common-2017.1.719-dev-release.aar
        +adding dependency: C:\Users\Rajdeep\Documents\aqua-app\src\platforms\android\libs\aar\Data-2017.1.719-dev-release.aar
        +adding dependency: C:\Users\Rajdeep\Documents\aqua-app\src\platforms\android\libs\aar\List-2017.1.719-dev-release.aar
        +adding dependency: C:\Users\Rajdeep\Documents\aqua-app\src\platforms\android\libs\aar\Primitives-2017.1.719-dev-release.aar
        +adding dependency: C:\Users\Rajdeep\Documents\aqua-app\src\platforms\android\libs\aar\widgets-release.aar
The JavaCompile.setDependencyCacheDir() method has been deprecated and is scheduled to be removed in Gradle 4.0.
The TaskInputs.source(Object) method has been deprecated and is scheduled to be removed in Gradle 4.0. Please use TaskInputs.file(Object).skipWhenEmpty() instead.
Incremental java compilation is an incubating feature.
The Task.leftShift(Closure) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use Task.doLast(Action) instead.
        at build_2xnifqnj4smqh1ggt6ywlsjt4.run(C:\Users\Rajdeep\Documents\aqua-app\src\platforms\android\build-tools\android-static-binding-generator\build.gradle:144)
:preBuild UP-TO-DATE
:preF0F1F2F3F4F5F6F7F8DebugBuild UP-TO-DATE
:checkF0F1F2F3F4F5F6F7F8DebugManifest
:preF0F1F2F3F4F5F6F7F8ReleaseBuild UP-TO-DATE
:prepareAquaappRuntimeUnspecifiedLibrary
:prepareComAndroidSupportAnimatedVectorDrawable2600Alpha1Library
:prepareComAndroidSupportAppcompatV72600Alpha1Library
:prepareComAndroidSupportDesign2600Alpha1Library
:prepareComAndroidSupportRecyclerviewV72600Alpha1Library
:prepareComAndroidSupportSupportCompat2600Alpha1Library
:prepareComAndroidSupportSupportCoreUi2600Alpha1Library
:prepareComAndroidSupportSupportCoreUtils2600Alpha1Library
:prepareComAndroidSupportSupportFragment2600Alpha1Library
:prepareComAndroidSupportSupportMediaCompat2600Alpha1Library
:prepareComAndroidSupportSupportV42600Alpha1Library
:prepareComAndroidSupportSupportVectorDrawable2600Alpha1Library
:prepareComAndroidSupportTransition2600Alpha1Library
:prepareComGoogleAndroidGmsPlayServicesBase1104Library
:prepareComGoogleAndroidGmsPlayServicesBasement1104Library
:prepareComGoogleAndroidGmsPlayServicesGcm1104Library
:prepareComGoogleAndroidGmsPlayServicesIid1104Library
:prepareComGoogleAndroidGmsPlayServicesLocation1104Library
:prepareComGoogleAndroidGmsPlayServicesTasks1104Library
:prepareComOnesignalOneSignal362Library
:prepareComRomandanylykPageindicatorview020Library
:prepareCommon20171719DevReleaseLibrary
:prepareData20171719DevReleaseLibrary
:prepareList20171719DevReleaseLibrary
:preparePrimitives20171719DevReleaseLibrary
:prepareWidgetsReleaseLibrary
:prepareF0F1F2F3F4F5F6F7F8DebugDependencies
:compileF0F1F2F3F4F5F6F7F8DebugAidl
:compileF0F1F2F3F4F5F6F7F8DebugRenderscript
:generateF0F1F2F3F4F5F6F7F8DebugBuildConfig
:cleanLocalAarFiles
:ensureMetadataOutDir
:collectAllJars
:setProperties
:generateTypescriptDefinitions SKIPPED
:copyTypings SKIPPED
:asbg:generateInterfaceNamesList
:asbg:traverseJsFiles
:asbg:runAstParser
Running full build
finished with reading lines with js files
:asbg:generateBindings
:generateF0F1F2F3F4F5F6F7F8DebugResValues
:generateF0F1F2F3F4F5F6F7F8DebugResources
:mergeF0F1F2F3F4F5F6F7F8DebugResources
:processF0F1F2F3F4F5F6F7F8DebugManifest
[com.onesignal:OneSignal:3.6.2] C:\Users\Rajdeep\Documents\aqua-app\src\platforms\android\build\intermediates\exploded-aar\com.onesignal\OneSignal\3.6.2\AndroidManifest.xml:52:13-48 Error:
   Attribute meta-data#onesignal_app_id@value at [com.onesignal:OneSignal:3.6.2] AndroidManifest.xml:52:13-48 requires a placeholder substitution but no value for <onesignal_app_id> is provided.
[com.onesignal:OneSignal:3.6.2] C:\Users\Rajdeep\Documents\aqua-app\src\platforms\android\build\intermediates\exploded-aar\com.onesignal\OneSignal\3.6.2\AndroidManifest.xml:56:13-67 Error:
   Attribute meta-data#onesignal_google_project_number@value at [com.onesignal:OneSignal:3.6.2] AndroidManifest.xml:56:13-67 requires a placeholder substitution but no value for <onesignal_google_project_number> is provided.

See http://g.co/androidstudio/manifest-merger for more information about the manifest merger.

C:\Users\Rajdeep\Documents\aqua-app\src\platforms\android\src\F0\AndroidManifest.xml Error:
    Attribute meta-data#onesignal_app_id@value at AndroidManifest.xml requires a placeholder substitution but no value for <onesignal_app_id> is provided.
C:\Users\Rajdeep\Documents\aqua-app\src\platforms\android\src\F0\AndroidManifest.xml Error:
    Attribute meta-data#onesignal_google_project_number@value at AndroidManifest.xml requires a placeholder substitution but no value for <onesignal_google_project_number> is provided.
> Building 67% > :processF0F1F2F3F4F5F6F7F8DebugManifest
See http://g.co/androidstudio/manifest-merger for more information about the manifest merger.

:processF0F1F2F3F4F5F6F7F8DebugManifest FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':processF0F1F2F3F4F5F6F7F8DebugManifest'.
> Manifest merger failed with multiple errors, see logs

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 1 mins 7.429 secs
Unable to apply changes on device: emulator-5554. Error is: Command gradlew.bat failed with exit code 1.

请帮我解决这个问题。

谢谢..

1 个答案:

答案 0 :(得分:1)

您的Gradle构建中有两个错误:

Attribute meta-data#onesignal_app_id@value at [com.onesignal:OneSignal:3.6.2] AndroidManifest.xml:52:13-48 requires a placeholder substitution but no value for <onesignal_app_id> is provided.

Attribute meta-data#onesignal_google_project_number@value at AndroidManifest.xml requires a placeholder substitution but no value for <onesignal_google_project_number> is provided.

根据onesignal文档,您需要提供这两个以便使用插件 - https://documentation.onesignal.com/docs/android-sdk-setup

因此,您可以在app / App_Resources / Android / app.gradle中包含以下内容:

android {
   defaultConfig {
      manifestPlaceholders = [onesignal_app_id: "PUT YOUR ONESIGNAL APP ID HERE",
                              // Project number pulled from dashboard, local value is ignored.
                              onesignal_google_project_number: "REMOTE"]
    }
 }