Error signing Ad Hoc: startIndex cannot be larger than length of string

I was signing the android part of my Xamarin Shared project. I had previously uploaded this app using the same signing certificate and was uploading to get an update out to alpha in the google play store. I had also previously used the same Package name. I switch between package names sometimes, so I first signed a version with a slightly different package name, which seemed to work fine. Except that I couldn't upload to the google play store because I forgot to change the version and had used the wrong package name. So I went back and changed the package name and version. And ended up with the following error:
startIndex cannot be larger than length of string
Parameter name: startIndex

I assume it has something to do with the package name or version. After a quick google search I only found one possible fix, which mentioned a period to many in the package name. So I double checked the package name, but there was nothing wrong there (as far as I know). I did a double check on the version as well.

Anyone have any experience in dealing with an issue like this?

Best Answer

Answers

  • GuyProvostGuyProvost CAMember ✭✭✭

    @LennardEijsackers said:
    What I eventually found was that some of the permissions in the android manifest still referenced another package name. Changing these permissions fixed this issue.

    Have the same problem after changing the name of the app. What have you done exactly to fix this ?

  • LennardEijsackersLennardEijsackers NLUniversity

    @GuyProvost I looked in the source of the AndroidManifest, where I declared some permissions relating to sending notifications. Some of those permissions where of the form your.package.name.permission. In my case the wrong package name was still used in the AndroidManifest

  • I have the same problem, but none of the two mentioned explanations are valid in my case :/.
    Permissions are fine, the number of points also...

  • sharpdevelopersharpdeveloper USMember
    edited January 2017

    @DenisOk.7515 said:
    I have the same problem, but none of the two mentioned explanations are valid in my case :/.
    Permissions are fine, the number of points also...

    Ctrl c your permissions, delete your manifest, -> Rightclick android project -> Options -> Android Application -> Recreate, open new manifest, Ctrl v your permissions.

  • CuckooshkaCuckooshka USMember ✭✭

    I had the same problem after changing package name. There wasn't any permission in manifest with package name inside it.
    Clean & Rebuild solved the problem in my case.

  • VH5150VH5150 GBMember ✭✭

    @MortenHjort - Clean - delete bin/obj folders inside project folder - build... fixed this exact issue for me

    And worked for me too.

  • AngYiYangAngYiYang MYMember ✭✭

    @MortenHjort said:
    Clean - delete bin/obj folders inside project folder - build... fixed this exact issue for me

    This worked for me too, thanks

Sign In or Register to comment.