GithubHelp home page GithubHelp logo

android-unused-resources's People

Contributors

scottkennedy avatar

android-unused-resources's Issues

Fails under Cordova because it has path ant-gen/R.java.d rather than the expected gen/R.java

What steps will reproduce the problem?
1. build Cordova project with android platform (I did in win7).
2. cd to platorms/android
3. try to run the AndroidUnusedResources1.6.2.jar

What is the expected output? What do you see instead?

I expected a list of removed resources.
I instead saw: -
Running in: c:\dev\projects\emgoddess\platforms\android
You must first build your project to generate R.java

What version of the product are you using? On what operating system?
AndroidUnusedResources1.6.2.jar in Windows7 with Cordova 3.5.0-0.2.6

Please provide any additional information below.

I looked at the AndroidUnusedResources1.6.2 source and I can see that its 
looking for a dir named 'gen', while in my Cordova build the gen dir is named 
'ant-gen'.
I would also note that there may be additional Cordova related files on the 
path for which AndroidUnusedResources may need to avoid removal.

I also googled for an equivalent solution (to AndroidUnusedResources) relating 
specifically to Cordova but could not find one.

There are a stack of default splash and icon resources related to Cordova on 
the build path, and once a developer has added their own icons/etc, he/she 
usually prefers to remove (manually at this stage) said Cordova resources to 
avoid the embarrassment of non app icons or splash screens showing up on users 
devices.  

If you would like to see the files and folders in my build path, or otherwise 
need any additional info please dont hesitate to email me.

Long live Apache.

Thank you and kind regards,
Eugene.

Original issue reported on code.google.com by [email protected] on 20 Sep 2014 at 4:04

Does not work on Windows 8 - Android Studio

What steps will reproduce the problem?
1. cd to the root dir of Android Studio Project
2. copy AndroidUnusedResources1.6.2.jar to that same root dir
3. java -jar AndroidUnusedResources1.6.2.jar

What is the expected output? What do you see instead?
 Running in: C:\Users\Philip\Desktop\Studio\InsuranceApp
 The current directory is not a valid Android project root.

What version of the product are you using? On what operating system?
AndroidUnusedResources1.6.2.jar on Windows 8. I am using Android Studio 1.1.0

Please provide any additional information below.


Original issue reported on code.google.com by [email protected] on 5 Mar 2015 at 11:22

Gives false positives for unused id's in a file with RelativeLayout, where id is referenced by other items in the same layout using android:layout_below

What steps will reproduce the problem?
1. AndroidUnusedResources1.6.2.jar against the attached file.

What is the expected output? What do you see instead?
No false positives

What version of the product are you using? On what operating system?
Version 1.6.2 on Mac OSX 10.7.4

Please provide any additional information below.
When run against attached file, I get the following false positives:

4 unused resources were found:
id        : addedit_titlebar
    /Users/gmanish/sources/noteit.android/res/layout/add_edit_item_view.xml
id        : addedit_updowncontrol
    /Users/gmanish/sources/noteit.android/res/layout/add_edit_item_view.xml
id        : iv_icon
id        : layout_price
    /Users/gmanish/sources/noteit.android/res/layout/add_edit_item_view.xml

Each of these id's are referenced in the same file using the attribute 
android:layout_below


Original issue reported on code.google.com by [email protected] on 4 Jul 2012 at 9:52

Attachments:

Doesn't check resources to see if they're use in library project references

First of all, great tool! It was really helpful in identifying resources that 
are no longer in use and ones that I thought had been in used and found a bug 
in my code.

What steps will reproduce the problem?
1. Create 2 android projects, one being a library, and the other referencing 
it. 
https://developer.android.com/guide/developing/projects/projects-cmdline.html#Re
ferencingLibraryProject
2. Add and reference some resources to the library project and make sure your 
tool doesn't find any unused resources.
3. Run your tool on the other project that references the library project.

What is the expected output? What do you see instead?
There should be no unused resources. Instead, it displays the all the resources 
from my referenced library project as unused.

What version of the product are you using? On what operating system?
AndroidUnusedResources 1.6.2 on Mac OSX 10.7.3

Please provide any additional information below.
I believe that when you compile an android project, it merges all the resources 
from referenced libraries into itself. For now, we run your tool against our 
library projects directly, but when we start introducing more levels, I believe 
it'll be more difficult to find unused resources.

Thanks!

