I’ve hit an issue in attempting to use the OneSignal plugin for push notifications. I’ve followed all the steps in the OneSignal documentation for Phonegap Build but am seeing the following error in the VoltBuilder logs:
onesignal-cordova-plugin 2.10.1 "OneSignal Push Notifications"
Output: 9.0.0 (cordova-lib@9.0.1)
Output: Checking config.xml and package.json for saved platforms that haven't been added to the project
Config.xml and package.json platforms are the same. No pkg.json modification.
Package.json and config.xml platforms are different. Updating config.xml with most current list of platforms.
PlatformApi successfully found for platform android
Checking for saved plugins that haven't been added to the project
Checking for any plugins added to the project that have not been installed in android platform
No differences found between plugins added to project and installed in android platform. Continuing...
Generating platform-specific config.xml from defaults for android at /platforms/android/app/src/main/res/xml/config.xml
Merging project's config.xml into platform-specific android config.xml
[Gradle Properties] Preparing Configuration
[Gradle Properties] Appending default configuration properties
[Gradle Properties] Appending custom configuration properties
[Gradle Properties] Updating and Saving File
Merging and updating files from [www, platforms/android/platform_www] to platforms/android/app/src/main/assets/www
Wrote out android application name "Mighty Saints App" to /platforms/android/app/src/main/res/values/strings.xml
android-versionCode not found in config.xml. Generating a code based on version in config.xml (0.8.4 (beta)): 800
Wrote out Android package name "com.nsbasic.ClubApp" to /platforms/android/app/src/main/java/com/nsbasic/ClubApp/MainActivity.java
Updating icons at platforms/android/app/src/main/res
Updating splash screens at platforms/android/app/src/main/res
This app does not have additional resource files defined
Prepared android project successfully
Running command: /usr/libexec/java_home
Command finished with error code 0: /usr/libexec/java_home
Checking Java JDK and Android SDK versions
ANDROID_SDK_ROOT=/Users/voltbuilder/Code/android-sdk (recommended setting)
ANDROID_HOME=/Users/voltbuilder/Code/android-sdk (DEPRECATED)
Reading build config file: /build.json
Running command: /usr/local/Cellar/gradle/6.4/bin/gradle -p /platforms/android wrapper -b /platforms/android/wrapper.gradle
> Task :wrapper
BUILD SUCCESSFUL in 456ms
1 actionable task: 1 executed
Command finished with error code 0: /usr/local/Cellar/gradle/6.4/bin/gradle -p,/platforms/android,wrapper,-b,/platforms/android/wrapper.gradle
Subproject Path: CordovaLib
Subproject Path: app
Running command: /platforms/android/gradlew cdvBuildDebug -b /platforms/android/build.gradle
> Configure project :app
WARNING: The onesignal-gradle-plugin MUST be before com.android.application!
Please put onesignal-gradle-plugin first OR update to com.android.tools.build:gradle:3.0.0 or newer!
WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html
/platforms/android/app/app/src/main/res/xml/config.xml
/platforms/android/app/src/main/res/xml/config.xml
loglevel
> Task :app:preBuild UP-TO-DATE
> Task :CordovaLib:preBuild UP-TO-DATE
> Task :CordovaLib:preDebugBuild UP-TO-DATE
> Task :CordovaLib:checkDebugManifest
> Task :CordovaLib:processDebugManifest
> Task :app:preDebugBuild
> Task :CordovaLib:compileDebugAidl NO-SOURCE
> Task :app:compileDebugAidl NO-SOURCE
> Task :CordovaLib:packageDebugRenderscript NO-SOURCE
> Task :app:compileDebugRenderscript
> Task :app:checkDebugManifest
> Task :app:generateDebugBuildConfig
> Task :app:prepareLintJar
> Task :app:generateDebugSources
> Task :CordovaLib:compileDebugRenderscript
> Task :CordovaLib:generateDebugBuildConfig
> Task :CordovaLib:generateDebugResValues
> Task :CordovaLib:generateDebugResources
> Task :CordovaLib:packageDebugResources
> Task :CordovaLib:generateDebugRFile
> Task :CordovaLib:prepareLintJar
> Task :CordovaLib:generateDebugSources
> Task :CordovaLib:javaPreCompileDebug
> Task :CordovaLib:compileDebugJavaWithJavac
> Task :CordovaLib:processDebugJavaRes NO-SOURCE
> Task :CordovaLib:transformClassesAndResourcesWithPrepareIntermediateJarsForDebug
> Task :app:javaPreCompileDebug
> Task :app:mainApkListPersistenceDebug
> Task :app:generateDebugResValues
> Task :app:generateDebugResources
> Task :app:mergeDebugResources
> Task :app:createDebugCompatibleScreenManifests
> Task :app:processDebugManifest FAILED
/platforms/android/app/src/main/AndroidManifest.xml:49:9-51:51 Error:
Attribute meta-data#onesignal_app_id@value at AndroidManifest.xml:49:9-51:51 requires a placeholder substitution but no value for <onesignal_app_id> is provided.
/platforms/android/app/src/main/AndroidManifest.xml:53:9-55:70 Error:
Attribute meta-data#onesignal_google_project_number@value at AndroidManifest.xml:53:9-55:70 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.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processDebugManifest'.
> 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. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 7s
22 actionable tasks: 22 executed
Command finished with error code 1: /platforms/android/gradlew cdvBuildDebug,-b,/platforms/android/build.gradle
/platforms/android/gradlew: Command failed with exit code 1 Error output:
/platforms/android/app/src/main/AndroidManifest.xml:49:9-51:51 Error:
Attribute meta-data#onesignal_app_id@value at AndroidManifest.xml:49:9-51:51 requires a placeholder substitution but no value for <onesignal_app_id> is provided.
/platforms/android/app/src/main/AndroidManifest.xml:53:9-55:70 Error:
Attribute meta-data#onesignal_google_project_number@value at AndroidManifest.xml:53:9-55:70 requires a placeholder substitution but no value for <onesignal_google_project_number> is provided.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processDebugManifest'.
> Manifest merger failed with multiple errors, see logs
I’ve tried various adjustments to config.xml but all unsuccessful so far - currently am including the following settings:
<plugin name="onesignal-cordova-plugin" source="npm" />
<preference name="phonegap-version" value="cli-8.0.0" />
<preference name="android-build-tool" value="gradle" />
<preference name="android-minSdkVersion" value="19" />