[aerogear-dev] Gradle help for Cordova (was: Re: Cordova-FCM issue (was: Re: Android Push: Firebase Cloud Messaging))

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[aerogear-dev] Gradle help for Cordova (was: Re: Cordova-FCM issue (was: Re: Android Push: Firebase Cloud Messaging))

Matthias Wessendorf
hello,

trying the fcm branch, I get this Gralde error. Should we add (dynamic) applicationId in our file?

like done here?

Does that work ? Or are there some concerns ? 


It looks like Firebase now does require this:


06-10 10:52:52.039  4894  4894 E AndroidRuntime: java.lang.RuntimeException: Unable to get provider com.google.firebase.provider.FirebaseInitProvider: java.lang.IllegalStateException: Incorrect provider authority in manifest. Most likely due to a missing applicationId variable in application's build.gradle.
06-10 10:52:52.039  4894  4894 E AndroidRuntime: at android.app.ActivityThread.installProvider(ActivityThread.java:5156)
06-10 10:52:52.039  4894  4894 E AndroidRuntime: at android.app.ActivityThread.installContentProviders(ActivityThread.java:4748)
06-10 10:52:52.039  4894  4894 E AndroidRuntime: at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4688)
06-10 10:52:52.039  4894  4894 E AndroidRuntime: at android.app.ActivityThread.-wrap1(ActivityThread.java)
06-10 10:52:52.039  4894  4894 E AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1405)
06-10 10:52:52.039  4894  4894 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:102)
06-10 10:52:52.039  4894  4894 E AndroidRuntime: at android.os.Looper.loop(Looper.java:148)
06-10 10:52:52.039  4894  4894 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:5417)
06-10 10:52:52.039  4894  4894 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
06-10 10:52:52.039  4894  4894 E AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
06-10 10:52:52.039  4894  4894 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
06-10 10:52:52.039  4894  4894 E AndroidRuntime: Caused by: java.lang.IllegalStateException: Incorrect provider authority in manifest. Most likely due to a missing applicationId variable in application's build.gradle.
06-10 10:52:52.039  4894  4894 E AndroidRuntime: at com.google.firebase.provider.FirebaseInitProvider.zza(Unknown Source)
06-10 10:52:52.039  4894  4894 E AndroidRuntime: at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source)
06-10 10:52:52.039  4894  4894 E AndroidRuntime: at android.app.ActivityThread.installProvider(ActivityThread.java:5153)
06-10 10:52:52.039  4894  4894 E AndroidRuntime: ... 10 more
06-10 10:52:52.040  4996  2592 W ActivityManager:   Force finishing activity org.jboss.aerogear.unifiedpush.HelloWorld/.MainActivity


On Fri, Jun 10, 2016 at 10:58 AM, Matthias Wessendorf <[hidden email]> wrote:
Hi,

I think I am running into the issue, that I am not having the google-service.json file present, in my app.


My try to update our plugin is here:


And I am using this app:

My "www/push-config.json" file content is here:

After updating that, I did follow the instructions, on the readme, in the "cordova" folder of the helloworld:

1) cordova platform add android
3) cordova run android


But, when the app launches, it crashes



06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: java.lang.RuntimeException: Unable to get provider com.google.firebase.provider.FirebaseInitProvider: java.lang.IllegalStateException: Incorrect provider authority in manifest. Most likely due to a missing applicationId variable in application's build.gradle.
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at android.app.ActivityThread.installProvider(ActivityThread.java:5156)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at android.app.ActivityThread.installContentProviders(ActivityThread.java:4748)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4688)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at android.app.ActivityThread.-wrap1(ActivityThread.java)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1405)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:102)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at android.os.Looper.loop(Looper.java:148)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:5417)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: Caused by: java.lang.IllegalStateException: Incorrect provider authority in manifest. Most likely due to a missing applicationId variable in application's build.gradle.
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at com.google.firebase.provider.FirebaseInitProvider.zza(Unknown Source)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at android.app.ActivityThread.installProvider(ActivityThread.java:5153)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: ... 10 more
06-10 10:52:52.<a href="tel:040%20%C2%A04996%20%C2%A02592" value="+494049962592" target="_blank">040  4996  2592 W ActivityManager:   Force finishing activity org.jboss.aerogear.unifiedpush.HelloWorld/.MainActivity
06-10 10:52:52.129 23947 24146 I Icing   : Indexing B96E309EB2416B4DBFAE0D6623436A2C7956B584 from com.google.android.gms
06-10 10:52:52.222  4996  6509 I OpenGLRenderer: Initialized EGL, version 1.4
06-10 10:52:52.231 23947 24146 I Icing   : Indexing done B96E309EB2416B4DBFAE0D6623436A2C7956B584
06-10 10:52:52.236 23947 24146 I Icing   : Indexing 209BD54564CA1E38C7343A8DD5819E6471F3968C from com.google.android.googlequicksearchbox
06-10 10:52:52.269  4996  5005 I art     : Background partial concurrent mark sweep GC freed 22954(1750KB) AllocSpace objects, 0(0B) LOS objects, 26% free, 43MB/59MB, paused 1.180ms total 114.805ms
06-10 10:52:52.321 23947 24058 I Icing   : Indexing done 209BD54564CA1E38C7343A8DD5819E6471F3968C
06-10 10:52:52.661  4996  5039 W ActivityManager: Activity pause timeout for ActivityRecord{16012ae u0 org.jboss.aerogear.unifiedpush.HelloWorld/.MainActivity t1391 f}

