Bug 8377 - Remove Android Lint warnings
Summary: Remove Android Lint warnings
Status: CONFIRMED
Alias: None
Product: Android
Classification: Xamarin
Component: MSBuild ()
Version: 4.5.x
Hardware: PC Mac OS
: Low normal
Target Milestone: ---
Assignee: Bugzilla
URL:
: 17963 ()
Depends on:
Blocks:
 
Reported: 2012-11-13 16:16 UTC by Jonathan Pryor
Modified: 2017-06-28 19:59 UTC (History)
6 users (show)

Tags: bb clb
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report for Bug 8377 on Developer Community or GitHub if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: Developer Community HTML or GitHub Markdown
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:
Status:
CONFIRMED

Description Jonathan Pryor 2012-11-13 16:16:28 UTC
The Android Lint program reports a number of warnings on Mono for Android-generated projects.

http://tools.android.com/tips/lint
http://lists.ximian.com/pipermail/monodroid/2012-October/012572.html

You can run the Android lint program on the `obj/Debug` directory after creating a .apk to see what warnings are generated, including lots in the generated AndroidManifest.xml:

>	# for monodroid-samples/JetBoy
>	$ lint obj/Debug
>
>	Scanning android: .................................................................................................................................
>	Scanning android (Phase 2): 
>	android/AndroidManifest.xml:19: Warning: <uses-permission> tag appears after <application> tag [ManifestOrder]
>	  <uses-permission android:name="android.permission.INTERNET" />
>	  ^
>	android/AndroidManifest.xml:12: Warning: Exported receiver does not require permission [ExportedReceiver]
>	    <receiver android:name="mono.android.Seppuku">
>	    ^
>	android/AndroidManifest.xml:4: Warning: Avoid hardcoding the debug mode; leaving it out allows debug and release builds to automatically assign one [HardcodedDebugMode]
>	  <application android:name="mono.android.app.Application" android:debuggable="true">
>	                                                           ^
>	Warning: The resource R.drawable.asteroid01 appears to be unused [UnusedResources]
>	Warning: The resource R.drawable.asteroid02 appears to be unused [UnusedResources]
>	...
>	0 errors, 47 warnings 

Many of these are due to "improper" ordering of elements within AndroidManifest.xml (the ordering is documented somewhere?!), and the MSBuild tasks should reorder the AndroidManifest.xml elements accordingly so that warnings aren't generated.
Comment 1 Jonathan Pryor 2014-02-24 13:37:31 UTC
*** Bug 17963 has been marked as a duplicate of this bug. ***
Comment 2 Jeremy Kolb 2014-09-02 11:48:53 UTC
I've been running lint on my own code now and this would be nice to fix (it would also be nice if we could run this from within VS).