I am modifying ChatSecure to have a push notifications feature and I am trying to do that using GCM OR FCM but once I add com.google.gms:google-services:3.0.0 to the project build.gradle file the App crashes.
I tried both of GCM and FCM but once I add this line the app always crashes :
06-08 03:05:37.414: E/AndroidRuntime(3157): FATAL EXCEPTION: main
06-08 03:05:37.414: E/AndroidRuntime(3157): Process: info.guardianproject.otr.app.im, PID: 3157
06-08 03:05:37.414: E/AndroidRuntime(3157): java.lang.RuntimeException: Unable to start activity ComponentInfo{info.guardianproject.otr.app.im/info.guardianproject.otr.app.im.app.NewChatActivity}: android.view.InflateException: Binary XML file line #50: Error inflating class fragment
06-08 03:05:37.414: E/AndroidRuntime(3157): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2195)
06-08 03:05:37.414: E/AndroidRuntime(3157): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
06-08 03:05:37.414: E/AndroidRuntime(3157): at android.app.ActivityThread.access$800(ActivityThread.java:135)
06-08 03:05:37.414: E/AndroidRuntime(3157): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
06-08 03:05:37.414: E/AndroidRuntime(3157): at android.os.Handler.dispatchMessage(Handler.java:102)
06-08 03:05:37.414: E/AndroidRuntime(3157): at android.os.Looper.loop(Looper.java:136)
06-08 03:05:37.414: E/AndroidRuntime(3157): at android.app.ActivityThread.main(ActivityThread.java:5017)
06-08 03:05:37.414: E/AndroidRuntime(3157): at java.lang.reflect.Method.invokeNative(Native Method)
06-08 03:05:37.414: E/AndroidRuntime(3157): at java.lang.reflect.Method.invoke(Method.java:515)
06-08 03:05:37.414: E/AndroidRuntime(3157): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
06-08 03:05:37.414: E/AndroidRuntime(3157): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
06-08 03:05:37.414: E/AndroidRuntime(3157): at dalvik.system.NativeStart.main(Native Method)
06-08 03:05:37.414: E/AndroidRuntime(3157): Caused by: android.view.InflateException: Binary XML file line #50: Error inflating class fragment
06-08 03:05:37.414: E/AndroidRuntime(3157): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:714)
06-08 03:05:37.414: E/AndroidRuntime(3157): at android.view.LayoutInflater.rInflate(LayoutInflater.java:756)
06-08 03:05:37.414: E/AndroidRuntime(3157): at android.view.LayoutInflater.rInflate(LayoutInflater.java:759)
06-08 03:05:37.414: E/AndroidRuntime(3157): at android.view.LayoutInflater.rInflate(LayoutInflater.java:759)
06-08 03:05:37.414: E/AndroidRuntime(3157): at android.view.LayoutInflater.rInflate(LayoutInflater.java:759)
06-08 03:05:37.414: E/AndroidRuntime(3157): at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
06-08 03:05:37.414: E/AndroidRuntime(3157): at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
06-08 03:05:37.414: E/AndroidRuntime(3157): at android.view.LayoutInflater.inflate(LayoutInflater.java:353)
06-08 03:05:37.414: E/AndroidRuntime(3157): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:290)
06-08 03:05:37.414: E/AndroidRuntime(3157): at android.app.Activity.setContentView(Activity.java:1929)
06-08 03:05:37.414: E/AndroidRuntime(3157): at info.guardianproject.otr.app.im.app.NewChatActivity.onCreate(NewChatActivity.java:195)
06-08 03:05:37.414: E/AndroidRuntime(3157): at android.app.Activity.performCreate(Activity.java:5231)
06-08 03:05:37.414: E/AndroidRuntime(3157): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
06-08 03:05:37.414: E/AndroidRuntime(3157): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2159)
06-08 03:05:37.414: E/AndroidRuntime(3157): ... 11 more
06-08 03:05:37.414: E/AndroidRuntime(3157): Caused by: java.lang.IllegalArgumentException: Binary XML file line #50: Must specify unique android:id, android:tag, or have a parent with an id for info.guardianproject.otr.app.im.app.AccountsFragment
06-08 03:05:37.414: E/AndroidRuntime(3157): at android.support.v4.app.FragmentManagerImpl.onCreateView(FragmentManager.java:2205)
06-08 03:05:37.414: E/AndroidRuntime(3157): at android.support.v4.app.FragmentController.onCreateView(FragmentController.java:111)
06-08 03:05:37.414: E/AndroidRuntime(3157): at android.support.v4.app.FragmentActivity.dispatchFragmentsOnCreateView(FragmentActivity.java:278)
06-08 03:05:37.414: E/AndroidRuntime(3157): at android.support.v4.app.BaseFragmentActivityHoneycomb.onCreateView(BaseFragmentActivityHoneycomb.java:31)
06-08 03:05:37.414: E/AndroidRuntime(3157): at android.support.v4.app.FragmentActivity.onCreateView(FragmentActivity.java:78)
06-08 03:05:37.414: E/AndroidRuntime(3157): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:690)
06-08 03:05:37.414: E/AndroidRuntime(3157): ... 24 more
My App Build.gradle file :
android {
compileSdkVersion 22
buildToolsVersion '23.0.2'
defaultConfig {
applicationId 'info.guardianproject.otr.app.im'
minSdkVersion 9
targetSdkVersion 21
.....
.....
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:22.0.0'
compile project(':AndroidEmojiInputLibrary')
compile project(':AndroidPinning')
compile project(':CacheWordLib')
compile project(':MemorizingActivity')
compile project(':SlidingMenuLibrary')
compile project(':TibetanTextLibrary')
compile project(':ViewPagerIndicatorLibrary')
compile 'com.google.firebase:firebase-messaging:9.0.0'
}
apply plugin: 'com.google.gms.google-services'
Once I remove the dependencies it works fine but I need to implement the notifications feature, what to do?
I fixed it by using an old version of com.google.gms:google-services.
Maybe it's not the best solution but it works :
classpath 'com.google.gms:google-services:1.5.0-beta2'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With