On Fri, Jun 10, 2016 at 12:02 AM, Julio Cesar Sanchez Hernandez <[hidden email]> wrote:
My fork is here

I didn't add the .json and I'm receiving push notifications

Last time I read the GCM docs they were already talking about that .json (I think it was on February or March), it's not a new thing on FCM.

On Thu, Jun 9, 2016 at 6:38 PM, Summers Pittman <[hidden email]> wrote:


On Thu, Jun 9, 2016 at 11:00 AM, Julio Cesar Sanchez Hernandez <[hidden email]> wrote:
I don't think that file is really needed, the phonegap-plugin-push (https://github.com/phonegap/phonegap-plugin-push) doesn't use it and push notifications work without it. The Sender ID is set on plugin install passing it as a variable. Not sure what other values are included on the google-services.json

This plugin isn't using Firebase.  We didn't need google-services.json for GCM3.
 

I forked the phonegap plugin to add FCM support and it works too without the google-services.json file too.


Sauce?

Firebase requires two variables, the application id and the sender id.  Fortunately the senderId is embedded in the applicationId.

 

As you can see I've just overloaded the SenderId.



On Thu, Jun 9, 2016 at 2:04 PM, Summers Pittman <[hidden email]> wrote:


On Thu, Jun 9, 2016 at 2:19 AM, Erik Jan de Wit <[hidden email]> wrote:

I am now actually wondering, where to put the google-service.json file on Cordova (no I am not updating our plugin), but I have no clue what is matching the native 'app' folder in Crodova land, is it WWW foldeR? 


hrm...
 

There is no native folder on a cordova project, but we can put something in the plugin.xml that will install / copy it into the native project:

<resource-file src="src/android/google-services.json" target="google-services.json" />

Don't know what the content is of this file seems the https://github.com/jboss-mobile/unified-push-helloworld/pull/31 demo doesn't have this google-services.json

Correct.  The documentation is being updated to cover the fact the developer needs to add the file.  If the file is not present the developer gets a useful error message in his/her log when registration fails.  If the file is present but incorrect (as say a stubbed file) then then developer gets a less useful message.  We chose to leave it out because it is more clear what the problem is, and a quick google search for "google-services.json" takes the user exactly where they need to go.
 


--
Cheers,
       Erik Jan

_______________________________________________
aerogear-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-dev


_______________________________________________
aerogear-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-dev


_______________________________________________
aerogear-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-dev


_______________________________________________
aerogear-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-dev


_______________________________________________
aerogear-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-dev



--

_______________________________________________
aerogear-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-dev



--

_______________________________________________
aerogear-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-dev
Reply | Threaded
Open this post in threaded view
|

Re: [aerogear-dev] Gradle help for Cordova (was: Re: Cordova-FCM issue (was: Re: Android Push: Firebase Cloud Messaging))

Matthias Wessendorf
So, we could add it to this branch:

no?

On Mon, Jun 13, 2016 at 3:46 PM, Matthias Wessendorf <[hidden email]> wrote:
hello,

trying the fcm branch, I get this Gralde error. Should we add (dynamic) applicationId in our file?

like done here?

Does that work ? Or are there some concerns ? 


It looks like Firebase now does require this:


06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: java.lang.RuntimeException: Unable to get provider com.google.firebase.provider.FirebaseInitProvider: java.lang.IllegalStateException: Incorrect provider authority in manifest. Most likely due to a missing applicationId variable in application's build.gradle.
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at android.app.ActivityThread.installProvider(ActivityThread.java:5156)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at android.app.ActivityThread.installContentProviders(ActivityThread.java:4748)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4688)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at android.app.ActivityThread.-wrap1(ActivityThread.java)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1405)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:102)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at android.os.Looper.loop(Looper.java:148)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:5417)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: Caused by: java.lang.IllegalStateException: Incorrect provider authority in manifest. Most likely due to a missing applicationId variable in application's build.gradle.
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at com.google.firebase.provider.FirebaseInitProvider.zza(Unknown Source)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at android.app.ActivityThread.installProvider(ActivityThread.java:5153)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: ... 10 more
06-10 10:52:52.<a href="tel:040%20%C2%A04996%20%C2%A02592" value="+494049962592" target="_blank">040  4996  2592 W ActivityManager:   Force finishing activity org.jboss.aerogear.unifiedpush.HelloWorld/.MainActivity


