Meteor-Community-Packages / raix-push

DEPRECATED: Push notifications for cordova (ios, android) browser (Chrome, Safari, Firefox)
https://atmospherejs.com/raix/push
MIT License
515 stars 197 forks source link

Build fail #371

Open dev8gvisp opened 5 years ago

dev8gvisp commented 5 years ago

Hello, i am having trouble integrating raix:push to Meteor project. It is difficult for me to follow installation procedure.

I have created new blank Meteor project. Meteor is v1.8.1

These are steps i tried:

  1. meteor create push-test
  2. meteor add-platform android
  3. meteor run android-device result>APP BUILDS
  4. meteor add raix:push
  5. meteor run android-device result>ERROR

Where: Script /home/borivojeskrbina/Documents/meteor/push-test/.meteor/local/cordova-build/platforms/android/phonegap-plugin-push/yk17zv6fodte-push.gradle line: 6 What went wrong: A problem occurred evaluating script. home/borivojeskrbina/Documents/meteor/push-test/.meteor/local/cordova-build/platforms/android/app/AndroidManifest.xml (No such file or directory)

Questions:

  1. I see that "phonegap-plugin-push" is already installed (v1.9.0). Does it installs with raix:puh? Documentation say it should be installed separately.

  2. AndroidManifest.xml is located in platforms/android/app/src/main but "phonegap-plugin-push" is trying to find it in platforms/android/app. Should i copy AndroidManifest.xml to app folder? Then i will have 2 AndroidManifest.xml files.

  3. I copied AndroidManifest.xml to app folder and build app: result>APP BUILDS

  4. meteor add cordova:cordova-plugin-device@2.0.3

  5. meteor run android-device result>APP BUILDS

  6. Added phonegap-plugin-push@2.1.2 to cordova-plugins

  7. meteor run android-device result>ERROR

What went wrong: Execution failed for task ':app:processDebugGoogleServices'. File google-services.json is missing. The Google Services Plugin cannot function without it.

  1. Copied google-services.json to platforms/android/app
  2. meteor run android-device result>ERROR

What went wrong: Execution failed for task ':app:processDebugGoogleServices'. No matching client found for package name 'com.idh35i361d1pil.yk17zv6fodte'

  1. In mobile-config.js i added

App.info({ id: "com.gvisp.smartshoppinguser", });

  1. meteor run android-device result>ERROR

/home/borivojeskrbina/Documents/meteor/push-test/.meteor/local/cordova-build/platforms/android/gradlew: Command failed with exit code 1 Error output: Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: Some input files use unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. java.lang.IllegalStateException: Dex archives: setting .DEX extension only for .CLASS files

What went wrong: Execution failed for task ':app:transformClassesWithDexBuilderForDebug'. com.android.build.api.transform.TransformException: java.lang.IllegalStateException: Dex archives: setting .DEX extension only for .CLASS files

Can you tell me why build fails? I didn't do any coding yet, just trying to build. Thanks for help.

da314pc commented 5 years ago

@dev8gvisp Dont copy or move any android manifest files, they are automatically generated

You have to add the google services json file in your ".meteor\local\cordova-build\platforms\android" Folder, This file you can get from Firebase

Mobile config json App.info({ id: 'com.gvisp.smartshoppinguser', });

Download android studio, and open the platforms android folder, you need to download the java libraries with gradle

in build.gradle

configurations.all { resolutionStrategy { force 'com.android.support:support-v4:27.1.0' } }

configurations { all*.exclude group: 'com.android.support', module: 'support-v13' }

da314pc commented 5 years ago

The correct gradle file to modify has this line at the begining of the file:

apply plugin: 'com.android.application'

Add this two your dependencies:

classpath 'com.google.gms:google-services:4.1.0' // I added both of these classpath 'com.google.firebase:firebase-core:11.0.1' // I added both of these At the end of your build.gradle file add:

apply plugin: 'com.google.gms.google-services' In case your run into errors with conflicting google libraries add:

configurations.all { resolutionStrategy { force 'com.android.support:support-v4:27.1.0' } }

configurations { all*.exclude group: 'com.android.support', module: 'support-v13' }

da314pc commented 5 years ago

This library needs dependencies that do not come bundled with the cordova app.