Answer the question
In order to leave comments, you need to log in
How to slightly change the project template in AndroidStudio?
Good afternoon. I am gaining experience in startandroid lessons and simplifying my life a little with the help of butter knife. Tell me how to change the build.gradle of a standard project and add a dependency there so that butter knife is automatically connected when creating a new project?
Answer the question
In order to leave comments, you need to log in
Your question prompted me to figure it out :)
I found two options to choose from. Open the file with a text editor, add the dependency and save separately. Then you replace.
1. Add dependency to
<recipe>
<dependency mavenUrl="com.jakewharton:butterknife:6.1.0"/>
<#if appCompat><dependency mavenUrl="com.android.support:appcompat-v7:${targetApi}.+"/></#if>
...
</recipe>
dependencies {
<#if dependencyList?? >
<#list dependencyList as dependency>
compile '${dependency}'
</#list>
</#if>
compile fileTree(dir: 'libs', include: ['*.jar'])
<#if WearprojectName?has_content && NumberOfEnabledFormFactors?has_content && NumberOfEnabledFormFactors gt 1 && Wearincluded>
wearApp project(':${WearprojectName}')
compile 'com.google.android.gms:play-services:+'
</#if>
compile 'com.jakewharton:butterknife:6.1.0'
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question