On Fri, Jun 10, 2016 at 10:58 AM, Matthias Wessendorf <[hidden email]> wrote:
Hi,

I think I am running into the issue, that I am not having the google-service.json file present, in my app.


My try to update our plugin is here:


And I am using this app:

My "www/push-config.json" file content is here:

After updating that, I did follow the instructions, on the readme, in the "cordova" folder of the helloworld:

1) cordova platform add android
3) cordova run android


But, when the app launches, it crashes



06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: java.lang.RuntimeException: Unable to get provider com.google.firebase.provider.FirebaseInitProvider: java.lang.IllegalStateException: Incorrect provider authority in manifest. Most likely due to a missing applicationId variable in application's build.gradle.
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at android.app.ActivityThread.installProvider(ActivityThread.java:5156)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at android.app.ActivityThread.installContentProviders(ActivityThread.java:4748)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4688)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at android.app.ActivityThread.-wrap1(ActivityThread.java)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1405)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:102)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at android.os.Looper.loop(Looper.java:148)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:5417)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: Caused by: java.lang.IllegalStateException: Incorrect provider authority in manifest. Most likely due to a missing applicationId variable in application's build.gradle.
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at com.google.firebase.provider.FirebaseInitProvider.zza(Unknown Source)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at android.app.ActivityThread.installProvider(ActivityThread.java:5153)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: ... 10 more
06-10 10:52:52.<a href="tel:040%20%C2%A04996%20%C2%A02592" value="+494049962592" target="_blank">040  4996  2592 W ActivityManager:   Force finishing activity org.jboss.aerogear.unifiedpush.HelloWorld/.MainActivity
06-10 10:52:52.129 23947 24146 I Icing   : Indexing B96E309EB2416B4DBFAE0D6623436A2C7956B584 from com.google.android.gms
06-10 10:52:52.222  4996  6509 I OpenGLRenderer: Initialized EGL, version 1.4
06-10 10:52:52.231 23947 24146 I Icing   : Indexing done B96E309EB2416B4DBFAE0D6623436A2C7956B584
06-10 10:52:52.236 23947 24146 I Icing   : Indexing 209BD54564CA1E38C7343A8DD5819E6471F3968C from com.google.android.googlequicksearchbox
06-10 10:52:52.269  4996  5005 I art     : Background partial concurrent mark sweep GC freed 22954(1750KB) AllocSpace objects, 0(0B) LOS objects, 26% free, 43MB/59MB, paused 1.180ms total 114.805ms
06-10 10:52:52.321 23947 24058 I Icing   : Indexing done 209BD54564CA1E38C7343A8DD5819E6471F3968C
06-10 10:52:52.661  4996  5039 W ActivityManager: Activity pause timeout for ActivityRecord{16012ae u0 org.jboss.aerogear.unifiedpush.HelloWorld/.MainActivity t1391 f}

On Fri, Jun 10, 2016 at 12:02 AM, Julio Cesar Sanchez Hernandez <[hidden email]> wrote:
My fork is here

I didn't add the .json and I'm receiving push notifications

Last time I read the GCM docs they were already talking about that .json (I think it was on February or March), it's not a new thing on FCM.

On Thu, Jun 9, 2016 at 6:38 PM, Summers Pittman <[hidden email]> wrote:


On Thu, Jun 9, 2016 at 11:00 AM, Julio Cesar Sanchez Hernandez <[hidden email]> wrote:
I don't think that file is really needed, the phonegap-plugin-push (https://github.com/phonegap/phonegap-plugin-push) doesn't use it and push notifications work without it. The Sender ID is set on plugin install passing it as a variable. Not sure what other values are included on the google-services.json

This plugin isn't using Firebase.  We didn't need google-services.json for GCM3.
 

I forked the phonegap plugin to add FCM support and it works too without the google-services.json file too.


Sauce?

Firebase requires two variables, the application id and the sender id.  Fortunately the senderId is embedded in the applicationId.

 

As you can see I've just overloaded the SenderId.



On Thu, Jun 9, 2016 at 2:04 PM, Summers Pittman <[hidden email]> wrote:


On Thu, Jun 9, 2016 at 2:19 AM, Erik Jan de Wit <[hidden email]> wrote:

I am now actually wondering, where to put the google-service.json file on Cordova (no I am not updating our plugin), but I have no clue what is matching the native 'app' folder in Crodova land, is it WWW foldeR? 


hrm...
 

There is no native folder on a cordova project, but we can put something in the plugin.xml that will install / copy it into the native project:

<resource-file src="src/android/google-services.json" target="google-services.json" />

Don't know what the content is of this file seems the https://github.com/jboss-mobile/unified-push-helloworld/pull/31 demo doesn't have this google-services.json

