Error java.lang.IllegalArgumentException: already added

SreeeeSreeee INMember ✭✭✭

Hi guys
I am new with xamarin

Getting an error like this :
Severity Code Description Project File Line Suppression State
Error java.lang.IllegalArgumentException: already added : Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat; SmartTweet.Android

I update all the nuget packages, but the error still occur.

Anybody please suggest a solution

Thanks in advance... :)

Best Answers

  • rakeshraghavanrakeshraghavan INMember ✭✭
    Accepted Answer

    Just remove every Xamarin.Android.Support... (and their dependencies ) in your Droid project and add them again .

  • rakeshraghavanrakeshraghavan INMember ✭✭
    Accepted Answer

    Unload the android project and reload it [Right click on the android project then click unload project. After that reload the project]. Better do it for every project [IOS,Android,UWP and portable]. I guess it will resolve your issue. If still you are facing issue send me a message.

  • SreeeeSreeee INMember ✭✭✭
    Accepted Answer

    @rakeshraghavan I solved it by adding the namespace to the loadapplication(). But getting System.ArgumentNullException

    Also select the portable project in reference manager for android, ios and windows
    In android:

    Same done at ios and windows project reference manager.

    I don't know why getting this exception. Surround the loadapplication() with try catch, but not solved.
    Can you have any suggestion...

Answers

  • rakeshraghavanrakeshraghavan INMember ✭✭
    Accepted Answer

    Just remove every Xamarin.Android.Support... (and their dependencies ) in your Droid project and add them again .

  • SreeeeSreeee INMember ✭✭✭

    @rakeshraghavan I create a new project and add all the files and packages again, but after installing xam.plugin.media showing the same error.

    I will remove all the android packages and try once more as you said.

  • rakeshraghavanrakeshraghavan INMember ✭✭

    Once you done. If its not working let me know

  • SreeeeSreeee INMember ✭✭✭

    I remove all the packages and add again. It solved the previous error. But now showing an unhandled exception, I don't know at which file exception occurs. There is no clue about that in the output box.

    Do you have any idea why this exception occurs?

  • SreeeeSreeee INMember ✭✭✭

    Currently showing like this:

    I try to uncheck, check and apply the configuration for the first error, but not get solved.
    Don't know what to do for solving the remaining errors? Tried a lot.

    Can you help me to solve this?

  • rakeshraghavanrakeshraghavan INMember ✭✭
    Accepted Answer

    Unload the android project and reload it [Right click on the android project then click unload project. After that reload the project]. Better do it for every project [IOS,Android,UWP and portable]. I guess it will resolve your issue. If still you are facing issue send me a message.

  • SreeeeSreeee INMember ✭✭✭

    Unloading and reloading solve the last errors. Currently showing some other errors.

    I search for the solution and found that add system.web.extentions reference, but there is no such reference found in my project.

    Please suggest any other solution.... :)

  • SreeeeSreeee INMember ✭✭✭

    @rakeshraghavan Unloading and reloading do not completely solve my problem, please suggest me any other solution....

  • rakeshraghavanrakeshraghavan INMember ✭✭
    edited November 12
    What is this smartTweet? Is it ur project name?.
    What project you are doing?
  • rakeshraghavanrakeshraghavan INMember ✭✭
    Do the following steps.

    Clean the solution
    Build the PCL
    Remove the PCL reference from the affected project(s)
    Re-add the PCL reference
    Build
  • SreeeeSreeee INMember ✭✭✭

    @rakeshraghavan SmartTweet is my project name, it is an app for the tweet.

    Remove the nuget packages from Portable and android and re-added them back. Still showing the same issue.

    Is this a package issue? A lot of days are lost because of this issue, can you have any other suggestion for solving this?

  • SreeeeSreeee INMember ✭✭✭
    Accepted Answer

    @rakeshraghavan I solved it by adding the namespace to the loadapplication(). But getting System.ArgumentNullException

    Also select the portable project in reference manager for android, ios and windows
    In android:

    Same done at ios and windows project reference manager.

    I don't know why getting this exception. Surround the loadapplication() with try catch, but not solved.
    Can you have any suggestion...

Sign In or Register to comment.