Closed raphaelpreston closed 5 years ago
The 3.0 zero build does not use the 3.0 platform. Did you specify the platform manually or does the cli pull it in? you can set an env var TABRIS_ANDROID_PLATFORM
to a local dir so that the cli consumes the platform from that location.
Also make sure to use the 3.0 tabris cli
Thanks @mpost, but I'm not quite sure what you mean by your comments. In order to help you diagnose my problem I've created a step-by-step way to replicate the exact errors I'm getting.
tabris-plugin-firebase-master/example
npm i
(unsure if I need to do this)
PS C:\Users\$USER\Documents\$APP\replicate steps\tabris-plugin-firebase-master\example> npm i npm notice created a lockfile as package-lock.json. You should commit this file. npm WARN example No repository field. npm WARN example No license field.
added 1 package and audited 1 package in 0.765s
found 0 vulnerabilities
tabris run android
PS C:\Users\$USER\Documents\$APP\test\tabris-plugin-firebase-master\example> tabris run android [./] npm run --if-present build:android [./] npm run --if-present build [./] Copying Cordova files to build/cordova ... [./] Copying JavaScript files to build\cordova\www\app ... [build\cordova\www\app] npm install --production npm notice created a lockfile as package-lock.json. You should commit this file. npm WARN app No repository field. npm WARN app No license field.
added 1 package and audited 1 package in 0.578s found 0 vulnerabilities
[./] Replacing variables in config.xml... [./] Downloading android platform version 3.0.0-beta2-dev.20190207... Unable to download platform: Unexpected status code 404
example/package.json
and change the tabris
dependency from "nightly"
to "3.0.0-beta1"
.tabris run android
PS C:\Users\$USER\Documents\$APP\replicate steps\tabris-plugin-firebase-master\example> tabris run android [./] npm run --if-present build:android [./] npm run --if-present build [./] Copying Cordova files to build/cordova ... [./] Copying JavaScript files to build\cordova\www\app ... [build\cordova\www\app] npm install --production npm WARN app No repository field. npm WARN app No license field.
added 1 package and audited 1 package in 0.789s found 0 vulnerabilities
[./] Replacing variables in config.xml... [C:\Users\$USER\AppData\Roaming\npm\node_modules\tabris-cli\src\services] npm bin [build/cordova] C:\Users\$USER\AppData\Roaming\npm\node_modules\tabris-cli\node_modules.bin\cordova platform add C:\Users\$USER.tabris-cli\platforms\android\3.0.0-beta1 --no-update-notifier Adding android project... Creating Cordova project for the Android platform: Path: platforms\android Package: com.eclipsesource.tabris.firebase.example Name: Tabris.js_Firebase_Plugin_Example Activity: MainActivity Android target: android-27 Subproject Path: CordovaLib Subproject Path: app Android project created with cordova-android@7.1.0 Android Studio project detected Android Studio project detected Discovered plugin "tabris-plugin-firebase" in config.xml. Adding it to the project Failed to restore plugin "tabris-plugin-firebase" from config.xml. You might need to try adding it again. Error: Cannot find plugin.xml for plugin "..". Please try adding it again. [build/cordova] C:\Users\$USER\AppData\Roaming\npm\node_modules\tabris-cli\node_modules.bin\cordova run android --no-update-notifier Android Studio project detected Discovered plugin "tabris-plugin-firebase" in config.xml. Adding it to the project Failed to restore plugin "tabris-plugin-firebase" from config.xml. You might need to try adding it again. Error: Cannot find plugin.xml for plugin "..". Please try adding it again. ANDROID_HOME=C:\Users\$USER\AppData\Local\Android\sdk JAVA_HOME=C:\Program Files\java\jdk1.8.0_101 studio
BUILD SUCCESSFUL in 1s 1 actionable task: 1 executed Subproject Path: CordovaLib Subproject Path: app publishNonDefault is deprecated and has no effect anymore. All variants are now published. 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_cb6qxpfzczmounlzpctn2kdsa.run(C:\Users\$USER\Documents\$APP\replicate steps\tabris-plugin-firebase-master\example\build\cordova\platforms\android\app\build.gradle:150) :CordovaLib:preBuild UP-TO-DATE :CordovaLib:preDebugBuild UP-TO-DATE :CordovaLib:compileDebugAidl :CordovaLib:compileDebugRenderscript :CordovaLib:checkDebugManifest :CordovaLib:generateDebugBuildConfig :CordovaLib:generateDebugResValues :CordovaLib:generateDebugResources :CordovaLib:packageDebugResources :CordovaLib:platformAttrExtractor :CordovaLib:processDebugManifest :CordovaLib:prepareLintJar :CordovaLib:processDebugJavaRes :app:preBuild UP-TO-DATE :app:preDebugBuild :app:compileDebugAidl :CordovaLib:packageDebugRenderscript NO-SOURCE :app:compileDebugRenderscript :app:checkDebugManifest :app:generateDebugBuildConfig :app:generateDebugResValues :app:generateDebugResources :app:mergeDebugResources :app:createDebugCompatibleScreenManifests :app:processDebugManifest :app:splitsDiscoveryTaskDebug :app:prepareLintJar :app:compileDebugNdk NO-SOURCE :CordovaLib:mergeDebugShaders :CordovaLib:compileDebugShaders :CordovaLib:generateDebugAssets :CordovaLib:mergeDebugAssets :app:mergeDebugShaders :app:compileDebugShaders :app:generateDebugAssets :app:mergeDebugAssets :CordovaLib:compileDebugNdk NO-SOURCE :CordovaLib:mergeDebugJniLibFolders :CordovaLib:transformNativeLibsWithMergeJniLibsForDebug :CordovaLib:transformNativeLibsWithIntermediateJniLibsForDebug :app:mergeDebugJniLibFolders :app:processDebugJavaRes NO-SOURCE :app:validateSigningDebug :CordovaLib:processDebugResources :CordovaLib:compileDebugKotlin :CordovaLib:generateDebugSources :CordovaLib:javaPreCompileDebug :CordovaLib:compileDebugJavaWithJavacNote: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details.
:CordovaLib:transformClassesAndResourcesWithPrepareIntermediateJarsForDebug :app:processDebugResources :app:compileDebugKotlin :app:generateDebugSources :app:javaPreCompileDebug :app:compileDebugJavaWithJavac :app:compileDebugSources :app:transformClassesWithStackFramesFixerForDebug :app:transformClassesWithDesugarForDebug :app:transformClassesWithDexBuilderForDebug :app:transformDexArchiveWithExternalLibsDexMergerForDebug :app:transformDexArchiveWithDexMergerForDebug :app:transformNativeLibsWithMergeJniLibsForDebug :app:transformResourcesWithMergeJavaResForDebug :app:packageDebug :app:assembleDebug :app:cdvBuildDebug
BUILD SUCCESSFUL in 41s
49 actionable tasks: 49 executed
Built the following apk(s):
C:\Users\$USER\Documents\$APP\replicate steps\tabris-plugin-firebase-master\example\build\cordova\platforms\android\app\build\outputs\apk\debug\app-debug.apk
ANDROID_HOME=C:\Users\$USER\AppData\Local\Android\sdk
JAVA_HOME=C:\Program Files\java\jdk1.8.0_101
No target specified, deploying to device 'FA7470000812'.
none
Skipping build...
Built the following apk(s):
C:\Users\$USER\Documents\$APP\replicate steps\tabris-plugin-firebase-master\example\build\cordova\platforms\android\app\build\outputs\apk\debug\app-debug.apk
Using apk: C:\Users\$USER\Documents\$APP\replicate steps\tabris-plugin-firebase-master\example\build\cordova\platforms\android\app\build\outputs\apk\debug\app-debug.apk
Package name: com.eclipsesource.tabris.firebase.example
LAUNCH SUCCESS
example/cordova/config.xml
and change the spec
property of the <plugin>
tag to be "https://github.com/eclipsesource/tabris-plugin-firebase.git"
instead of "../"
.tabris clean
tabris run android
PS C:\Users\$USER\Documents\$APP\replicate steps\tabris-plugin-firebase-master\example> tabris run android [./] npm run --if-present build:android [./] npm run --if-present build [./] Copying Cordova files to build/cordova ... [./] Copying JavaScript files to build\cordova\www\app ... [build\cordova\www\app] npm install --production npm WARN app No repository field. npm WARN app No license field.
added 1 package and audited 1 package in 0.743s found 0 vulnerabilities
[./] Replacing variables in config.xml...
[C:\Users\$USER\AppData\Roaming\npm\node_modules\tabris-cli\src\services] npm bin
[build/cordova] C:\Users\$USER\AppData\Roaming\npm\node_modules\tabris-cli\node_modules.bin\cordova platform add C:\Users\$USER.tabris-cli\platforms\android\3.0.0-beta1 --no-update-notifier
Adding android project...
Creating Cordova project for the Android platform:
Path: platforms\android
Package: com.eclipsesource.tabris.firebase.example
Name: Tabris.js_Firebase_Plugin_Example
Activity: MainActivity
Android target: android-27
Subproject Path: CordovaLib
Subproject Path: app
Android project created with cordova-android@7.1.0
Android Studio project detected
Android Studio project detected
Discovered plugin "tabris-plugin-firebase" in config.xml. Adding it to the project
Fetching plugin "https://github.com/eclipsesource/tabris-plugin-firebase.git" via git clone
Repository "https://github.com/eclipsesource/tabris-plugin-firebase.git" checked out to git ref "master".
Installing "tabris-plugin-firebase" for android
Subproject Path: CordovaLib
Subproject Path: app
[build/cordova] C:\Users\$USER\AppData\Roaming\npm\node_modules\tabris-cli\node_modules.bin\cordova run android --no-update-notifier
Android Studio project detected
Error: No "google-services.json" file found in /cordova.Required by plugin "tabris-plugin-firebase" (Android).
The command C:\Users\$USER\AppData\Roaming\npm\node_modules\tabris-cli\node_modules.bin\cordova exited with 1
google-services.json
file into the example/cordova
folder.tabris clean
tabris run android
PS C:\Users\$USER\Documents\$APP\replicate steps\tabris-plugin-firebase-master\example> tabris run android [./] npm run --if-present build:android [./] npm run --if-present build [./] Copying Cordova files to build/cordova ... [./] Copying JavaScript files to build\cordova\www\app ... [build\cordova\www\app] npm install --production npm WARN app No repository field. npm WARN app No license field.added 1 package and audited 1 package in 0.698s found 0 vulnerabilities
[./] Replacing variables in config.xml... [C:\Users\$USER\AppData\Roaming\npm\node_modules\tabris-cli\src\services] npm bin [build/cordova] C:\Users\$USER\AppData\Roaming\npm\node_modules\tabris-cli\node_modules.bin\cordova platform add C:\Users\$USER.tabris-cli\platforms\android\3.0.0-beta1 --no-update-notifier Adding android project... Creating Cordova project for the Android platform: Path: platforms\android Package: com.eclipsesource.tabris.firebase.example Name: Tabris.js_Firebase_Plugin_Example Activity: MainActivity Android target: android-27 Subproject Path: CordovaLib Subproject Path: app Android project created with cordova-android@7.1.0 Android Studio project detected Android Studio project detected Discovered plugin "tabris-plugin-firebase" in config.xml. Adding it to the project Fetching plugin "https://github.com/eclipsesource/tabris-plugin-firebase.git" via git clone Repository "https://github.com/eclipsesource/tabris-plugin-firebase.git" checked out to git ref "master". Installing "tabris-plugin-firebase" for android Subproject Path: CordovaLib Subproject Path: app [build/cordova] C:\Users\$USER\AppData\Roaming\npm\node_modules\tabris-cli\node_modules.bin\cordova run android --no-update-notifier Android Studio project detected ANDROID_HOME=C:\Users\$USER\AppData\Local\Android\sdk JAVA_HOME=C:\Program Files\java\jdk1.8.0_101 studio
BUILD SUCCESSFUL in 1s 1 actionable task: 1 executed Subproject Path: CordovaLib Subproject Path: app publishNonDefault is deprecated and has no effect anymore. All variants are now published. 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_cb6qxpfzczmounlzpctn2kdsa.run(C:\Users\$USER\Documents\$APP\replicate steps\tabris-plugin-firebase-master\example\build\cordova\platforms\android\app\build.gradle:151) Configuration 'compile' in project ':app' is deprecated. Use 'implementation' instead. Could not find google-services.json while looking in [src/debug] registerResGeneratingTask is deprecated, use registerGeneratedFolders(FileCollection) Could not find google-services.json while looking in [src/release] registerResGeneratingTask is deprecated, use registerGeneratedFolders(FileCollection) :CordovaLib:preBuild UP-TO-DATE :CordovaLib:preDebugBuild UP-TO-DATE :CordovaLib:compileDebugAidl :CordovaLib:compileDebugRenderscript :CordovaLib:checkDebugManifest :CordovaLib:generateDebugBuildConfig :CordovaLib:generateDebugResValues :CordovaLib:generateDebugResources :CordovaLib:packageDebugResources :CordovaLib:platformAttrExtractor :CordovaLib:processDebugManifest :CordovaLib:prepareLintJar :CordovaLib:processDebugJavaRes :app:preBuild UP-TO-DATE :app:preDebugBuild :app:compileDebugAidl :CordovaLib:packageDebugRenderscript NO-SOURCE :app:compileDebugRenderscript :app:checkDebugManifest :app:generateDebugBuildConfig :app:generateDebugResValues :app:generateDebugResources :app:processDebugGoogleServices Parsing json file: C:\Users\$USER\Documents\$APP\replicate steps\tabris-plugin-firebase-master\example\build\cordova\platforms\android\app\google-services.json :app:processDebugGoogleServices FAILED
17 actionable tasks: 17 executed FAILURE: Build failed with an exception.
* What went wrong: Execution failed for task ':app:processDebugGoogleServices'. > No matching client found for package name 'com.eclipsesource.tabris.firebase.example'
* Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
* Get more help at https://help.gradle.org
BUILD FAILED in 2s The command C:\Users\$USER\AppData\Roaming\npm\node_modules\tabris-cli\node_modules.bin\cordova exited with 1
example/config.xml
and change the id
property of the <widget>
tag from "com.eclipsesource.tabris.firebase.example"
to the name of my package, as specified in google-services.json
(specifically in the client[0].client_info.android_client_info.package_name
tag).tabris clean
tabris run android
PS C:\Users\$USER\Documents\$APP\replicate steps\tabris-plugin-firebase-master\example> tabris run android [./] npm run --if-present build:android [./] npm run --if-present build [./] Copying Cordova files to build/cordova ... [./] Copying JavaScript files to build\cordova\www\app ... [build\cordova\www\app] npm install --production npm WARN app No repository field. npm WARN app No license field.
added 1 package and audited 1 package in 0.938s found 0 vulnerabilities
[./] Replacing variables in config.xml... [C:\Users\$USER\AppData\Roaming\npm\node_modules\tabris-cli\src\services] npm bin [build/cordova] C:\Users\$USER\AppData\Roaming\npm\node_modules\tabris-cli\node_modules.bin\cordova platform add C:\Users\$USER.tabris-cli\platforms\android\3.0.0-beta1 --no-update-notifier Adding android project... Creating Cordova project for the Android platform: Path: platforms\android Package: com.<$packageID> Name: Tabris.js_Firebase_Plugin_Example Activity: MainActivity Android target: android-27 Subproject Path: CordovaLib Subproject Path: app Android project created with cordova-android@7.1.0 Android Studio project detected Android Studio project detected Discovered plugin "tabris-plugin-firebase" in config.xml. Adding it to the project Fetching plugin "https://github.com/eclipsesource/tabris-plugin-firebase.git" via git clone Repository "https://github.com/eclipsesource/tabris-plugin-firebase.git" checked out to git ref "master". Installing "tabris-plugin-firebase" for android Subproject Path: CordovaLib Subproject Path: app [build/cordova] C:\Users\$USER\AppData\Roaming\npm\node_modules\tabris-cli\node_modules.bin\cordova run android --no-update-notifier Android Studio project detected ANDROID_HOME=C:\Users\$USER\AppData\Local\Android\sdk JAVA_HOME=C:\Program Files\java\jdk1.8.0_101 studio Starting a Gradle Daemon, 1 incompatible and 2 stopped Daemons could not be reused, use --status for details
BUILD SUCCESSFUL in 6s 1 actionable task: 1 executed Subproject Path: CordovaLib Subproject Path: app Starting a Gradle Daemon, 1 incompatible and 2 stopped Daemons could not be reused, use --status for details publishNonDefault is deprecated and has no effect anymore. All variants are now published. 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_cb6qxpfzczmounlzpctn2kdsa.run(C:\Users\$USER\Documents\$APP\replicate steps\tabris-plugin-firebase-master\example\build\cordova\platforms\android\app\build.gradle:151) Configuration 'compile' in project ':app' is deprecated. Use 'implementation' instead. Could not find google-services.json while looking in [src/debug] registerResGeneratingTask is deprecated, use registerGeneratedFolders(FileCollection) Could not find google-services.json while looking in [src/release] registerResGeneratingTask is deprecated, use registerGeneratedFolders(FileCollection) :CordovaLib:preBuild UP-TO-DATE :CordovaLib:preDebugBuild UP-TO-DATE :CordovaLib:compileDebugAidl :CordovaLib:compileDebugRenderscript :CordovaLib:checkDebugManifest :CordovaLib:generateDebugBuildConfig :CordovaLib:generateDebugResValues :CordovaLib:generateDebugResources :CordovaLib:packageDebugResources :CordovaLib:platformAttrExtractor :CordovaLib:processDebugManifest :CordovaLib:prepareLintJar :CordovaLib:processDebugJavaRes :app:preBuild UP-TO-DATE :app:preDebugBuild :app:compileDebugAidl :CordovaLib:packageDebugRenderscript NO-SOURCE :app:compileDebugRenderscript :app:checkDebugManifest :app:generateDebugBuildConfig :app:generateDebugResValues :app:generateDebugResources :app:processDebugGoogleServices Parsing json file: C:\Users\$USER\Documents\$APP\replicate steps\tabris-plugin-firebase-master\example\build\cordova\platforms\android\app\google-services.json :app:mergeDebugResources :app:createDebugCompatibleScreenManifests :app:processDebugManifest :app:splitsDiscoveryTaskDebug :app:prepareLintJar :app:compileDebugNdk NO-SOURCE :CordovaLib:mergeDebugShaders :CordovaLib:compileDebugShaders :CordovaLib:generateDebugAssets :CordovaLib:mergeDebugAssets :app:mergeDebugShaders :app:compileDebugShaders :app:generateDebugAssets :app:mergeDebugAssets :CordovaLib:compileDebugNdk NO-SOURCE :CordovaLib:mergeDebugJniLibFolders :CordovaLib:transformNativeLibsWithMergeJniLibsForDebug :CordovaLib:transformNativeLibsWithIntermediateJniLibsForDebug :app:mergeDebugJniLibFolders :app:processDebugJavaRes NO-SOURCE :app:validateSigningDebug :CordovaLib:processDebugResources :CordovaLib:compileDebugKotlin :CordovaLib:generateDebugSources :CordovaLib:javaPreCompileDebug :CordovaLib:compileDebugJavaWithJavacNote: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details.
:CordovaLib:transformClassesAndResourcesWithPrepareIntermediateJarsForDebug
:app:processDebugResources
:app:compileDebugKotline: C:\Users\$USER\Documents\$APP\replicate steps\tabris-plugin-firebase-master\example\build\cordova\platforms\android\app\src\main\java\com\eclipsesource\firebase\analytics\Analytics.kt: (6, 54): Unresolved reference: asSequence
e: C:\Users\$USER\Documents\$APP\replicate steps\tabris-plugin-firebase-master\example\build\cordova\platforms\android\app\src\main\java\com\eclipsesource\firebase\analytics\Analytics.kt: (38, 23): Unresolved reference. None of the following candidates is applicable because of receiver type mismatch:
@InlineOnly public inline fun
40 actionable tasks: 40 executed FAILURE: Build failed with an exception.
* What went wrong: Execution failed for task ':app:compileDebugKotlin'. > Compilation error. See log for more details
* Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
* Get more help at https://help.gradle.org
BUILD FAILED in 38s
The final error is the error that I made the original post for. Hopefully this makes it easier to figure out what my problem is! Thanks in advance.
@raphaelpreston See add the plugin to your project; the plugin is downloaded automatically as part of the build process, no need to download anything manually
@raphaelpreston You might be right about updating the examples app id in the config.xml of the example since the firebase support is tied to a specific app id. we will update the example README.
Regarding your current compile errors that sounds very much like the incorrect tabris-android platform which does not include the correct files. The platform is auto downloaded for you i presume? You did not specify a local path to the platform via the TABRIS_ANDROID_PLATFORM
env var? The platform can be downloaded from here (need to be signed in).
regarding the app id the google-services.json provided by the user, it could also reference an app which would have the same id as the example app: com.eclipsesource.tabris.firebase.example
. Both approaches should work.
@raphaelpreston See add the plugin to your project; the plugin is downloaded automatically as part of the build process, no need to download anything manually
@cookieguru I was a bit unclear about what exactly I was downloading; I wasn't downloading the plugin to install it, I was downloading it so I could get the example project inside the repo running.
@mpost I realized that there might have been a conflict because I was running tabris-cli@3.0.0-beta1
, and the dependency for the firebase example says nightly
, so I installed tabris-cli@nightly
.
In regard to your response, here's how I attempted to follow your instructions:
tabris-android
extracted from the .zip file.tabris clean
and tabris run android
PS C:\Users\$USER\Documents\$APP\newsteps\tabris-plugin-firebase-master\example> tabris run android [./] npm run --if-present build:android [./] npm run --if-present build [./] Copying Cordova files to build/cordova ... [./] Copying JavaScript files to build\cordova\www\app ... [build\cordova\www\app] npm install --production npm WARN app No repository field. npm WARN app No license field.
added 1 package and audited 1 package in 0.936s found 0 vulnerabilities
[./] Replacing variables in config.xml... [C:\Users\$USER\AppData\Roaming\npm\node_modules\tabris-cli\src\services] npm bin [build/cordova] C:\Users\$USER\AppData\Roaming\npm\node_modules\tabris-cli\node_modules.bin\cordova platform add "C:\Users\$USER\Documents\$APP\ANDROID PLATFORM\tabris-android" --no-update-notifier Adding android project... Creating Cordova project for the Android platform: Path: platforms\android Package: com.<$PACKAGE_ID> Name: Tabris.js_Firebase_Plugin_Example Activity: MainActivity Android target: android-27 Subproject Path: CordovaLib Subproject Path: app Android project created with cordova-android@7.1.0 Android Studio project detected Android Studio project detected Discovered plugin "tabris-plugin-firebase" in config.xml. Adding it to the project Installing "tabris-plugin-firebase" for android Subproject Path: CordovaLib Subproject Path: app Saved plugin info for "tabris-plugin-firebase" to config.xml --save flag or autosave detected Saving android@C:\Users\$USER\Documents\$APP\ANDROID PLATFORM\tabris-android into config.xml file ... [build/cordova] C:\Users\$USER\AppData\Roaming\npm\node_modules\tabris-cli\node_modules.bin\cordova run android --no-update-notifier Android Studio project detected ANDROID_HOME=C:\Users\$USER\AppData\Local\Android\sdk JAVA_HOME=C:\Program Files\java\jdk1.8.0_101 studio Starting a Gradle Daemon (subsequent builds will be faster)
BUILD SUCCESSFUL in 5s 1 actionable task: 1 executed Subproject Path: CordovaLib Subproject Path: app Starting a Gradle Daemon (subsequent builds will be faster) publishNonDefault is deprecated and has no effect anymore. All variants are now published. 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_bzogsxz4a5oespmlguk4rtfx5.run(C:\Users\$USER\Documents\$APP\newsteps\tabris-plugin-firebase-master\example\build\cordova\platforms\android\app\build.gradle:151) Configuration 'compile' in project ':app' is deprecated. Use 'implementation' instead. Could not find google-services.json while looking in [src/debug] registerResGeneratingTask is deprecated, use registerGeneratedFolders(FileCollection) Could not find google-services.json while looking in [src/release] registerResGeneratingTask is deprecated, use registerGeneratedFolders(FileCollection) :CordovaLib:preBuild UP-TO-DATE :CordovaLib:preDebugBuild UP-TO-DATE :CordovaLib:compileDebugAidl :CordovaLib:compileDebugRenderscript :CordovaLib:checkDebugManifest :CordovaLib:generateDebugBuildConfig :CordovaLib:generateDebugResValues :CordovaLib:generateDebugResources :CordovaLib:packageDebugResources :CordovaLib:platformAttrExtractor :CordovaLib:processDebugManifest :CordovaLib:prepareLintJar :CordovaLib:processDebugJavaRes :app:preBuild UP-TO-DATE :app:preDebugBuild :app:compileDebugAidl :CordovaLib:packageDebugRenderscript NO-SOURCE :app:compileDebugRenderscript :app:checkDebugManifest :app:generateDebugBuildConfig :app:generateDebugResValues :app:generateDebugResources :app:processDebugGoogleServices Parsing json file: C:\Users\$USER\Documents\$APP\newsteps\tabris-plugin-firebase-master\example\build\cordova\platforms\android\app\google-services.json :app:mergeDebugResources :app:createDebugCompatibleScreenManifests :app:processDebugManifest :app:splitsDiscoveryTaskDebug :app:prepareLintJar :app:compileDebugNdk NO-SOURCE :CordovaLib:mergeDebugShaders :CordovaLib:compileDebugShaders :CordovaLib:generateDebugAssets :CordovaLib:mergeDebugAssets :app:mergeDebugShaders :app:compileDebugShaders :app:generateDebugAssets :app:mergeDebugAssets :CordovaLib:compileDebugNdk NO-SOURCE :CordovaLib:mergeDebugJniLibFolders :CordovaLib:transformNativeLibsWithMergeJniLibsForDebug :CordovaLib:transformNativeLibsWithIntermediateJniLibsForDebug :app:mergeDebugJniLibFolders :app:processDebugJavaRes NO-SOURCE :app:validateSigningDebug :CordovaLib:processDebugResources :CordovaLib:compileDebugKotlin :CordovaLib:generateDebugSources :CordovaLib:javaPreCompileDebug :CordovaLib:compileDebugJavaWithJavacNote: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details.
:CordovaLib:transformClassesAndResourcesWithPrepareIntermediateJarsForDebug
:app:processDebugResources
:app:compileDebugKotline: C:\Users\$USER\Documents\$APP\newsteps\tabris-plugin-firebase-master\example\build\cordova\platforms\android\app\src\main\java\com\eclipsesource\firebase\analytics\Analytics.kt: (6, 54): Unresolved reference: asSequence
e: C:\Users\$USER\Documents\$APP\newsteps\tabris-plugin-firebase-master\example\build\cordova\platforms\android\app\src\main\java\com\eclipsesource\firebase\analytics\Analytics.kt: (38, 23): Unresolved reference. None of the following candidates is applicable because of receiver type mismatch:
@InlineOnly public inline fun
40 actionable tasks: 40 executed FAILURE: Build failed with an exception.
* What went wrong: Execution failed for task ':app:compileDebugKotlin'. > Compilation error. See log for more details
* Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
* Get more help at https://help.gradle.org
BUILD FAILED in 48s
The command C:\Users\$USER\AppData\Roaming\npm\node_modules\tabris-cli\node_modules.bin\cordova exited with 1
If you look at the output, you'll see it's the same error from before. Furthermore, because the output says
[build/cordova] C:\Users\$USER\AppData\Roaming\npm\node_modules\tabris-cli\node_modules.bin\cordova platform add "C:\Users\$USER\Documents\Notify_App\ANDROID PLATFORM\tabris-android" --no-update-notifier
I know it found the folder that I downloaded, meaning that the problem must not be the incorrect tabris-android platform. I performed the steps above with tabris-cli@nightly
, but just to see if it would fix anything I reinstalled tabris-cli@3.0.0-beta1
and ran it, but it resulted in the same error.
hi @raphaelpreston i am investigating what might cause your issue but ran into an issue on the latest nightly tabris-cli caused by cordova (does not affect the 3.0-beta1 cli). We opened an issue for that here. Please stay tuned for more feedback.
I was able to reproduce the build error you reported. While i can't yet judge what causes the issue it will work with the nightly
android platform of 3.x (due out tonight) and the master
branch of the plugin.
Unfortunately, it's still not working... although, it is throwing a different error now! I created a repo and uploaded all the files from the example, without changing anything (except for the spec
property in config.xml
to appropriately point to the plugin). I'm using the online build service to build, and here is a little snippet of where the error is thrown:
Adding android project...
Failed to require PlatformApi instance for platform "android". Using polyfill instead.
Running command: /home/travis/.tabris-cli/platforms/android/3.0.0-beta2-dev.20190214/bin/create /home/travis/build/eclipsesource/tabris-js-build-template/build/build/cordova/platforms/android com.eclipsesource.tabris.firebase.example "Firebase Plugin Example for Tabris.js" --cli
internal/modules/cjs/loader.js:583
throw err;
^
Error: Cannot find module 'cordova-common'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15)
at Function.Module._load (internal/modules/cjs/loader.js:507:25)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:22:18)
at Object. (/home/travis/.tabris-cli/platforms/android/3.0.0-beta2-dev.20190214/bin/create:22:20)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)
Command finished with error code 1: /home/travis/.tabris-cli/platforms/android/3.0.0-beta2-dev.20190214/bin/create /home/travis/build/eclipsesource/tabris-js-build-template/build/build/cordova/platforms/android,com.eclipsesource.tabris.firebase.example,Firebase Plugin Example for Tabris.js,--cli
Error: /home/travis/.tabris-cli/platforms/android/3.0.0-beta2-dev.20190214/bin/create: Command failed with exit code 1
at ChildProcess.whenDone (/home/travis/.nvm/versions/node/v10.15.1/lib/node_modules/tabris-cli/node_modules/cordova-common/src/superspawn.js:169:23)
at ChildProcess.emit (events.js:189:13)
at maybeClose (internal/child_process.js:970:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
The command /home/travis/.nvm/versions/node/v10.15.1/lib/node_modules/tabris-cli/node_modules/.bin/cordova exited with 1
I'm running the build service with the following settings:
I tried building locally too, and I got a different error. First I got the expected error that there is no google-services.json
file so I downloaded it from Firebase and put it in the correct directory. I cleaned and ran it again and this is the error I'm getting now:
:app:processDebugGoogleServices
Found com.google.firebase:firebase-messaging:17.3.4, but version 16.0.7 is needed for the google-services plugin.
:app:processDebugGoogleServices FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processDebugGoogleServices'.
> Please fix the version conflict either by updating the version of the google-services plugin (information about the latest version is available at https://bintray.com/android/android-tools/com.google.gms.google-services/) or updating the version of com.google.android.gms to 16.0.7.
17 actionable tasks: 17 executed
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
* Get more help at https://help.gradle.org
BUILD FAILED in 13s
This error occurs with the cli at both 3.0.0-beta1
and at 3.0.0-beta1-dev.20190214
Hi Rapheal. Thanks for all your detailed feedback. We have fixed the issue you are describing in the nightly builds. So you should be able to build locally when you put nightly
in your package.json. You will also need to use the nightly tabris-cli (from the master
branch) and finally rename the example folder to eg .example due to a bug in the cordova-cli.
Please give it another shoot and thanks for your patients.
@mpost thanks for helping me resolve this. Unfortunately, I followed your steps and I'm still receiving errors. Here's what I did:
example
to .example
, run npm i -g tabris-cli@nightly
. tabris --version
command gives output 3.0.0-beta1-dev.20190217
.google-services.json
to the .example/cordova
foldernightly
in the package.json
tabris run android
, output is:
Discovered plugin "tabris-plugin-firebase" in config.xml. Adding it to the project
Failed to restore plugin "tabris-plugin-firebase" from config.xml. You might need to try adding it again. Error: Invalid Plugin! .. needs a valid package.json
spec
property of the plugin in config.xml
to https://github.com/eclipsesource/tabris-plugin-firebase.git
tabris clean
and tabris run android
.
PS C:\Users\USER\Documents\APP\2-18\tabris-plugin-firebase-master\.example> tabris run android [./] npm run --if-present build:android [./] npm run --if-present build [./] Copying Cordova files to build/cordova ... [./] Copying JavaScript files to build\cordova\www\app ... [build\cordova\www\app] npm install --production npm notice created a lockfile as package-lock.json. You should commit this file. npm WARN app No repository field. npm WARN app No license field.
added 1 package and audited 1 package in 0.805s found 0 vulnerabilities
[./] Replacing variables in config.xml... [C:\Users\USER\AppData\Roaming\npm\node_modules\tabris-cli\src\services] npm bin [build/cordova] C:\Users\USER\AppData\Roaming\npm\node_modules\tabris-cli\node_modules.bin\cordova platform add "C:\Users\USER\Documents\APP\ANDROID PLATFORM\tabris-android" --no-update-notifier Adding android project... Creating Cordova project for the Android platform: Path: platforms\android Package: com.eclipsesource.tabris.firebase.example Name: Firebase_Plugin_Example_for_Tabris.js Activity: MainActivity Android target: android-27 Subproject Path: CordovaLib Subproject Path: app Android project created with cordova-android@7.1.0 Android Studio project detected Android Studio project detected Discovered plugin "tabris-plugin-firebase" in config.xml. Adding it to the project Failed to restore plugin "tabris-plugin-firebase" from config.xml. You might need to try adding it again. Error: Invalid Plugin! .. needs a valid package.json --save flag or autosave detected Saving android@C:\Users\USER\Documents\APP\ANDROID PLATFORM\tabris-android into config.xml file ... The command C:\Users\USER\AppData\Roaming\npm\node_modules\tabris-cli\node_modules.bin\cordova exited with 1 PS C:\Users\USER\Documents\APP\2-18\tabris-plugin-firebase-master.example> tabris clean Removing build/ folder PS C:\Users\USER\Documents\APP\2-18\tabris-plugin-firebase-master.example> tabris run android
[./] npm run --if-present build:android [./] npm run --if-present build [./] Copying Cordova files to build/cordova ... [./] Copying JavaScript files to build\cordova\www\app ... [build\cordova\www\app] npm install --production npm notice created a lockfile as package-lock.json. You should commit this file. npm WARN app No repository field. npm WARN app No license field.
added 1 package and audited 1 package in 0.803s found 0 vulnerabilities
[./] Replacing variables in config.xml... [C:\Users\USER\AppData\Roaming\npm\node_modules\tabris-cli\src\services] npm bin [build/cordova] C:\Users\USER\AppData\Roaming\npm\node_modules\tabris-cli\node_modules.bin\cordova platform add "C:\Users\USER\Documents\APP\ANDROID PLATFORM\tabris-android" --no-update-notifier Adding android project... Creating Cordova project for the Android platform: Path: platforms\android Package: com.eclipsesource.tabris.firebase.example Name: Firebase_Plugin_Example_for_Tabris.js Activity: MainActivity Android target: android-27 Subproject Path: CordovaLib Subproject Path: app Android project created with cordova-android@7.1.0 Android Studio project detected Android Studio project detected Discovered plugin "tabris-plugin-firebase" in config.xml. Adding it to the project Installing "tabris-plugin-firebase" for android Subproject Path: CordovaLib Subproject Path: app Saved plugin info for "tabris-plugin-firebase" to config.xml --save flag or autosave detected Saving android@C:\Users\USER\Documents\APP\ANDROID PLATFORM\tabris-android into config.xml file ... [build/cordova] C:\Users\USER\AppData\Roaming\npm\node_modules\tabris-cli\node_modules.bin\cordova run android --no-update-notifier Android Studio project detected ANDROID_HOME=C:\Users\USER\AppData\Local\Android\sdk JAVA_HOME=C:\Program Files\java\jdk1.8.0_101 studio Starting a Gradle Daemon, 1 incompatible and 2 stopped Daemons could not be reused, use --status for details
BUILD SUCCESSFUL in 6s 1 actionable task: 1 executed Subproject Path: CordovaLib Subproject Path: app Starting a Gradle Daemon, 1 incompatible and 2 stopped Daemons could not be reused, use --status for details publishNonDefault is deprecated and has no effect anymore. All variants are now published. 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_7wfggksbrsnhwlupaxsh45lkt.run(C:\Users\USER\Documents\APP\2-18\tabris-plugin-firebase-master.example\build\cordova\platforms\android\app\build.gradle:151) Configuration 'compile' in project ':app' is deprecated. Use 'implementation' instead. Could not find google-services.json while looking in [src/debug] registerResGeneratingTask is deprecated, use registerGeneratedFolders(FileCollection) Could not find google-services.json while looking in [src/release] registerResGeneratingTask is deprecated, use registerGeneratedFolders(FileCollection) :CordovaLib:preBuild UP-TO-DATE :CordovaLib:preDebugBuild UP-TO-DATE :CordovaLib:compileDebugAidl :CordovaLib:compileDebugRenderscript :CordovaLib:checkDebugManifest :CordovaLib:generateDebugBuildConfig :CordovaLib:generateDebugResValues :CordovaLib:generateDebugResources :CordovaLib:packageDebugResources :CordovaLib:platformAttrExtractor :CordovaLib:processDebugManifest :CordovaLib:prepareLintJar :CordovaLib:processDebugJavaRes :app:preBuild UP-TO-DATE :app:preDebugBuild :app:compileDebugAidl :CordovaLib:packageDebugRenderscript NO-SOURCE :app:compileDebugRenderscript :app:checkDebugManifest :app:generateDebugBuildConfig :app:generateDebugResValues :app:generateDebugResources :app:processDebugGoogleServices Found com.google.firebase:firebase-messaging:17.3.4, but version 16.0.7 is needed for the google-services plugin. :app:processDebugGoogleServices FAILED
FAILURE: Build failed with an exception.
What went wrong: Execution failed for task ':app:processDebugGoogleServices'.
Please fix the version conflict either by updating the version of the google-services plugin (information about the latest version is available at https://bintray.com/android/android-tools/com.google.gms.google-services/) or updating the version of com.google.android.gms to 16.0.7.
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Get more help at https://help.gradle.org
BUILD FAILED in 12s
As you can see, this is the same error as my previous comment. Also, just to be sure, I changed the id
in config to match my google-services.json
project ID but that didn't fix anything. I also cleared my gradle cache but that didn't help either.
Here we are looking at on oversight on our part. We will update the 3.0.0-beta1-dev.XXXX
to beta2
.
Update: https://github.com/eclipsesource/tabris-js-cli/commit/bb3030083ee469639ab380694ea273871085f06e
That being said, how do you "download" the zip file for the plugin? It should be sufficient to git clone npm install
and tabris build android
Below i have attached the build output when i run tabris build android
on Windows with the nightly cli checked out from gtihub repo (and made available on the cli by running npm install
and npm link
inside the tabris-js-cli folder)
mpost@MP-Dell MINGW64 ~/git/tabris-plugin-firebase/.example (master) $ tabris build android [./] npm run --if-present build:android [./] npm run --if-present build [./] Copying Cordova files to build/cordova ... [./] Copying JavaScript files to build\cordova\www\app ... [build\cordova\www\app] npm install --production npm WARN app No repository field. npm WARN app No license field. audited 1 package in 0.761s found 0 vulnerabilities [./] Replacing variables in config.xml... [./] Downloading android platform version 3.0.0-beta2-dev.20190220... [./] Extracting platform... [C:\Users\mpost\git\tabris-js-cli\src\services] npm bin [build/cordova] C:\Users\mpost\git\tabris-js-cli\node_modules\.bin\cordova platform add C:\Users\mpost\.tabris-cli\platforms\android\3.0.0-beta2-dev.20190220 --no-update-notifier Adding android project... Creating Cordova project for the Android platform: Path: platforms\android Package: com.eclipsesource.tabris.firebase.example Name: Firebase_Plugin_Example_for_Tabris.js Activity: MainActivity Android target: android-28 Subproject Path: CordovaLib Subproject Path: app Android project created with cordova-android@8.0.0 Discovered plugin "tabris-plugin-firebase" in config.xml. Adding it to the project Installing "tabris-plugin-firebase" for android Subproject Path: CordovaLib Subproject Path: app Saved plugin info for "tabris-plugin-firebase" to config.xml --save flag or autosave detected Saving android@C:\Users\mpost\.tabris-cli\platforms\android\3.0.0-beta2-dev.20190220 into config.xml file ... [build/cordova] C:\Users\mpost\git\tabris-js-cli\node_modules\.bin\cordova build android --no-update-notifier Checking Java JDK and Android SDK versions ANDROID_SDK_ROOT=undefined (recommended setting) ANDROID_HOME=C:\Users\mpost\AppData\Local\Android\android-sdk (DEPRECATED) :wrapper BUILD SUCCESSFUL Total time: 1.798 secs Subproject Path: CordovaLib Subproject Path: app > Configure project :app registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection) registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection) > Transform kotlin-stdlib-common.jar (org.jetbrains.kotlin:kotlin-stdlib-common:1.3.21) with JetifyTransform > Transform kotlin-stdlib-common.jar (org.jetbrains.kotlin:kotlin-stdlib-common:1.3.21) with IdentityTransform ...build output continues...
Whoops, it appears that I had forgotten to run npm i
in my previous step. However, I went back and tried again with 3.0.0-beta1-dev.20190217
(running npm i
this time), but it still failed on app:ProcessDebugGoogleServices
with the same error as my previous comment. So that wasn't the problem.
Also, to answer your question, I'm downloading the plugin from the repo itself in .zip file format, and then extracting it. I realize I could clone it with git too, but I prefer this method.
tabris-plugin-firebase-master/example
to tabris-plugin-firebase-master/.example
.google-services.json
file into the .example/cordova
folder.npm i -g tabris-cli@nightly
. tabris --version
now outputs '3.0.0-beta1-dev.20190219'
.npm i
.tabris run android
. Fails on :app:processDebugGoogleServices
, just as in my previous comment.At this point, I took a look at your build output and realized that our cordova-android versions were differing, yours being at 8.0.0 and mine at 7.1.0. Then I remembered that I still had my TABRIS_ANDROID_VERSION environment variable set from this comment. So, I deleted the environmental variable, and then performed the following.
tabris clean
tabris run android
This fixed the problem. The APK was build successfully and deployed to my device, and the app ran successfully and the token was printed on the screen.
So, in closing, these are the specific instructions that I follow to make the entire thing work from scratch. I'm not going to be renaming the /example
folder because even when I rename it still says it can't install the plugin.
google-services.json
file from the Firebase console into the example/cordova
folder.spec
property of the <plugin>
tag in cordova/config.xml
from '../'
to 'https://github.com/eclipsesource/tabris-plugin-firebase.git'
.id
property of the <widget>
tag in cordova/config.xml
from 'com.eclipsesource.tabris.firebase.example'
to the value of client.client_info.android_client_info.package_name
in the google-services.json
file.npm i -g tabris-cli@nightly
, tabris --version
now outputs '3.0.0-beta1-dev.20190219'
.npm i
.I also tested this with tabris-cli@3.0.0-beta1
and it works too. Seems like the issue was needing the cordova-android
at 8.0.0
and not 7.1.0
, meaning that as long as the tabris dependency in package.json
is nightly, it should work.
Thank you all for the help. I'll leave this open for you to close if you'd like.
Good to hear that we have solved the issue. It is unfortunate that the one tipp i gave previously (about the env var) lead to another error down the road.
I was hoping to see the output of a working build would give a clue of what is going on.
Btw.... installing the tabris-cli@nightly now will give you the correct version name "beta2" as you can see under the "versions" tab https://www.npmjs.com/package/tabris-cli
If you feel the problems are resolved you should close the issue.
Problem description
Building the example project for Android fails upon
:app:compileDebugKotlin
in 3.0.0-beta1 and fails on a cordova version conflict in 2.6.3.The entire error pastes are in the dropdowns below.
package.json specifies: "3.0.0-beta1" & tabris --version says 3.0.0-beta1
package.json specifies: "^2.6.3" & tabris --version says 2.6.3
Environment
Code snippet
Nothing has been changed from the example except for:
<plugin>
tag in cordova/config.xml was changed fromspec="../"
tospec="https://github.com/eclipsesource/tabris-plugin-firebase.git"