Original issue reported on code.google.com by [email protected] on 6 Mar 2012 at 10:03

Can not see the unused file dir

I run "java -jar AndroidUnusedResources1.6.2.jar"
the result is "3586 resources found"
but I can not see the unuserd file dir

Original issue reported on code.google.com by keshuangjie on 1 Feb 2013 at 5:47

Stuck in โ€œ resources Found" process.

Stuck in this View

"D:\workspace-mobile\pandaspace_web_3.2.7_main>java -jar 
D:\workspace-mobile\pand
aspace_web_3.2.7_main\AndroidUnusedResources1.6.2.jar
Running in: D:\workspace-mobile\pandaspace_web_3.2.7_main
4853 resources found
"





Original issue reported on code.google.com by gybin02 on 29 Jan 2013 at 7:26

Doesn't properly handle multiple R.java files

What steps will reproduce the problem?
1. Import an Android library project

What is the expected output? What do you see instead?
The scanner only uses one of the R.java files, and there's no guarantee it's 
the appropriate one.

Original issue reported on code.google.com by [email protected] on 5 Aug 2011 at 5:04

Does not work in the latest Android projects

What steps will reproduce the problem?
1. Run the command in project root: java -jar AndroidUnusedResources1.6.2.jar


What is the expected output? What do you see instead?
I get this error:
--------------
0 resources found

Not generating usage matrices. If you would like them, create a directory named 
'resource-matrices' in the base of your project.

No unused resources were detected.
If you know you have some unused resources, please submit your project as a 
test case so this application can be improved.
---------------


What version of the product are you using? On what operating system?
AndroidUnusedResources1.6.2.jar on Windows 7. I am using Android Studio 0.4.0

Please provide any additional information below.


Original issue reported on code.google.com by [email protected] on 7 Jan 2014 at 10:14

wrong working directory (hard coded?)

What steps will reproduce the problem?
1. download AndroidUnusedResources1.3.jar
2. cd to your android projects root dir
3. run "java -jar /path/to/downloaded/AndroidUnusedResources1.3.jar"

What is the expected output? What do you see instead?
I see:
Running in: /home/max/workspace/my_project/C:\Users\Scott\Documents\ha
The current directory is not a valid Android project root.

And I have no clue where the C:\Users\Scott\Documents\ha comes from, I don't 
even use windows :)

What version of the product are you using? On what operating system?
AndroidUnusedResources1.3.jar
Lubuntu
2.6.38-11-generic

Original issue reported on code.google.com by [email protected] on 1 Sep 2011 at 3:38

Next styles seem to have issues.

What steps will reproduce the problem?
1.
2.
3.

What is the expected output? What do you see instead?


What version of the product are you using? On what operating system?


Please provide any additional information below.


Original issue reported on code.google.com by vinblau on 2 Dec 2010 at 10:04

Detail wrong unused string

What steps will reproduce the problem?
1. Define a string in string.xml (ex: str_notification)
2. In source, write a function to log this str_notification (name this function 
is printLog() (Log.i(TAG, str_notification);}
3. Although we don't call printLog, but we need to keep it to use later.
4. Run android-unused-resources and see str_notification is listed as unused.

In fact although we don't use str_notification at the moment, but we need to 
keep it for using later? But herein str_notification is listed as unused.



Original issue reported on code.google.com by [email protected] on 17 Jun 2011 at 3:11

running the tool and android studio project gives error

What steps will reproduce the problem?
1. I put the AndroidUnusedResources1.6.2.jar in root folder of the project 
using android studio
2.Ran the following command java -jar AndroidUnusedResources1.6.2.jar
3. I get error
"The current directory is not a valid Android project root."

What is the expected output? What do you see instead?


What version of the product are you using? On what operating system?


Please provide any additional information below.


Original issue reported on code.google.com by [email protected] on 23 Jan 2014 at 8:30

hierarchical styles not checked properly

What steps will reproduce the problem?
1. Add a style with the hierarchical naming convention (eg. 
"ParentStyle.ChildStyle")
2. Use style in xml file 'style="@style/ParentStyle.ChildStyle"'.
3. Run checker

What is the expected output? What do you see instead?
Expected:
4. style is treated as used.

Actual:
4. an alert is displayed, which says that a resource ("ParentStyle_ChildStyle" 
- whose name is has had its "." replaced with an "_") is not used. 


Original issue reported on code.google.com by g1adrift on 4 Jan 2011 at 8:43

v

What steps will reproduce the problem?
1.
2.
3.

What is the expected output? What do you see instead?


What version of the product are you using? On what operating system?


Please provide any additional information below.


Original issue reported on code.google.com by [email protected] on 18 Apr 2012 at 1:12

Move project to Github

Please, move project to Github. Project Hosting on Google Code will close on 
January 25th, 2016.

Original issue reported on code.google.com by [email protected] on 12 Apr 2015 at 1:02

Report used ids as unused

What steps will reproduce the problem?
1. Run Android Unused Resources on the project below:

https://github.com/Anasthase/TintBrowser

What is the expected output? What do you see instead?

Reports ids such as AddonsButtonLayout and AddonsWarningLayout from 
res/layout/addons_fragment.xml as being unused (and other similar cases on the 
same project).

These ids are not used in Java code, but they are in the same layout file as 
positioning reference in relative layouts (with android:layout_below, 
android:layout_above, etc.).

What version of the product are you using? On what operating system?

Version 1.6.2 on Linux Mint.

Please provide any additional information below.

Thanks for this very useful project !

Original issue reported on code.google.com by [email protected] on 6 Oct 2012 at 1:38

Colors said to be unused, but they are being used

What steps will reproduce the problem?
1. Create /res/values/colors.xml file.
2. Create /res/color/edit_text.xml selector file using some of the colors in 
the previous colors.xml file. 
3. Run the program

What is the expected output? What do you see instead?

Output will tell you that the colors in the colors.xml file are not being used.

What version of the product are you using? On what operating system?

The version of the jar is 1.6.2. I'm on Mac OS X Lion 10.7.4 and my java 
version is 1.6.0_31

Please provide any additional information below.

Nothing more to add... just congratulations ma! It is a great tool, you should 
make an Eclipse Plugin with it!

Original issue reported on code.google.com by [email protected] on 16 May 2012 at 10:36

Patch for /trunk/src/ca/skennedy/androidunusedresources/ResourceScanner.java

the boolean "found" value was the value of the last directory scanned in the 
gen directory.
There could be several directories in gen because : R file is in the 
Application package name hierarchy, generated interfaces are in the hierarchy 
of aidl file package (could be different)

Anyway, my patch fixes that.

Good job for this great tool

Original issue reported on code.google.com by [email protected] on 21 Jul 2011 at 9:51

Attachments:

Cannot find R.java for maven builds

I get the following error when trying to use the tool in a project built by 
maven.

    You must first build your project to generate R.java

See http://code.google.com/p/roboguice/source/browse/#hg%2Fastroboy for an 
example project, which can be built by running "mvn install"

Original issue reported on code.google.com by [email protected] on 17 Sep 2012 at 4:58

Unrecognized uses by androidannotations

What steps will reproduce the problem?

1. Create a new view with an unused id, e.g., "@+id/popocatepetl".

2. Use @EActivity with any activity and declare therein

@ViewById View popocatepetl;


What is the expected output? What do you see instead?

The id gets reported as unused, but it's needed. It gets used from a file in 
.apt_generated.

The reason might be either that this directory gets ignored or the `import 
.....R.id;` allowing to write `findByView(id.popocatepetl)`. Anyway, the fix 
should be trivial.

Original issue reported on code.google.com by [email protected] on 17 Sep 2012 at 9:33

Error reported in unused style does not check the parent

What steps will reproduce the problem?
1. If you have a style that derives from a another style using "parent=" and 
the parent is not referenced anyplace - the tool reports the parent style as 
unused, even if the child style is used


What is the expected output? What do you see instead?
It should not report if the child style is used


What version of the product are you using? On what operating system?
3.1


Please provide any additional information below.


Original issue reported on code.google.com by [email protected] on 20 Sep 2011 at 6:19

Dot character in resource name is not processed

The following fragment is from Financisto's (personal budget tracker) 
styles.xml:

    <style name="TextAppearance.PositiveAmount">
        <item name="android:textColor">#39b54a</item>
    </style>

It's reported as being unused:

style     : TextAppearance_PositiveAmount
    ..\res\values\styles.xml

However, it is used in the code as: R.style.TextAppearance_PositiveAmount

So, probably, need to deal with dot-to-underscore conversion.

Original issue reported on code.google.com by [email protected] on 15 May 2012 at 10:45

attrs in own namespace

I have my own attrs for custom View-Elements defined in attrs.xml, these are 
marked as unused but are clearly used in more than 10 xml-layout-files


What steps will reproduce the problem?


1. create a attrs.xml with following content:

<?xml version="1.0" encoding="utf-8" ?>
<resources>
    <declare-styleable name="CustomView">
        <attr name="useLightTheme" format="boolean" />
    </declare-styleable>
</resources>

2. now create a custom view-class which inherits e.g. from class View.

3. create a layout-file, using the custom view like this:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
xmlns:mci="http://schemas.android.com/apk/res/com.company.project"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">
    <com.company.project.CumstomView
        android:id="@+id/myviewid"
        android:gravity="center"
        android:layout_height="wrap_content"
        android:layout_width="fill_parent"
        mci:useLightTheme="false" />
</LinearLayout>

What is the expected output? What do you see instead?

running the AndroidUnusedResources.jar should NOT show up my custom attributes, 
but it does...

attr      : useLightTheme



What version of the product are you using? On what operating system?

Android Unused Resources 1.0; Fedora 14

Original issue reported on code.google.com by [email protected] on 25 May 2011 at 3:57

Does not look in all source directories

What steps will reproduce the problem?
1. Create a project with multiple source directories
2. Reference a resource only in the additional directory
3. Run the app

What is the expected output? What do you see instead?
Should see no unused resources, but we see an unused resource.


Original issue reported on code.google.com by vinblau on 2 Dec 2010 at 10:04

Style file and Manifest.

Hi,

I have the following style in my style.xml file:
<style name="Theme.NoTitleBar.NoBackground" parent="android:Theme.NoTitleBar">
  <item name="android:windowBackground">@null</item>
</style>

And some activities in the Manifest.xml file like:

<activity android:name="net.eridem.myapp.MyActivity" 
android:theme="@style/Theme.NoTitleBar.NoBackground" 
android:screenOrientation="portrait"></activity>

And the script shows 
style     : Theme_NoTitleBar_NoBackground
as unused resource (but it is used) ;)