Correct.  The documentation is being updated to cover the fact the developer needs to add the file.  If the file is not present the developer gets a useful error message in his/her log when registration fails.  If the file is present but incorrect (as say a stubbed file) then then developer gets a less useful message.  We chose to leave it out because it is more clear what the problem is, and a quick google search for "google-services.json" takes the user exactly where they need to go.
 


--
Cheers,
       Erik Jan

_______________________________________________
aerogear-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-dev


_______________________________________________
aerogear-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-dev


_______________________________________________
aerogear-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-dev


_______________________________________________
aerogear-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-dev


_______________________________________________
aerogear-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-dev



--

_______________________________________________
aerogear-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-dev



--



--

_______________________________________________
aerogear-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-dev
Reply | Threaded
Open this post in threaded view
|

Re: [aerogear-dev] Gradle help for Cordova (was: Re: Cordova-FCM issue (was: Re: Android Push: Firebase Cloud Messaging))

Erik Jan de Wit
just tried your branch and it builds without problems, maybe I'm doing something wrong:

> cordova create push-test
> cd push-test
> cordova plugin add <a href="https://github.com/matzew/aerogear-pushplugin-cordova.git\#fcm">https://github.com/matzew/aerogear-pushplugin-cordova.git\#fcm
> cordova platform add android
> cordova build



On Mon, Jun 13, 2016 at 3:47 PM, Matthias Wessendorf <[hidden email]> wrote:
So, we could add it to this branch:

no?


On Mon, Jun 13, 2016 at 3:46 PM, Matthias Wessendorf <[hidden email]> wrote:
hello,

trying the fcm branch, I get this Gralde error. Should we add (dynamic) applicationId in our file?

like done here?

Does that work ? Or are there some concerns ? 


It looks like Firebase now does require this:


06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: java.lang.RuntimeException: Unable to get provider com.google.firebase.provider.FirebaseInitProvider: java.lang.IllegalStateException: Incorrect provider authority in manifest. Most likely due to a missing applicationId variable in application's build.gradle.
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at android.app.ActivityThread.installProvider(ActivityThread.java:5156)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at android.app.ActivityThread.installContentProviders(ActivityThread.java:4748)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4688)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at android.app.ActivityThread.-wrap1(ActivityThread.java)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1405)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:102)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at android.os.Looper.loop(Looper.java:148)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:5417)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: Caused by: java.lang.IllegalStateException: Incorrect provider authority in manifest. Most likely due to a missing applicationId variable in application's build.gradle.
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at com.google.firebase.provider.FirebaseInitProvider.zza(Unknown Source)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at android.app.ActivityThread.installProvider(ActivityThread.java:5153)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: ... 10 more
06-10 10:52:52.<a href="tel:040%20%C2%A04996%20%C2%A02592" value="+494049962592" target="_blank">040  4996  2592 W ActivityManager:   Force finishing activity org.jboss.aerogear.unifiedpush.HelloWorld/.MainActivity


On Fri, Jun 10, 2016 at 10:58 AM, Matthias Wessendorf <[hidden email]> wrote:
Hi,

I think I am running into the issue, that I am not having the google-service.json file present, in my app.


My try to update our plugin is here:


And I am using this app:

My "www/push-config.json" file content is here:

After updating that, I did follow the instructions, on the readme, in the "cordova" folder of the helloworld:

1) cordova platform add android
3) cordova run android


But, when the app launches, it crashes



06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: java.lang.RuntimeException: Unable to get provider com.google.firebase.provider.FirebaseInitProvider: java.lang.IllegalStateException: Incorrect provider authority in manifest. Most likely due to a missing applicationId variable in application's build.gradle.
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at android.app.ActivityThread.installProvider(ActivityThread.java:5156)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at android.app.ActivityThread.installContentProviders(ActivityThread.java:4748)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4688)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at android.app.ActivityThread.-wrap1(ActivityThread.java)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1405)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:102)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at android.os.Looper.loop(Looper.java:148)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:5417)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: Caused by: java.lang.IllegalStateException: Incorrect provider authority in manifest. Most likely due to a missing applicationId variable in application's build.gradle.
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at com.google.firebase.provider.FirebaseInitProvider.zza(Unknown Source)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at android.app.ActivityThread.installProvider(ActivityThread.java:5153)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: ... 10 more
06-10 10:52:52.<a href="tel:040%20%C2%A04996%20%C2%A02592" value="+494049962592" target="_blank">040  4996  2592 W ActivityManager:   Force finishing activity org.jboss.aerogear.unifiedpush.HelloWorld/.MainActivity
06-10 10:52:52.129 23947 24146 I Icing   : Indexing B96E309EB2416B4DBFAE0D6623436A2C7956B584 from com.google.android.gms
06-10 10:52:52.222  4996  6509 I OpenGLRenderer: Initialized EGL, version 1.4
06-10 10:52:52.231 23947 24146 I Icing   : Indexing done B96E309EB2416B4DBFAE0D6623436A2C7956B584
06-10 10:52:52.236 23947 24146 I Icing   : Indexing 209BD54564CA1E38C7343A8DD5819E6471F3968C from com.google.android.googlequicksearchbox
06-10 10:52:52.269  4996  5005 I art     : Background partial concurrent mark sweep GC freed 22954(1750KB) AllocSpace objects, 0(0B) LOS objects, 26% free, 43MB/59MB, paused 1.180ms total 114.805ms
06-10 10:52:52.321 23947 24058 I Icing   : Indexing done 209BD54564CA1E38C7343A8DD5819E6471F3968C
06-10 10:52:52.661  4996  5039 W ActivityManager: Activity pause timeout for ActivityRecord{16012ae u0 org.jboss.aerogear.unifiedpush.HelloWorld/.MainActivity t1391 f}

