FBI Warning: Welcome reprint, but please indicate source: http://blog.csdn.net/codezjx/article/details/38669939 , not for commercial use without my permission, thank you for your support!
Sorted out some of the common problems encountered during this time. I hope to help you apes.
。 If you think it's practical, it's a good one.
Question one:
Error: (9) Attribute [email protected] value= (@drawable/logo) from Androidmanifest.xml:26:9
Error: (28, 9) Attribute [email protected] value= (@style/themeactionbar) from Androidmanifest.xml:28:9
is also present at Xxxx-trunk:xxxxlib:unspecified:15:9 value= (@style/apptheme)
Suggestion:add ' tools:replace= ' android:theme ' to <application> element @ androidmanifest.xml:24:5 to override
Error:execution failed for task ': Xxxx:processdebugmanifest '.
> Manifest merger failed with multiple errors, see logs
Reason:
The Gradle plugin for as will enable the manifest merger Tool by default, if the same properties as the master project are defined in the library project (such as the default generated Android:icon and Android:theme). The merge fails at this time, and the above error is reported.
There are 2 ways to solve the problem:
Method 1: add tools:replace= "Android:icon, Android:theme" under the application tag of the manifest.xml (multiple attributes are separated, And remember to add xmlns:tools= "Http://schemas.android.com/tools" to the manifest root tag, otherwise you will not find namespace OH)
Method 2: add Useoldmanifestmerger True on the Build.gradle root label (lazy method)
About the interviewer:
Http://tools.android.com/tech-docs/new-build-system/user-guide/manifest-merger
Question two:
The Buildconfig.debug in the Library project is always false.
This is a known issue with Android Studio, said a Google siege Lion. The Library projects will only generate release packages right now.
Issue 52962:https://code.google.com/p/android/issues/detail?id=52962
Workaround:(the method recommended by a Google Siege Lion)
Workaround:instaed of Buildconfig.debug Create another Boolean variable at Lib-project ' s e.g. Buildconfig.release and Lin K it with application ' s buildtype.
Https://gist.github.com/almozavr/d59e770d2a6386061fcb
Refer to this post on StackOverflow :
Http://stackoverflow.com/questions/20176284/buildconfig-debug-always-false-when-building-library-projects-with-gradle
Question three:
Each time it is saved. Each line of extra space and tab will be actively deleted by themselves (such as the end, empty lines of extra space or tab)
In particular, every time you prepare to commit the Svn,review code, you have a sore egg that shows a bunch of unrelated changes. Look at the dizzy.
Workaround:
Settings->ide Settings->editor->other->strip trailing spaces on Save->none
Question four:
Compile time, quote: Failure [INSTALL_FAILED_OLDER_SDK].
It's usually the system's own initiative to help you set the compilesdkversion.
Workaround:
Change build.gradle under Compilesdkversion ' android-l ' to compilesdkversion 19 (or the SDK you already have on your computer)
Android Studio Usage Tips-FAQ Highlights