Forum Xamarin.Android

Error The file "obj \ Debug \ android \ bin \ packaged_resources" does not exist.

FotalFotal Member ✭✭✭

3> Task "Touch" (TaskId Task ID: 415)
3> Task parameter: Files = obj \ Debug \ android \ bin \ packaged_resources (TaskId Task ID: 415)
3> P: \ Programs \ Visual Studio 17 \ MSBuild \ Xamarin \ Android \ Xamarin.Android.Common.targets (1921,3): error MSB3375: The file "obj \ Debug \ android \ bin \ packaged_resources" does not exist.
3> The "Touch" task completed with an error. (TaskId Task ID: 415)
3> Assembling the target object "_CreateBaseApk" in the project "Droid.csproj" is completed with an error .: (TargetId target ID: 256)

Hi, I have been trying for a long time to solve this problem, I saw other topics about this problem, but they did not help me. I have these settings:

Best Answer

  • FotalFotal Member ✭✭✭
    edited January 2018 Accepted Answer

    Hi guys, I seem to have found what my problem is. In my project there is a styles.xml file, it is he who generates the error "package_resources dos not exit".

    My steps are to detect the error, if you can not find it (error) on the diagnostic output mod:

    Create a new Android Project

    Add Uses-Permission in Android Manifest Correctly

    Add Packages :

    + 25.4.0.2 Xamarin.Android.Support.Design 
    + 25.4.0.2 Xamarin.Android.Support.v4  
    + 10.0.3   Newtonsoft.Json and etc packages 
        Warning: Found conflicts between different versions of "Microsoft.CSharp" that could not be resolved.  These reference conflicts are listed in the build log when log verbosity is set to detailed. DroidPackageTest    
        Warning: Found conflicts between different versions of "System.Net.Http" that could not be resolved.  These reference conflicts are listed in the build log when log verbosity is set to detailed.  DroidPackageTest    
    + 2.3.2    ZXing.Net.Mobile
    + 1.4.118  sqlite-net-pcl and etc packages   
    +          Core and NewCore dependensive
        Warning: No Address and User has been specified in order to establish a connection to a Mac Server, so only the main assembly was compiled for project 'Core'. Connect to a Mac Server and try again to build the full application. Core    
    
    + 1.2.0    AndHUD
    + 2.0.0.2  FortySevenDeg 
    + 1.0.2    PullToRefresharp  
    

    Add Resources :

    + drawable in drawable
        Error: 1: error: Error: No resource found that matches the given name (at 'color' with value '@color/white'). DroidPackageTest
            Resolve: add Colors.xml
    + Colors.xml in values
    + drawable-hdpi, mdpi, xhdpi, xxhdpi, xxxhdpi in mipmap-hdpi...
        Error: Not recognizing known sRGB profile that has been edited  DroidPackageTest
        Warning: obj\Release\res\mipmap-hdpi\ic_keyboard_arrow_right_black.png: libobj\Release\res\mipmpap-xhdpi\ic_keyboard_arrow_rightng warning: _black.png: libpng warniiCCP: Not recognizing known sRGB profile othat has bjb\een edited   DroidPackageTest
        Warning: 3 same warnings above
            Resolve: Download PNGoo from https://pngquant.org/; https://youtu.be/mfFrrIRtD24
    + other files from values in values
        Styles.xml generated an error "packages_resources does not found";
    

    Styles.xml
    <!-- LAYOUTS --> <style name="Divider"> <item name="android:id">@+id/divider</item> <item name="android:layout_width">match_parent</item> <item name="android:layout_height">1dp</item> <item name="android:background">@color/lightgray</item> </style>

    I think the android:id invalid. I just comment <item name="android:id">@+id/divider</item> and everything worked , i'm very happy.

Answers

  • CharwakaCharwaka INMember ✭✭✭✭✭

    Try to exclude and include Resources folder and rebuild
    Try to move project to Root Folder C:\

    Clean & rebuild

  • FotalFotal Member ✭✭✭

    @Charwaka Ok, well when i exclude and include and then rebuild, i get a similar error like a this " Error obj\Release\res aboutresources.txt Droid P:\Работа\Проекты\gitApro\ebm2i\BLS_Proj\Droid\invalid resource directory name
    "
    When i move project to Root Folder C:\ nothing changed.

    3>"P:\Работа\Проекты\gitApro\ebm2i\BLS_Proj\Droid\Droid.csproj" (Rebuild target) (1) ->
    3>(_UpdateAndroidResgen target) ->
    3> invalid resource directory name : error APT0000: obj\Release\res aboutresources.txt

  • CharwakaCharwaka INMember ✭✭✭✭✭

    visual studio version ?

  • FotalFotal Member ✭✭✭

    @Charwaka Visual Studio Community 2017

  • CharwakaCharwaka INMember ✭✭✭✭✭

    @Fotal said:
    @Charwaka Visual Studio Community 2017

    Try deelting this file **aboutresources.txt ** clean& rebuild

    Check all images build action set to Android Resource and there are no spaces in name and also check for string if they have any spaces in key value

  • FotalFotal Member ✭✭✭

    @Charwaka For 2 weeks I tried many solutions, but not one did not help, sometimes the project build, but gave out the error of class definition apparently due to the fact that patckage_resources was not correctly generated

  • CharwakaCharwaka INMember ✭✭✭✭✭

    @Fotal said:
    @Charwaka For 2 weeks I tried many solutions, but not one did not help, sometimes the project build, but gave out the error of class definition apparently due to the fact that patckage_resources was not correctly generated

    we have to try multiple solutions unless we know root cause,it like finding a needle in haystack

  • FotalFotal Member ✭✭✭

    @Charwaka Thanks, but I'm in a very bad situation, I was given a project that is being built on iOS, but it does not work on android, the problem is that the project is about 5-6 years old, it's not too big, but as a beginner I have to look for a "needle in haystack ". Does it make sense to rebuild the project in parts? But I'm new to Xamarin, especially in the native android.

    I tried different options for SDK Manager.
    I reviewed all the pictures (their names and extensions) in the android project. As it was written in some forums, a mistake can be on this.

    Does it make sense to rebuild the project and add a bit of the already written functionality to it, or should try to fix this exception?

  • FotalFotal Member ✭✭✭
    edited January 2018 Accepted Answer

    Hi guys, I seem to have found what my problem is. In my project there is a styles.xml file, it is he who generates the error "package_resources dos not exit".

    My steps are to detect the error, if you can not find it (error) on the diagnostic output mod:

    Create a new Android Project

    Add Uses-Permission in Android Manifest Correctly

    Add Packages :

    + 25.4.0.2 Xamarin.Android.Support.Design 
    + 25.4.0.2 Xamarin.Android.Support.v4  
    + 10.0.3   Newtonsoft.Json and etc packages 
        Warning: Found conflicts between different versions of "Microsoft.CSharp" that could not be resolved.  These reference conflicts are listed in the build log when log verbosity is set to detailed. DroidPackageTest    
        Warning: Found conflicts between different versions of "System.Net.Http" that could not be resolved.  These reference conflicts are listed in the build log when log verbosity is set to detailed.  DroidPackageTest    
    + 2.3.2    ZXing.Net.Mobile
    + 1.4.118  sqlite-net-pcl and etc packages   
    +          Core and NewCore dependensive
        Warning: No Address and User has been specified in order to establish a connection to a Mac Server, so only the main assembly was compiled for project 'Core'. Connect to a Mac Server and try again to build the full application. Core    
    
    + 1.2.0    AndHUD
    + 2.0.0.2  FortySevenDeg 
    + 1.0.2    PullToRefresharp  
    

    Add Resources :

    + drawable in drawable
        Error: 1: error: Error: No resource found that matches the given name (at 'color' with value '@color/white'). DroidPackageTest
            Resolve: add Colors.xml
    + Colors.xml in values
    + drawable-hdpi, mdpi, xhdpi, xxhdpi, xxxhdpi in mipmap-hdpi...
        Error: Not recognizing known sRGB profile that has been edited  DroidPackageTest
        Warning: obj\Release\res\mipmap-hdpi\ic_keyboard_arrow_right_black.png: libobj\Release\res\mipmpap-xhdpi\ic_keyboard_arrow_rightng warning: _black.png: libpng warniiCCP: Not recognizing known sRGB profile othat has bjb\een edited   DroidPackageTest
        Warning: 3 same warnings above
            Resolve: Download PNGoo from https://pngquant.org/; https://youtu.be/mfFrrIRtD24
    + other files from values in values
        Styles.xml generated an error "packages_resources does not found";
    

    Styles.xml
    <!-- LAYOUTS --> <style name="Divider"> <item name="android:id">@+id/divider</item> <item name="android:layout_width">match_parent</item> <item name="android:layout_height">1dp</item> <item name="android:background">@color/lightgray</item> </style>

    I think the android:id invalid. I just comment <item name="android:id">@+id/divider</item> and everything worked , i'm very happy.

Sign In or Register to comment.