ZygoteInit Errors

I have an app in the play store that I keep seeing crash reports for ZygoteInit Errors.
I am at a loss with how to track down what is happening.
I have not been able to reproduce the errors and the stack traces offer little help.
Can anyone can point me in the right direction?
The only clue I have is that all of these errors seem to occur on Android 6.0 or 7.0.
I haven't seen a single report for anything less than 6.0

Here are a couple of the error reports from the play store

java.lang.RuntimeException:
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:620)
Caused by: java.lang.reflect.InvocationTargetException:
at java.lang.reflect.Method.invoke(Native Method:0)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:730)

java.lang.RuntimeException:
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:762)
Caused by: java.lang.reflect.InvocationTargetException:
at java.lang.reflect.Method.invoke(Native Method:0)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:872)

java.lang.RuntimeException:
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1410)
Caused by: java.lang.reflect.InvocationTargetException:
at java.lang.reflect.Method.invoke(Native Method:0)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520)

«1

Answers

  • ursammannursammann CHMember ✭✭

    i have the same problem. A lot of crashes in Android 6 and 7:
    java.lang.RuntimeException:
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
    Caused by: java.lang.reflect.InvocationTargetException:
    at java.lang.reflect.Method.invoke(Native Method:0)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:728)
    Any ideas?

  • KrunalBerawalaKrunalBerawala USMember ✭✭

    started seeing these error in last few days, for me its on android 7. its happening when remote notification is received.

  • ursammannursammann CHMember ✭✭
    edited May 2017

    My app has thousends of crashes like this. I have no remote notification implemented.
    And i see this kind of error also under Android 4 and 5:
    java.lang.RuntimeException:
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
    at dalvik.system.NativeStart.main(Native Method:0)
    Caused by: java.lang.reflect.InvocationTargetException:
    at java.lang.reflect.Method.invokeNative(Native Method:0)
    at java.lang.reflect.Method.invoke(Method.java:511)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:833)

  • sonic1015sonic1015 CAMember ✭✭
    edited May 2017

    I've been receiving these for a few weeks as well on Android 6 & 7 as well, but have not seen it during debug, only on releases to Alpha.

  • quikkzquikkz USMember
    edited May 2017

    Same here.. Only on, 6.0, 7.0 and 7.1

    java.lang.RuntimeException:
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
    Caused by: java.lang.reflect.InvocationTargetException:
    at java.lang.reflect.Method.invoke(Native Method:0)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)

    Any ideas?

  • ursammannursammann CHMember ✭✭

    With a google research i have not found this error happens with Apps direct under the android java native runtime.
    I assume this error appears with the xamarin runtime.
    Please xamarin developers could you have a look on this problem.
    It appears every day and is not good for the quality of the product.

  • OliverMelcherOliverMelcher DEMember ✭✭

    Same here...

  • Same problem here...

  • OliverMelcherOliverMelcher DEMember ✭✭

    Ok, now we all know, that we have the same problem :smile:
    Lets's find out which version of Xamarin everyone uses. Does anybody use the newest version 4.5.0.476?

    Mine is 4.2.1.64 (with Xamarin.Android 7.0.2.37)

    I also use the following NuGet packages (all 22.2.1):

    Xamarin.Android.Support.Design
    Xamarin.Android.Support.v4
    Xamarin.Android.Support.v7.AppCompat
    Xamarin.Android.Support.v7.CardView

  • NikolayDemirevNikolayDemirev USMember ✭✭

    Same here.

    I use Xamarin.Forms v2.3.4.247

    And all of the following libraries version 23.3.0:

    Xamarin.Android.Support.Design
    Xamarin.Android.Support.v4
    Xamarin.Android.Support.v7.AppCompat
    Xamarin.Android.Support.v7.CardView

  • JohnLintonJohnLinton USMember

    I'm having the same issue. I use Xamarin.Forms v2.3.4.247.

    I think this has to do with the latest Android OS update. For us, this just started with the newest update.

  • ursammannursammann CHMember ✭✭

    I see the first errors like this from about the begining of April.
    Before google had another error log system and after the change to the new system we see this errors.
    I see this for Android 4, 5, 6 and 7.

    I use:
    Xamarin.Android.Support.v4 (Xamarin.Android.Support.v4.23.4.0.1)
    Xamarin.GooglePlayServices.Ads
    Xamarin.GooglePlayServices.AppIndexing
    Xamarin.GooglePlayServices.Basement
    Xamarin.InAppBilling
    Mono.Android
    mscorlib.dll (2.0.5.0)

  • VladimirDjordjevicVladimirDjordjevic USMember ✭✭

    Same issue on Android Wear 2.0

    java.lang.RuntimeException:
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
    Caused by: java.lang.reflect.InvocationTargetException:
    at java.lang.reflect.Method.invoke(Native Method:0)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)

  • sonic1015sonic1015 CAMember ✭✭

    Latest Stable for Xamarin Forms & Android for me:

    Forms: 2.3.4.247
    Xamarin.Android.Support: 25.3.1
    Xamarin.Android: 7.3.1.2

  • SuperVegaSuperVega USMember

    same here for me.. I'm using Xamarin 4.5.0.476, Android: 7.3.1.2

    java.lang.RuntimeException:
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
    Caused by: java.lang.reflect.InvocationTargetException:
    at java.lang.reflect.Method.invoke(Native Method:0)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)

  • OliverMelcherOliverMelcher DEMember ✭✭

    Does somebody use SQLite? I do, and i found this (https://developer.xamarin.com/releases/android/xamarin.android_7/xamarin.android_7.3/#mono-data-sqlite):

    "Native Library Use
    Due to a change by Google, Android N will now only permit linking to NDK-provided native libraries. libsqlite.so is not an NDK-provided native library. Consequently, existing apps using e.g. Mono.Data.Sqlite.dll will crash when running on Android N. This may include other SQLite-using assemblies, not distributed with Xamarin.Android.
    [...]
    "

  • MarkCerezoMarkCerezo USMember ✭✭

    Same here.
    Android Version: 7 (Nougat)
    Xamarin 4.3.0795

  • JohnBown.3615JohnBown.3615 GBMember
    edited June 2017

    Yep, me too. But I have two separate (similar) occurrences. The first only happens on Android 6.0, 7.0, and 7.1:

    java.lang.RuntimeException:
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:762)
    Caused by: java.lang.reflect.InvocationTargetException:
    at java.lang.reflect.Method.invoke(Native Method:0)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:872)

    The second only happens on Android 5.0 and 5.1:

    java.lang.RuntimeException:
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:815)
    Caused by: java.lang.reflect.InvocationTargetException:
    at java.lang.reflect.Method.invoke(Native Method:0)
    at java.lang.reflect.Method.invoke(Method.java:372)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1020)

    Xamarin 4.4.0.34
    Xamarin.Forms 2.3.4.224
    Xamarin.Android 7.2.0.7
    Xamarin.Android Nuget packages 2.3.3.0

    I'll upgrade to the latest versions, and do a new release over the next few days, but I suspect that won't make any difference given what people are saying here.

    Has anyone implemented their own error reporting service / function, which might give a better clue as to the cause? I've put try/catch guards pretty much everywhere and re-throw sensible exceptions, but all I see are these. The only common factor is the Android versions - it seems to go across all hardware.

  • dreiddreid USMember
    edited June 2017

    Experiencing reports of this crash as well on my recently published Android app:

    Crash reported on Android 6.0, 7.0, and 7.1
    The app does use SQLite (previous poster was asking)
    Xamarin.Forms and Xamarin.Forms.Maps: 2.3.4.231
    Xamarin.Android.Support: 25.1.1

  • JohnBown.3615JohnBown.3615 GBMember

    I am getting the same. I have done some investigations. On 17th May, Google made some changes to the developer console. Explicitly submitted reports will include the full Xamarin stack trace, and look something like:

    java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:620)
    Caused by: java.lang.reflect.InvocationTargetException
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:730)
    ... 1 more
    Caused by: android.runtime.JavaProxyThrowable: System.Exception: Trapped exception in DownloadPropertiesPage.OnDownload: Attempted to divide by zero.
    at....

    However, automatically submitted reports (if the user opts in to send usage and diagnostics automatically) will just show this:

    java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:620)
    Caused by: java.lang.reflect.InvocationTargetException
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:730)

    The Xamarin part of the stack trace is omitted.

    Also, even though the error reports ZygoteInit.main(ZygoteInit), this is nothing to do with application startup. All normal exceptions thrown when the application is running are also shown like this (albeit with slightly different line numbers).

    I have informed both Xamarin and Google. Not sure where the fault lies at the moment.

  • RaymondKellyRaymondKelly USMember ✭✭✭

    Same exact issue using XF 2.3.4.247. I do not use SQLLite directly but I do use Google Analytics and Ads.

  • OliverMelcherOliverMelcher DEMember ✭✭

    Thanks @JohnBown.3615 good point!
    Can confirm your statement. I searched several exceptions and found some with Xamarin-stack, and some without. All of them contain the "ZygoteInit.main" function-call.

  • VladimirDjordjevicVladimirDjordjevic USMember ✭✭

    I am also using SQLite

  • Luca.9439Luca.9439 USMember ✭✭

    Any fix for this?

  • Any got any solution for the above issue.

    I am also facing the same problem. Getting the same error

    java.lang.RuntimeException:
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
    Caused by: java.lang.reflect.InvocationTargetException:
    at java.lang.reflect.Method.invoke(Native Method:0)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)

  • All,
    It looks like we are getting close to a solution here.
    First off the errors are being caused by something in our code.
    The problem is that they are not being reported correctly so we can find our bugs and correct them.
    Please take a look at this xamarin bug post.
    It appears they have a possible fix in mind, but no telling how long it will take to roll out.
    https://bugzilla.xamarin.com/show_bug.cgi?id=56653#c21

    Thanks All.

  • VladimirDjordjevicVladimirDjordjevic USMember ✭✭

    Thank you for the info.

  • VaibhavPatilVaibhavPatil USMember ✭✭

    Hello guys, is there any progress yet ?

    I finally figured out what causing these exceptions, its Remote Notifications.
    Whenever my app received notification it reported crash to google play console. my crash stack traces are same as yours.
    It majorly occurred in 6.0 and 7.0.

    I have posted question with all my stack traces and screenshots on stackoverflow

    here's the question link.

    https://stackoverflow.com/questions/44930910/xamarin-android-app-reported-crash-with-java-lang-reflect-invocationtargetexcept

    My xamarin version are

    Xamarin for Visual Studio 4.3
    Xamarin.Android 7.1.0-43
    Xamarin.Firebase.Messaging.42.1021.1
    Xamarin.Android.Support.Design.25.3.1

    I am waiting for stackoverflow to give me some solution/ more details about it.

    Please if anyone have any solution on this please post it.

  • mubimubi USMember ✭✭✭

    SAME ISSUE
    ...............................
    Hi All,
    I am not much aware of the Android native platform. Please help me to resolve this issue according to Xamarin Forms.

  • JonDouglasJonDouglas USXamarin Team, University, Developer Group Leader Xamurai

    Hey all,

    There is a fix as part of Xamarin.Android 7.4.0.11+. You can get this version today on Windows by updating to the Visual Studio Preview channel in the Visual Studio Installer. If you're on Mac, you can update to the latest Beta channel.

    https://developer.xamarin.com/recipes/cross-platform/ide/change_updates_channel/

    This will make the Stable channel once 15.3 ships.

  • ZaneCampbellZaneCampbell USMember ✭✭

    @JonDouglas said:
    Hey all,

    There is a fix as part of Xamarin.Android 7.4.0.11+. You can get this version today on Windows by updating to the Visual Studio Preview channel in the Visual Studio Installer. If you're on Mac, you can update to the latest Beta channel.

    https://developer.xamarin.com/recipes/cross-platform/ide/change_updates_channel/

    This will make the Stable channel once 15.3 ships.

    Thanks for the update. I am experiencing the same crashes as described. However, I am reluctant to update my production app using a beta build.

    I understand that 15.3 will ship when it is ready, but does anyone have a really rough estimate of when it may ship? Are we talking days, weeks, or months?

    Thank you again.

  • JonDouglasJonDouglas USXamarin Team, University, Developer Group Leader Xamurai

    You can view the Visual Studio Release Timeline:

    https://www.visualstudio.com/en-us/productinfo/vs2017-release-rhythm

    Minor Updates ship roughly every six weeks.

  • KrunalBerawalaKrunalBerawala USMember ✭✭

    my app crashed when app was in background, on receiving remote notification and when doing background fetch.

    not sure if this helps
    I removed all the references to DependencyService.Get in the code file that executes in background, read somewhere that xamarin needs to be initialized before executing xamarin code.

    now i dont see any crashes related to zygote

  • KrunalBerawalaKrunalBerawala USMember ✭✭

    @KrunalBerawala said:
    my app crashed when app was in background, on receiving remote notification and when doing background fetch.

    not sure if this helps
    I removed all the references to DependencyService.Get in the code file that executes in background, read somewhere that xamarin needs to be initialized before executing xamarin code.

    now i dont see any crashes related to zygote

    Also, removed the splash activity and implemented alternate method to show splash screen.
    example:
    https://forums.xamarin.com/discussion/83566/android-xamarin-forms-set-splash-screen-while-xamarin-forms-initalizes

  • MaximAlexeyevMaximAlexeyev USMember ✭✭

    Started to see this problem in new version. I added read access to contact list and mobile center SDK. I use sqlite, but it was always there. Could upgrade to newer version though.

  • JohnBown.3615JohnBown.3615 GBMember

    @ZaneCampell said:

    @JonDouglas said:
    Hey all,

    There is a fix as part of Xamarin.Android 7.4.0.11+. You can get this version today on Windows by updating to the Visual Studio Preview channel in the Visual Studio Installer. If you're on Mac, you can update to the latest Beta channel.

    https://developer.xamarin.com/recipes/cross-platform/ide/change_updates_channel/

    This will make the Stable channel once 15.3 ships.

    Thanks for the update. I am experiencing the same crashes as described. However, I am reluctant to update my production app using a beta build.

    I understand that 15.3 will ship when it is ready, but does anyone have a really rough estimate of when it may ship? Are we talking days, weeks, or months?

    Thank you again.

    I have just updated my app to Xamarin.Android 7.4.0.19 and uploaded to the store to see if the problem with the ZygoteInit errors and the missing stack traces has been resolved. I don't know! I seem to be getting different behaviour. The number of crashes reported in the developer console is gradually increasing (and I can force an exception in the app to ensure it goes up), however, I am getting NOTHING listed in the new 'ANRs & Crashes' section at all now for the latest version of the app. Is anybody else seeing this?

  • ChristianSvrdChristianSvrd SEMember ✭✭✭

    @JonDouglas said:
    Hey all,

    There is a fix as part of Xamarin.Android 7.4.0.11+. You can get this version today on Windows by updating to the Visual Studio Preview channel in the Visual Studio Installer. If you're on Mac, you can update to the latest Beta channel.

    https://developer.xamarin.com/recipes/cross-platform/ide/change_updates_channel/

    This will make the Stable channel once 15.3 ships.

    Any way to update Xamarin.Android without upgrading visual studio?

  • Hi,

    I dont have notifications in the app, just SQLite.
    Updated to latest versions and still errors show up.
    Tried to put all under try{} to see if that will help somehow but no change.
    Crashes happen just sometimes and task is just to save few numbers to SQLite table.

  • JonDouglasJonDouglas USXamarin Team, University, Developer Group Leader Xamurai

    @ChristianSvrd

    Any way to update Xamarin.Android without upgrading visual studio?

    To a certain extent, yes. You can use the "Xamarin Updater" extension to upgrade. However most Xamarin releases are tied into Visual Studio releases.

    https://marketplace.visualstudio.com/items?itemName=Xamarin.XamarinUpdater

    It is highly recommended to stay on the Stable channel of Visual Studio updates as they are incrementally better.

  • ChristianSvrdChristianSvrd SEMember ✭✭✭

    @JonDouglas said:
    @ChristianSvrd

    Any way to update Xamarin.Android without upgrading visual studio?

    To a certain extent, yes. You can use the "Xamarin Updater" extension to upgrade. However most Xamarin releases are tied into Visual Studio releases.

    https://marketplace.visualstudio.com/items?itemName=Xamarin.XamarinUpdater

    It is highly recommended to stay on the Stable channel of Visual Studio updates as they are incrementally better.

    I tried downloading the extension from the link, but whenever I press download it Just reloads the page and nothing gets downloaded, how do I download?

Sign In or Register to comment.