Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

App crashes on start after installing the plugin #106

Closed
sakozz opened this issue Jun 2, 2016 · 9 comments
Closed

App crashes on start after installing the plugin #106

sakozz opened this issue Jun 2, 2016 · 9 comments

Comments

@sakozz
Copy link

sakozz commented Jun 2, 2016

Hi, i tried to use this plugin with ionic framework and the app crashes every time i open. Here are few details on crash

 "ionic": "^1.3.1"

$ cordova --version
5.3.3

$ cordova platform
Installed platforms: android 5.1.1, ios 3.9.2
Available platforms: amazon-fireos, blackberry10, browser, firefoxos, osx, webos

$ cordova plugin
cordova-plugin-app-event 1.2.0 "Application Events"
cordova-plugin-console 1.0.3 "Console"
cordova-plugin-device 1.1.2 "Device"
cordova-plugin-dialogs 1.2.1 "Notification"
cordova-plugin-extension 1.5.1 "Cordova Plugin Extension"
cordova-plugin-globalization 1.0.3 "Globalization"
cordova-plugin-inappbrowser 1.4.0 "InAppBrowser"
cordova-plugin-splashscreen 2.1.0 "Splashscreen"
cordova-plugin-statusbar 2.1.3 "StatusBar"
cordova-plugin-whitelist 1.2.2 "Whitelist"
de.appplant.cordova.plugin.local-notification 0.8.4 "LocalNotification"
ionic-plugin-keyboard 2.2.0 "Keyboard"
urbanairship-cordova 5.1.4 "Urban Airship"

Every time it crashes, it gives the following error messages

Error 1

06-02 14:16:26.131  5038  5038 E GMPM    : GoogleService failed to initialize, status: 10, Missing an expected resource: 'R.string.google_app_id' for initializing Google services.  Possible causes are missing google-services.json or com.google.gms.google-services gradle plugin.
06-02 14:16:26.131  5038  5038 E GMPM    : Scheduler not set. Not logging error/warn.
06-02 14:16:26.144  5038  5055 E GMPM    : Uploading is not possible. App measurement disabled
06-02 14:16:26.156  5038  5057 I My App - UALib: Airship taking off!
06-02 14:16:26.156  5038  5057 I My App  - UALib: Airship log level: 3
06-02 14:16:26.159  5038  5057 I My App - UALib: UA Version: 7.1.3 / App key = Knzge_v8Q4maWhIg5gOt8Q Production = false
06-02 14:16:26.170  5038  5038 I WebViewFactory: Loading com.google.android.webview version 50.0.2661.86 (code 266108600)
06-02 14:16:26.210  5038  5038 I cr_LibraryLoader: Time to load native libraries: 2 ms (timestamps 2470-2472)

Error 2

06-02 14:16:26.711  5038  5087 E AndroidRuntime: java.lang.IncompatibleClassChangeError: The method 'java.io.File android.support.v4.content.ContextCompat.getNoBackupFilesDir(android.content.Context)' was expected to be of type virtual but instead was found to be of type direct (declaration of 'com.google.android.gms.iid.zzd' appears in /data/app/com.myapp.expert-2/base.apk)
06-02 14:16:26.711  5038  5087 E AndroidRuntime:    at com.google.android.gms.iid.zzd.zzeb(Unknown Source)
06-02 14:16:26.711  5038  5087 E AndroidRuntime:    at com.google.android.gms.iid.zzd.<init>(Unknown Source)
06-02 14:16:26.711  5038  5087 E AndroidRuntime:    at com.google.android.gms.iid.zzd.<init>(Unknown Source)
06-02 14:16:26.711  5038  5087 E AndroidRuntime:    at com.google.android.gms.iid.InstanceID.zza(Unknown Source)
06-02 14:16:26.711  5038  5087 E AndroidRuntime:    at com.google.android.gms.iid.InstanceID.getInstance(Unknown Source)
06-02 14:16:26.711  5038  5087 E AndroidRuntime:    at com.urbanairship.push.GcmRegistrar.register(GcmRegistrar.java:62)
06-02 14:16:26.711  5038  5087 E AndroidRuntime:    at com.urbanairship.push.ChannelServiceDelegate.onUpdatePushRegistration(ChannelServiceDelegate.java:174)
06-02 14:16:26.711  5038  5087 E AndroidRuntime:    at com.urbanairship.push.ChannelServiceDelegate.onHandleIntent(ChannelServiceDelegate.java:110)
06-02 14:16:26.711  5038  5087 E AndroidRuntime:    at com.urbanairship.BaseIntentService.onHandleIntent(BaseIntentService.java:103)
06-02 14:16:26.711  5038  5087 E AndroidRuntime:    at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:66)
06-02 14:16:26.711  5038  5087 E AndroidRuntime:    at android.os.Handler.dispatchMessage(Handler.java:102)
06-02 14:16:26.711  5038  5087 E AndroidRuntime:    at android.os.Looper.loop(Looper.java:148)
06-02 14:16:26.711  5038  5087 E AndroidRuntime:    at android.os.HandlerThread.run(HandlerThread.java:61)
06-02 14:16:26.713   862  4017 W ActivityManager:   Force finishing activity com.myapp.expert/.MainActivity
06-02 14:16:26.807  5038  5038 D My App - UALib: RichPushInbox - Starting update service.
@macdonst
Copy link
Contributor

macdonst commented Jun 2, 2016

@sunil-shrestha yeah, Google broke some stuff. The only way I figured out to fix this was to force the usage of Android Support Library v4 23.4.0. See this issue for more details.

phonegap/phonegap-plugin-push#909

@rlepinski
Copy link
Contributor

As @macdonst said, forcing a resolution seems to be the only solution. I am pretty sure the issue is with 24.0.0-beta version of the support library being available and one of the dependencies you are using the newest available support library by specify a + for the version. We might be able to narrow down what dependency is at fault if you run ./gradlew -q app:dependencies --configuration compile in the android project.

Error #1 can be ignored. Google Play Services logs an error if you config.json is unavailable that specifies the project id. Its unfortunate that they log an error for that. We will look into resolving that issue in the future but for now it should be harmless.

@sakozz
Copy link
Author

sakozz commented Jun 3, 2016

Thanks a lot for getting me to right direction, Updating android/project.properties as below fixed the problem

cordova.system.library.1=com.android.support:support-v4:23.1.1+

@rlepinski
Copy link
Contributor

Glad you fixed the issue. Thanks for posting the solution!

@kkirby
Copy link

kkirby commented Jun 7, 2016

I don't know if there was an update to fix this for this plugin, but the issue is still happening. I ended up downgrading my support libraries on my machine.

@rlepinski
Copy link
Contributor

We are unable to fix this through the plugin. Cordova needs to update to not specify + version when defining the support library. It just so happens our SDK hits the issue first because we run on start.

@ant0ha
Copy link

ant0ha commented Jun 22, 2016

Hello! I am not android developer and I use ionic. Can you pls explain what I have to do to fix it step by step? I've added

cordova.system.library.1=com.android.support:support-v4:23.1.1+

to my platforms/android/project.properties, but app still crashes on start

@rlepinski
Copy link
Contributor

@ant0ha It could also be another plugin that is pulling in the beta support library. We are hoping our update to 7.2.0 which uses google play services 9.0.2 will fix this issue today.

If you have access to the build.gradle file, you could try this - http://stackoverflow.com/a/37341386/1637562

@ant0ha
Copy link

ant0ha commented Jun 22, 2016

@rlepinski thank you for answer, I've fixed it by adding:

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

to my platforms/android/build-extras.gradle

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants