Git Product home page Git Product logo

Comments (11)

yhwang0916 avatar yhwang0916 commented on August 21, 2024

i meet this problem

from android-resource-remover.

ca77y avatar ca77y commented on August 21, 2024

this is not correct. the second argument in the message should be the name of the resource ('dimen', 'missing_dimen')

if it's empty it means the name wasn't picked up correctly. could you paste the file which causes the problem

from android-resource-remover.

sb673 avatar sb673 commented on August 21, 2024

I apologize, github formatting problems. The second argument wasn't an empty string but the id of the unused dimen. Sorry for the confusion. It was like this:

removing ('dimen', "<dimen_id_tag>") from resource ./res/values/dimens.xml
I unfortunately cannot paste the file.

from android-resource-remover.

ca77y avatar ca77y commented on August 21, 2024

i can't reproduce it. can you create a test for that in the sample app https://github.com/KeepSafe/android-resource-remover/blob/master/test/android_app/res/values/dimens.xml

from android-resource-remover.

oneeyedhobbit avatar oneeyedhobbit commented on August 21, 2024

I'm having a related issue, but with different results: when trying to remove unused string resources, the entire contents of the xml file are deleted, causing the script to error (presumably from reading an EOF byte instead of a string). Here's the traceback:

Namespace(app='.', ignore_layouts=False, lint='lint', xml='shareplan/build/outputs/lint-results.xml')
removing ('string', 'title_about`') from resource /Users/william.jarvis/Documents/Code42Development/c42_shareplan_android/shareplan/src/main/res/values/strings.xml
Traceback (most recent call last):
File "/usr/local/bin/android-resource-remover", line 9, in
load_entry_point('android-resource-remover==0.1.0', 'console_scripts', 'android-resource-remover')()
File "/usr/local/lib/python3.4/site-packages/android_clean_app.py", line 138, in main
remove_unused_resources(issues, app_dir, ignore_layouts)
File "/usr/local/lib/python3.4/site-packages/android_clean_app.py", line 132, in remove_unused_resources
remove_resource_value(issue, filepath)
File "/usr/local/lib/python3.4/site-packages/android_clean_app.py", line 120, in remove_resource_value
tree.write(resource, encoding='utf-8', xml_declaration=True)
File "lxml.etree.pyx", line 1947, in lxml.etree._ElementTree.write (src/lxml/lxml.etree.c:57536)
File "serializer.pxi", line 504, in lxml.etree._tofilelike (src/lxml/lxml.etree.c:122727)
File "lxml.etree.pyx", line 316, in lxml.etree._ExceptionContext._raise_if_stored (src/lxml/lxml.etree.c:10323)
File "serializer.pxi", line 415, in lxml.etree._FilelikeWriter.write (src/lxml/lxml.etree.c:121463)
TypeError: must be str, not bytes

from android-resource-remover.

benjamin-bader avatar benjamin-bader commented on August 21, 2024

@oneeyedhobbit Thanks for the report; can you please open a separate issue for this? It will help us keep track of what's still open and what is fixed.

from android-resource-remover.

oneeyedhobbit avatar oneeyedhobbit commented on August 21, 2024

@benjamin-bader actually when I clone the repo and run the script directly everything seems to be working fine. It might just be that the version installed via pip is out of date. In light of that, would you still like me to open a new issue?

from android-resource-remover.

benjamin-bader avatar benjamin-bader commented on August 21, 2024

Glad to hear that things are working again! I'd say it's up to you whether to open a new issue. If you find that there is a problem, please feel free to open one.

from android-resource-remover.

oneeyedhobbit avatar oneeyedhobbit commented on August 21, 2024

Nope, everything is great running the script from the repo. You may want to remove the instructions to install via pip or (update the version you have uploaded there). Thanks for the awesome package =)!

from android-resource-remover.

ca77y avatar ca77y commented on August 21, 2024

@oneeyedhobbit the pip version is indeed old and we will be updating it. thx for feedback

from android-resource-remover.

ca77y avatar ca77y commented on August 21, 2024

pip updated

from android-resource-remover.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.