On Fri, Jun 10, 2016 at 12:02 AM, Julio Cesar Sanchez Hernandez <[hidden email]> wrote:
My fork is here

I didn't add the .json and I'm receiving push notifications

Last time I read the GCM docs they were already talking about that .json (I think it was on February or March), it's not a new thing on FCM.

On Thu, Jun 9, 2016 at 6:38 PM, Summers Pittman <[hidden email]> wrote:


On Thu, Jun 9, 2016 at 11:00 AM, Julio Cesar Sanchez Hernandez <[hidden email]> wrote:
I don't think that file is really needed, the phonegap-plugin-push (https://github.com/phonegap/phonegap-plugin-push) doesn't use it and push notifications work without it. The Sender ID is set on plugin install passing it as a variable. Not sure what other values are included on the google-services.json

This plugin isn't using Firebase.  We didn't need google-services.json for GCM3.
 

I forked the phonegap plugin to add FCM support and it works too without the google-services.json file too.


Sauce?

Firebase requires two variables, the application id and the sender id.  Fortunately the senderId is embedded in the applicationId.

 

As you can see I've just overloaded the SenderId.



On Thu, Jun 9, 2016 at 2:04 PM, Summers Pittman <[hidden email]> wrote:


On Thu, Jun 9, 2016 at 2:19 AM, Erik Jan de Wit <[hidden email]> wrote:

I am now actually wondering, where to put the google-service.json file on Cordova (no I am not updating our plugin), but I have no clue what is matching the native 'app' folder in Crodova land, is it WWW foldeR? 


hrm...
 

There is no native folder on a cordova project, but we can put something in the plugin.xml that will install / copy it into the native project:

<resource-file src="src/android/google-services.json" target="google-services.json" />

Don't know what the content is of this file seems the https://github.com/jboss-mobile/unified-push-helloworld/pull/31 demo doesn't have this google-services.json

Correct.  The documentation is being updated to cover the fact the developer needs to add the file.  If the file is not present the developer gets a useful error message in his/her log when registration fails.  If the file is present but incorrect (as say a stubbed file) then then developer gets a less useful message.  We chose to leave it out because it is more clear what the problem is, and a quick google search for "google-services.json" takes the user exactly where they need to go.
 


--
Cheers,
       Erik Jan

_______________________________________________
aerogear-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-dev


_______________________________________________
aerogear-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-dev


_______________________________________________
aerogear-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-dev


_______________________________________________
aerogear-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-dev


_______________________________________________
aerogear-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-dev



--

_______________________________________________
aerogear-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-dev



--



--

_______________________________________________
aerogear-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-dev



--
Cheers,
       Erik Jan

_______________________________________________
aerogear-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-dev
Reply | Threaded
Open this post in threaded view
|

Re: [aerogear-dev] Gradle help for Cordova (was: Re: Cordova-FCM issue (was: Re: Android Push: Firebase Cloud Messaging))

Erik Jan de Wit
forgot to add my version numbers:

/t/push-test cordova -v

6.2.0

/t/push-test cordova platform ls

Installed platforms:

  android 5.1.1


On Mon, Jun 13, 2016 at 4:57 PM, Erik Jan de Wit <[hidden email]> wrote:
just tried your branch and it builds without problems, maybe I'm doing something wrong:

> cordova create push-test
> cd push-test
> cordova platform add android
> cordova build



On Mon, Jun 13, 2016 at 3:47 PM, Matthias Wessendorf <[hidden email]> wrote:
So, we could add it to this branch:

no?


On Mon, Jun 13, 2016 at 3:46 PM, Matthias Wessendorf <[hidden email]> wrote:
hello,

trying the fcm branch, I get this Gralde error. Should we add (dynamic) applicationId in our file?

like done here?

Does that work ? Or are there some concerns ? 


It looks like Firebase now does require this:


