Skip to content
This repository has been archived by the owner on Sep 4, 2020. It is now read-only.

Plugin is causing app to crash #1624

Closed
mreis92 opened this issue Mar 2, 2017 · 3 comments
Closed

Plugin is causing app to crash #1624

mreis92 opened this issue Mar 2, 2017 · 3 comments

Comments

@mreis92
Copy link

mreis92 commented Mar 2, 2017

Expected Behaviour

App doesn't crash, device is registered for push notifications

Actual Behaviour

App crashes.

Reproduce Scenario (including but not limited to)

This started happening once I installed the latest version of Android Studio (clean install). I am running an Ionic application with this plugin installed. The app crashes when trying to register the device.

Steps to Reproduce

Installed Android Studio (latest version - February 2017)
Installed v25, 24 and 23 of the SDK
Build Ionic application, and run the code below

Platform and Version (eg. Android 5.0 or iOS 9.2.1)

Android 7.1.1

(Android) What device vendor (e.g. Samsung, HTC, Sony...)

Xiaomi Redmi 3 Pro (ido)

Cordova CLI version and cordova platform version

Cordova Version: 6.4.0
Installed platforms:
android 6.0.0

Plugin version

phonegap-plugin-push 1.8.4 "PushPlugin"

Sample Push Data Payload.

No payload required

Sample Code that illustrates the problem

import { Push } from '@ionic/cloud-angular';

@Injectable()
export class NotificationsService {

	constructor(private push: Push) {
                //App crashes here
		return this.push.register().then((token) => {
                   
                }
	}
}

Logs taken while reproducing problem

03-02 15:15:07.367 12885 16247 E AndroidRuntime: FATAL EXCEPTION: pool-1-thread-4
03-02 15:15:07.367 12885 16247 E AndroidRuntime: Process: com.myapp.myapp, PID: 12885
03-02 15:15:07.367 12885 16247 E AndroidRuntime: java.lang.NoSuchMethodError: No static method getNoBackupFilesDir(Landroid/content/Context;)Ljava/io/File; in class Lcom/google/android/gms/common/util/zzw; or its super classes (declaration of 'com.google.android.gms.common.util.zzw' appears in /data/app/com.myapp.myapp-1/base.apk)
03-02 15:15:07.367 12885 16247 E AndroidRuntime: 	at com.google.android.gms.iid.zzd.zzkq(Unknown Source)
03-02 15:15:07.367 12885 16247 E AndroidRuntime: 	at com.google.android.gms.iid.zzd.<init>(Unknown Source)
03-02 15:15:07.367 12885 16247 E AndroidRuntime: 	at com.google.android.gms.iid.zzd.<init>(Unknown Source)
03-02 15:15:07.367 12885 16247 E AndroidRuntime: 	at com.google.android.gms.iid.InstanceID.zza(Unknown Source)
03-02 15:15:07.367 12885 16247 E AndroidRuntime: 	at com.google.android.gms.iid.InstanceID.getInstance(Unknown Source)
03-02 15:15:07.367 12885 16247 E AndroidRuntime: 	at com.adobe.phonegap.push.PushPlugin$1.run(PushPlugin.java:74)
03-02 15:15:07.367 12885 16247 E AndroidRuntime: 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
03-02 15:15:07.367 12885 16247 E AndroidRuntime: 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
03-02 15:15:07.367 12885 16247 E AndroidRuntime: 	at java.lang.Thread.run(Thread.java:761)
03-02 15:15:07.372  1243  2984 W ActivityManager:   Force finishing activity com.brandbassadoras.brandbassador/.MainActivity
03-02 15:15:07.392 12885 12885 D CordovaActivity: Paused the activity.

I was able to reproduce this issue in other devices as well. Let me know if you need more information. Thanks!

@macdonst
Copy link
Member

macdonst commented Mar 2, 2017

@mreis92 this is a duplicate. Please see #1588 and #1591

@macdonst macdonst closed this as completed Mar 2, 2017
@mreis92
Copy link
Author

mreis92 commented Mar 2, 2017

My apologies, I only searched on the open issues. Thank you

@lock
Copy link

lock bot commented Jun 4, 2018

This thread has been automatically locked.

@lock lock bot locked as resolved and limited conversation to collaborators Jun 4, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

2 participants