Application has stopped working error !!!

HamittirpanHamittirpan Member ✭✭✭
edited December 3 in Xamarin.Forms

Hi everyone !

I published my application developed with Xamarin Forms in App Store and Play Store. My app works correctly on ios devices. But on some android devices "application has stopped working error" occurs. The application never even opens.

When installing my application in playstore, I gave support according to all processor types. Like this;


Also, I'm using the minimum API Level 19. And some devices that give this error are already in the API range I support. For example, some API 28 devices can give this error. So, I guess it's not a problem that arises from api.

I am aware that this error can happen for a lot of reasons. But I asked this question because I think that the experienced people in the forum can guide me.

What could be the cause of this problem? What are your suggestions for the solution?

Thanks in advance !

Tagged:

Answers

  • LeonLuLeonLu Member, Xamarin Team Xamurai
    edited December 4

    That is very hard to say what is cause of this issue, but you can located by device log, connect your device to VS by USB, then open the Device Log, open your application, when you got this issue, please check the log.

  • HamittirpanHamittirpan Member ✭✭✭

    Hi @LeonLu Deploying to device output ;

    /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(2798,3): warning MSB3247: Found conflicts between different versions of the same dependent assembly. In Visual Studio, double-click this warning (or select it and press Enter) to fix the conflicts; otherwise, add the following binding redirects to the "runtime" node in the application configuration file:
    /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.Debugging.targets(622,2): error ADB0000: Deployment failed
    /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.Debugging.targets(622,2): error ADB0000: Mono.AndroidTools.InstallFailedException: Failure [INSTALL_FAILED_DUPLICATE_PERMISSION perm=com.hamittirpan.gulaylarmenudesign.permission.C2D_MESSAGE pkg=com.hamittirpan.gulaylarmenudesign]
    /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.Debugging.targets(622,2): error ADB0000: at Mono.AndroidTools.Internal.AdbOutputParsing.CheckInstallSuccess (System.String output, System.String packageName) [0x00159] in :0
    /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.Debugging.targets(622,2): error ADB0000: at Mono.AndroidTools.AndroidDevice+<>c__DisplayClass95_0.b__0 (System.Threading.Tasks.Task1[TResult] t) [0x0001c] in <c6d308c31f1a423881cad0afbbe26c20>:0 /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.Debugging.targets(622,2): error ADB0000: at System.Threading.Tasks.ContinuationTaskFromResultTask1[TAntecedentResult].InnerInvoke () [0x00024] in :0
    /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.Debugging.targets(622,2): error ADB0000: at System.Threading.Tasks.Task.Execute () [0x00000] in /Users/builder/jenkins/workspace/build-package-osx-mono/2019-06/external/bockbuild/builds/mono-x64/external/corert/src/System.Private.CoreLib/src/System/Threading/Tasks/Task.cs:2319
    /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.Debugging.targets(622,2): error ADB0010: Failure [INSTALL_FAILED_DUPLICATE_PERMISSION perm=com.hamittirpan.gulaylarmenudesign.permission.C2D_MESSAGE pkg=com.hamittirpan.gulaylarmenudesign]
    /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.Debugging.targets(622,2): error ADB0010: at Mono.AndroidTools.Internal.AdbOutputParsing.CheckInstallSuccess (System.String output, System.String packageName) [0x00159] in :0
    /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.Debugging.targets(622,2): error ADB0010: at Mono.AndroidTools.AndroidDevice+<>c__DisplayClass95_0.b__0 (System.Threading.Tasks.Task1[TResult] t) [0x0001c] in <c6d308c31f1a423881cad0afbbe26c20>:0 /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.Debugging.targets(622,2): error ADB0010: at System.Threading.Tasks.ContinuationTaskFromResultTask1[TAntecedentResult].InnerInvoke () [0x00024] in :0
    /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.Debugging.targets(622,2): error ADB0010: at System.Threading.Tasks.Task.Execute () [0x00000] in /Users/builder/jenkins/workspace/build-package-osx-mono/2019-06/external/bockbuild/builds/mono-x64/external/corert/src/System.Private.CoreLib/src/System/Threading/Tasks/Task.cs:2319
    1 Warning(s)
    2 Error(s)

    Time Elapsed 00:01:09.80

  • HamittirpanHamittirpan Member ✭✭✭
    edited December 3
  • LeonLuLeonLu Member, Xamarin Team Xamurai

    Please go to Settings->Apps select your application and uninstall. After that, deploy your applcation

  • HamittirpanHamittirpan Member ✭✭✭

    @LeonLu I did it like you said. Now I get this error ;

  • LeonLuLeonLu Member, Xamarin Team Xamurai

    Can you share your permission in AndroidManifest.xml, I found a similar thread, https://stackoverflow.com/questions/27043933/install-failed-duplicate-permission-c2d-message

  • HamittirpanHamittirpan Member ✭✭✭

    @LeonLu

    <?xml version="1.0" encoding="utf-8"?>
    <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.hamittirpan.gulaylarmenudesign" android:installLocation="auto" android:versionCode="16" android:versionName="16">
        <uses-sdk android:minSdkVersion="19" android:targetSdkVersion="28" />
        <application android:label="Diamond Line" android:usesCleartextTraffic="true" android:windowSoftInputMode="adjustPan|stateHidden" android:networkSecurityConfig="@xml/network_security_config" android:icon="@drawable/iconAndroid">
            <provider android:name="android.support.v4.content.FileProvider" android:authorities="com.hamittirpan.gulaylarmenudesign.fileprovider" android:exported="false" android:grantUriPermissions="true">
                <meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/provider_paths"></meta-data>
            </provider>
            <meta-data android:name="com.google.android.maps.v2.API_KEY" android:value="xxxxxx" />
            <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />
            <!-- Necessary for apps that target Android 9.0 or higher -->
            <uses-library android:name="org.apache.http.legacy" android:required="false" />
        </application>
        <uses-permission android:name="android.permission.INTERNET" />
        <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
        <uses-permission android:name="android.permission.CALL_PHONE" />
        <uses-permission android:name="android.permission.CALL_PRIVILEGED" />
        <uses-permission android:name="android.permission.MODIFY_PHONE_STATE" />
        <uses-permission android:name="android.permission.READ_PHONE_STATE" />
    </manifest>
    
  • HamittirpanHamittirpan Member ✭✭✭

    Hi @LeonLu One of the devices that failed is using Android 8.1. And I wanted to show you my SDK Manager. That's how I published my application;

    Should I have marked other features? Do you think this could be the problem?

  • LeonLuLeonLu Member, Xamarin Team Xamurai

    I notice your used android:networkSecurityConfig="@xml/network_security_config" in your AndroidManifest.xml, Please open the network_security_config.xml, if you have added the android.permission.ACCESS_NETWORK_STATE in the network_security_config.xml , if so, you added android.permission.ACCESS_NETWORK_STATE in AndroidManifest.xml as well, you add this permission two times.

  • HamittirpanHamittirpan Member ✭✭✭

    @LeonLu here is my network_security_config file;

    <?xml version="1.0" encoding="UTF-8" ?>
    <network-security-config>
      <base-config cleartextTrafficPermitted="true" />
      <domain-config cleartextTrafficPermitted="true">
        <domain includeSubdomains="true">xxxxx</domain>
            <trust-anchors>
                <certificates src="@raw/burp"/>
            </trust-anchors>
      </domain-config>
    </network-security-config>
    
  • HamittirpanHamittirpan Member ✭✭✭
    edited December 4

    Hi @LandLu Looks like I've solved the problem for now. But, to tell you the truth, I don't know how I figured it out.
    I did the following for the solution ;

    in MainActivity.cs --> I removed RequestPermissions(Permission, RequestId)

    Why is the problem solved when I remove this code?

  • LeonLuLeonLu Member, Xamarin Team Xamurai

    Due to your Failure [INSTALL_FAILED_DUPLICATE_PERMISSION] , this error will be shown if you request same permissions two times or more. so if you remove RequestPermissions(Permission, RequestId), it worked as normal.

Sign In or Register to comment.