06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: java.lang.RuntimeException: Unable to get provider com.google.firebase.provider.FirebaseInitProvider: java.lang.IllegalStateException: Incorrect provider authority in manifest. Most likely due to a missing applicationId variable in application's build.gradle.
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at android.app.ActivityThread.installProvider(ActivityThread.java:5156)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at android.app.ActivityThread.installContentProviders(ActivityThread.java:4748)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4688)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at android.app.ActivityThread.-wrap1(ActivityThread.java)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1405)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:102)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at android.os.Looper.loop(Looper.java:148)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:5417)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: Caused by: java.lang.IllegalStateException: Incorrect provider authority in manifest. Most likely due to a missing applicationId variable in application's build.gradle.
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at com.google.firebase.provider.FirebaseInitProvider.zza(Unknown Source)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at android.app.ActivityThread.installProvider(ActivityThread.java:5153)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: ... 10 more
06-10 10:52:52.<a href="tel:040%20%C2%A04996%20%C2%A02592" value="+494049962592" target="_blank">040  4996  2592 W ActivityManager:   Force finishing activity org.jboss.aerogear.unifiedpush.HelloWorld/.MainActivity


On Fri, Jun 10, 2016 at 10:58 AM, Matthias Wessendorf <[hidden email]> wrote:
Hi,

I think I am running into the issue, that I am not having the google-service.json file present, in my app.


My try to update our plugin is here:


And I am using this app:

My "www/push-config.json" file content is here:

After updating that, I did follow the instructions, on the readme, in the "cordova" folder of the helloworld:

1) cordova platform add android
3) cordova run android


But, when the app launches, it crashes



06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: java.lang.RuntimeException: Unable to get provider com.google.firebase.provider.FirebaseInitProvider: java.lang.IllegalStateException: Incorrect provider authority in manifest. Most likely due to a missing applicationId variable in application's build.gradle.
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at android.app.ActivityThread.installProvider(ActivityThread.java:5156)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at android.app.ActivityThread.installContentProviders(ActivityThread.java:4748)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4688)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at android.app.ActivityThread.-wrap1(ActivityThread.java)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1405)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:102)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at android.os.Looper.loop(Looper.java:148)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:5417)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: Caused by: java.lang.IllegalStateException: Incorrect provider authority in manifest. Most likely due to a missing applicationId variable in application's build.gradle.
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at com.google.firebase.provider.FirebaseInitProvider.zza(Unknown Source)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at android.app.ActivityThread.installProvider(ActivityThread.java:5153)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: ... 10 more
06-10 10:52:52.<a href="tel:040%20%C2%A04996%20%C2%A02592" value="+494049962592" target="_blank">040  4996  2592 W ActivityManager:   Force finishing activity org.jboss.aerogear.unifiedpush.HelloWorld/.MainActivity
06-10 10:52:52.129 23947 24146 I Icing   : Indexing B96E309EB2416B4DBFAE0D6623436A2C7956B584 from com.google.android.gms
06-10 10:52:52.222  4996  6509 I OpenGLRenderer: Initialized EGL, version 1.4
06-10 10:52:52.231 23947 24146 I Icing   : Indexing done B96E309EB2416B4DBFAE0D6623436A2C7956B584
06-10 10:52:52.236 23947 24146 I Icing   : Indexing 209BD54564CA1E38C7343A8DD5819E6471F3968C from com.google.android.googlequicksearchbox
06-10 10:52:52.269  4996  5005 I art     : Background partial concurrent mark sweep GC freed 22954(1750KB) AllocSpace objects, 0(0B) LOS objects, 26% free, 43MB/59MB, paused 1.180ms total 114.805ms
06-10 10:52:52.321 23947 24058 I Icing   : Indexing done 209BD54564CA1E38C7343A8DD5819E6471F3968C
06-10 10:52:52.661  4996  5039 W ActivityManager: Activity pause timeout for ActivityRecord{16012ae u0 org.jboss.aerogear.unifiedpush.HelloWorld/.MainActivity t1391 f}

On Fri, Jun 10, 2016 at 12:02 AM, Julio Cesar Sanchez Hernandez <[hidden email]> wrote:
My fork is here

I didn't add the .json and I'm receiving push notifications

Last time I read the GCM docs they were already talking about that .json (I think it was on February or March), it's not a new thing on FCM.

On Thu, Jun 9, 2016 at 6:38 PM, Summers Pittman <[hidden email]> wrote:


On Thu, Jun 9, 2016 at 11:00 AM, Julio Cesar Sanchez Hernandez <[hidden email]> wrote:
I don't think that file is really needed, the phonegap-plugin-push (https://github.com/phonegap/phonegap-plugin-push) doesn't use it and push notifications work without it. The Sender ID is set on plugin install passing it as a variable. Not sure what other values are included on the google-services.json

This plugin isn't using Firebase.  We didn't need google-services.json for GCM3.
 

I forked the phonegap plugin to add FCM support and it works too without the google-services.json file too.


Sauce?

Firebase requires two variables, the application id and the sender id.  Fortunately the senderId is embedded in the applicationId.

 

As you can see I've just overloaded the SenderId.



On Thu, Jun 9, 2016 at 2:04 PM, Summers Pittman <[hidden email]> wrote:


