Comments (11)
i meet this problem
from android-resource-remover.
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.
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.
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.
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.
@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.
@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.
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.
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.
@oneeyedhobbit the pip version is indeed old and we will be updating it. thx for feedback
from android-resource-remover.
pip updated
from android-resource-remover.
Related Issues (20)
- Execution Error; Seeking Help HOT 8
- pip install error HOT 2
- pip install error on Windows: UnicodeDecodeError: HOT 2
- IOError: Error reading file 'build/outputs/lint-results.xml' HOT 7
- Didn't work
- OSError: [Errno 2] No such file or directory HOT 3
- UnicodeDecodeError HOT 1
- Need clarification HOT 4
- Incorrectly removes string referenced in AndroidManifest.xml HOT 1
- pin install error HOT 1
- how to exclude files with extension? HOT 3
- install failed HOT 1
- oh,no HOT 1
- Does this tool support latest gradle android project structure? HOT 2
- Exception: `lint` executable could not be found HOT 2
- 3rd part res
- Error: search AndroidManifest.xml in gradle project HOT 2
- Add a feature that remove all unused classes,methods from Android Studio project HOT 1
- how to uninstall it in my project dirctory
- integrate python code
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from android-resource-remover.