Friday, June 3, 2016

Android Studio important points


1. To Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
            File --> Other Settings --> Default settings --> Build, Execution, Deployment --> Compiler

            Command-line option takes -stacktrace option to get the stack trace.
            Run with --info or --debug option to get more log output.

2. Suggestion: add 'tools:replace="android:icon"' to <application> element in AndroidManifestAdd xmlns:tools="http://schemas.android.com/tools" to manifest tag and tools:replace="android:icon,android:theme,android:label" to application tag.

3. For the error unmappable character for encoding UTF-8.......... Add the following line to build.gradle
android {
 ...
compileOptions.encoding = 'ISO-8859-1'
 }

4. Add support library to Android Studio project

5. Open File -> Project Structure... menu.
6. Select Modules in the left pane, choose your project's main module in the middle pane and openDependencies tab in the right pane.
7. Click the plus sign in the right panel and select "Maven dependency" from the list. A Maven dependency dialog will pop up.
8. Enter "support-v4" into the search field and click the icon with magnifying glass.
9. Run the below command in terminal to detect which image file is causing the merge to fail. After running the command check for buildLog.txt file in Project window, search for Error which will point to the exact file causing the issue.
gradlew :app:mergeDebugResources --debug > buildLog.txt
10. All com.android.support libraries must use the exact same version specification
Solution : https://stackoverflow.com/a/42374426