On Thu, Jun 9, 2016 at 2:19 AM, Erik Jan de Wit <[hidden email]> wrote:

I am now actually wondering, where to put the google-service.json file on Cordova (no I am not updating our plugin), but I have no clue what is matching the native 'app' folder in Crodova land, is it WWW foldeR? 


hrm...
 

There is no native folder on a cordova project, but we can put something in the plugin.xml that will install / copy it into the native project:

<resource-file src="src/android/google-services.json" target="google-services.json" />

Don't know what the content is of this file seems the https://github.com/jboss-mobile/unified-push-helloworld/pull/31 demo doesn't have this google-services.json

Correct.  The documentation is being updated to cover the fact the developer needs to add the file.  If the file is not present the developer gets a useful error message in his/her log when registration fails.  If the file is present but incorrect (as say a stubbed file) then then developer gets a less useful message.  We chose to leave it out because it is more clear what the problem is, and a quick google search for "google-services.json" takes the user exactly where they need to go.
 


--
Cheers,
       Erik Jan

_______________________________________________
aerogear-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-dev


_______________________________________________
aerogear-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-dev


_______________________________________________
aerogear-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-dev


_______________________________________________
aerogear-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-dev


_______________________________________________
aerogear-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-dev



--

_______________________________________________
aerogear-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-dev



--



--

_______________________________________________
aerogear-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-dev



--
Cheers,
       Erik Jan



--
Cheers,
       Erik Jan

_______________________________________________
aerogear-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-dev
Reply | Threaded
Open this post in threaded view
|

Re: [aerogear-dev] Gradle help for Cordova (was: Re: Cordova-FCM issue (was: Re: Android Push: Firebase Cloud Messaging))

Matthias Wessendorf
cordova --version
5.2.0

cordova platform ls
Installed platforms: android 4.1.1
Available platforms: amazon-fireos, blackberry10, browser, firefoxos, ios, webos






On Mon, Jun 13, 2016 at 4:58 PM, Erik Jan de Wit <[hidden email]> wrote:
forgot to add my version numbers:

/t/push-test cordova -v

6.2.0

/t/push-test cordova platform ls

Installed platforms:

  android 5.1.1


On Mon, Jun 13, 2016 at 4:57 PM, Erik Jan de Wit <[hidden email]> wrote:
just tried your branch and it builds without problems, maybe I'm doing something wrong:

> cordova create push-test
> cd push-test
> cordova platform add android
> cordova build



On Mon, Jun 13, 2016 at 3:47 PM, Matthias Wessendorf <[hidden email]> wrote:
So, we could add it to this branch:

no?


On Mon, Jun 13, 2016 at 3:46 PM, Matthias Wessendorf <[hidden email]> wrote:
hello,

trying the fcm branch, I get this Gralde error. Should we add (dynamic) applicationId in our file?

like done here?

Does that work ? Or are there some concerns ? 


It looks like Firebase now does require this:


06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: java.lang.RuntimeException: Unable to get provider com.google.firebase.provider.FirebaseInitProvider: java.lang.IllegalStateException: Incorrect provider authority in manifest. Most likely due to a missing applicationId variable in application's build.gradle.
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at android.app.ActivityThread.installProvider(ActivityThread.java:5156)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at android.app.ActivityThread.installContentProviders(ActivityThread.java:4748)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4688)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at android.app.ActivityThread.-wrap1(ActivityThread.java)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1405)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:102)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at android.os.Looper.loop(Looper.java:148)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:5417)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: Caused by: java.lang.IllegalStateException: Incorrect provider authority in manifest. Most likely due to a missing applicationId variable in application's build.gradle.
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at com.google.firebase.provider.FirebaseInitProvider.zza(Unknown Source)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at android.app.ActivityThread.installProvider(ActivityThread.java:5153)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: ... 10 more
06-10 10:52:52.<a href="tel:040%20%C2%A04996%20%C2%A02592" value="+494049962592" target="_blank">040  4996  2592 W ActivityManager:   Force finishing activity org.jboss.aerogear.unifiedpush.HelloWorld/.MainActivity


On Fri, Jun 10, 2016 at 10:58 AM, Matthias Wessendorf <[hidden email]> wrote:
Hi,

I think I am running into the issue, that I am not having the google-service.json file present, in my app.


My try to update our plugin is here:


And I am using this app:

My "www/push-config.json" file content is here:

After updating that, I did follow the instructions, on the readme, in the "cordova" folder of the helloworld:

1) cordova platform add android
3) cordova run android


But, when the app launches, it crashes