Hope this information is useful.
Very good APP!!
Miguel.

Original issue reported on code.google.com by eridem on 7 Jun 2011 at 10:24

Does not take into consideration id references inside layouts (i.e. RelativeLayout)

What steps will reproduce the problem?
1. Run the tool
2. Find an id that is used to place views relative to it inside a RelativeLayout
3. Delete the id.

What is the expected output? What do you see instead?
There are no errors when running the application, it just messes up the UI.

What version of the product are you using? On what operating system?
Current latest:1.4.1

Please provide any additional information below.

I created a tool that automatically deletes the resources that have been found. 
Once it deletes all the "unused" ids, the relative layouts whose views ids have 
been deleted, is really messed up. That's how I figured out that dependencies 
for ids inside the same file and not being checked.


Original issue reported on code.google.com by [email protected] on 24 Nov 2011 at 8:05

Does not allow underscores in package names

If you use a package name that has underscores in it, the app is unable to find 
the package name in the manifest file. This should be a relatively simple 
modification of the regex pattern used to parse out the package name.

Original issue reported on code.google.com by [email protected] on 6 Nov 2011 at 11:48

doesn't run when you put it under root

What steps will reproduce the problem?
1.compile the source
2.run the command
3.doesn't work

What is the expected output? What do you see instead?
anything

What version of the product are you using? On what operating system?
r28

Please provide any additional information below.
running this on a mac
java -jar cleanfile.jar 
Failed to load Main-Class manifest attribute from
cleanfile.jar


Original issue reported on code.google.com by [email protected] on 25 Aug 2011 at 7:11

It hits resorces despite exsiting in code

    The tool"android-unused-resources" notes some resorce names despite they are used in code that
        TextView#setText(Html.fromHtml("<imf src=\"foo.png\"....
    The tool notes that "foo.png is not used." but it is not right.
    ---
    And forgive my English why I'm a Japanese. ;)

Original issue reported on code.google.com by [email protected] on 20 Dec 2012 at 7:07

storage is full,how to delete unused files?

What steps will reproduce the problem?
1.
2.
3.

What is the expected output? What do you see instead?


What version of the product are you using? On what operating system?


Please provide any additional information below.


Original issue reported on code.google.com by [email protected] on 28 Nov 2013 at 8:32

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.