06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: java.lang.RuntimeException: Unable to get provider com.google.firebase.provider.FirebaseInitProvider: java.lang.IllegalStateException: Incorrect provider authority in manifest. Most likely due to a missing applicationId variable in application's build.gradle.
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at android.app.ActivityThread.installProvider(ActivityThread.java:5156)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at android.app.ActivityThread.installContentProviders(ActivityThread.java:4748)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4688)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at android.app.ActivityThread.-wrap1(ActivityThread.java)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1405)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:102)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at android.os.Looper.loop(Looper.java:148)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:5417)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: Caused by: java.lang.IllegalStateException: Incorrect provider authority in manifest. Most likely due to a missing applicationId variable in application's build.gradle.
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at com.google.firebase.provider.FirebaseInitProvider.zza(Unknown Source)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: at android.app.ActivityThread.installProvider(ActivityThread.java:5153)
06-10 10:52:52.<a href="tel:039%20%C2%A04894%20%C2%A04894" value="+493948944894" target="_blank">039  4894  4894 E AndroidRuntime: ... 10 more
06-10 10:52:52.<a href="tel:040%20%C2%A04996%20%C2%A02592" value="+494049962592" target="_blank">040  4996  2592 W ActivityManager:   Force finishing activity org.jboss.aerogear.unifiedpush.HelloWorld/.MainActivity
06-10 10:52:52.129 23947 24146 I Icing   : Indexing B96E309EB2416B4DBFAE0D6623436A2C7956B584 from com.google.android.gms
06-10 10:52:52.222  4996  6509 I OpenGLRenderer: Initialized EGL, version 1.4
06-10 10:52:52.231 23947 24146 I Icing   : Indexing done B96E309EB2416B4DBFAE0D6623436A2C7956B584
06-10 10:52:52.236 23947 24146 I Icing   : Indexing 209BD54564CA1E38C7343A8DD5819E6471F3968C from com.google.android.googlequicksearchbox
06-10 10:52:52.269  4996  5005 I art     : Background partial concurrent mark sweep GC freed 22954(1750KB) AllocSpace objects, 0(0B) LOS objects, 26% free, 43MB/59MB, paused 1.180ms total 114.805ms
06-10 10:52:52.321 23947 24058 I Icing   : Indexing done 209BD54564CA1E38C7343A8DD5819E6471F3968C
06-10 10:52:52.661  4996  5039 W ActivityManager: Activity pause timeout for ActivityRecord{16012ae u0 org.jboss.aerogear.unifiedpush.HelloWorld/.MainActivity t1391 f}

On Fri, Jun 10, 2016 at 12:02 AM, Julio Cesar Sanchez Hernandez <[hidden email]> wrote:
My fork is here

I didn't add the .json and I'm receiving push notifications

Last time I read the GCM docs they were already talking about that .json (I think it was on February or March), it's not a new thing on FCM.

On Thu, Jun 9, 2016 at 6:38 PM, Summers Pittman <[hidden email]> wrote:


On Thu, Jun 9, 2016 at 11:00 AM, Julio Cesar Sanchez Hernandez <[hidden email]> wrote:
I don't think that file is really needed, the phonegap-plugin-push (https://github.com/phonegap/phonegap-plugin-push) doesn't use it and push notifications work without it. The Sender ID is set on plugin install passing it as a variable. Not sure what other values are included on the google-services.json

This plugin isn't using Firebase.  We didn't need google-services.json for GCM3.
 

I forked the phonegap plugin to add FCM support and it works too without the google-services.json file too.


Sauce?

Firebase requires two variables, the application id and the sender id.  Fortunately the senderId is embedded in the applicationId.

 

As you can see I've just overloaded the SenderId.



On Thu, Jun 9, 2016 at 2:04 PM, Summers Pittman <[hidden email]> wrote:


On Thu, Jun 9, 2016 at 2:19 AM, Erik Jan de Wit <[hidden email]> wrote:

I am now actually wondering, where to put the google-service.json file on Cordova (no I am not updating our plugin), but I have no clue what is matching the native 'app' folder in Crodova land, is it WWW foldeR? 


hrm...
 

There is no native folder on a cordova project, but we can put something in the plugin.xml that will install / copy it into the native project:

<resource-file src="src/android/google-services.json" target="google-services.json" />

Don't know what the content is of this file seems the https://github.com/jboss-mobile/unified-push-helloworld/pull/31 demo doesn't have this google-services.json

Correct.  The documentation is being updated to cover the fact the developer needs to add the file.  If the file is not present the developer gets a useful error message in his/her log when registration fails.  If the file is present but incorrect (as say a stubbed file) then then developer gets a less useful message.  We chose to leave it out because it is more clear what the problem is, and a quick google search for "google-services.json" takes the user exactly where they need to go.
 


--
Cheers,
       Erik Jan

_______________________________________________
aerogear-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-dev


_______________________________________________
aerogear-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-dev


_______________________________________________
aerogear-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-dev


_______________________________________________
aerogear-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-dev


_______________________________________________
aerogear-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-dev



--

_______________________________________________
aerogear-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-dev



--



--

_______________________________________________
aerogear-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-dev



--
Cheers,
       Erik Jan



--
Cheers,
       Erik Jan

_______________________________________________
aerogear-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-dev



--

_______________________________________________
aerogear-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-dev