build.gradle

How to add custom dependencies automatically in android for ever a new project is created?

流过昼夜 提交于 2019-11-30 10:10:18
I use these libraries usually, I want a way to include them in any new project I create. compile 'com.android.support:recyclerview-v7:25.1.1' compile 'com.squareup.picasso:picasso:2.5.2' compile 'com.jakewharton:butterknife:8.5.1' apt 'com.jakewharton:butterknife-compiler:8.5.0' compile 'com.squareup.okhttp3:okhttp:3.6.0' compile 'com.facebook.stetho:stetho-okhttp3:1.4.2' What should I do? Kiran Benny Joseph You can find your App level (In which you can add your dependencies as shown below) Gradle template Go to android-studio-path\plugins\android\lib\templates\eclipse\projects

Gradle version 1.10 is required. Current version is 2.2.1. in android

可紊 提交于 2019-11-30 09:38:17
I had an Android project built with Android Studio and trying to import and run it on my Android Studio but facing the below error when trying to Sync the project Failed to sync Gradle project 'project-android' Error:Gradle version 1.10 is required. Current version is 2.2.1. If using the gradle wrapper, try editing the distributionUrl in /Users/username/apps/android/project-android/gradle/wrapper/gradle-wrapper.properties to gradle-1.10-all.zip. Please fix the project's Gradle settings in Gradle settings gradle-wrapper.properties distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists

No resource found Errors for support:appcompat-v7:22.0.0 on Android Studio

泄露秘密 提交于 2019-11-30 09:16:20
问题 Am trying to add the Design support Library following this guidelines https://github.com/codepath/android_guides/wiki/Design-Support-Library and i'm having issues. dependencies { compile 'com.android.support:appcompat-v7:22.2.0' } Trying to add this and Its giving me lots of XML errors when building. Error:(24, 63) No resource found that matches the given name (at 'drawable' with value '@drawable/abc_textfield_default_mtrl_alpha'). Error:(25, 93) No resource found that matches the given name

Error:Could not find com.android.tools.build:gradle:3.3. Issue raise after upgrading gradle version for splunk:mint-android-sdk

坚强是说给别人听的谎言 提交于 2019-11-30 09:02:19
My App was working fine, then i add com.splunk:mint-android-sdk, which required upper version of gradle, so i upgrade the gradle to from 2.1 to 3.3. after that i am facing issues. Please review my gradle file and help me out and please guide me how it work.( This is my first app but i want sure make its should be working fine in all scenario ) Error:Could not find com.android.tools.build:gradle:3.3. Searched in the following locations: file:/C:/Program Files/Android/Android Studio/gradle/m2repository/com/android/tools/build/gradle/3.3/gradle-3.3.pom file:/C:/Program Files/Android/Android

Failed to generate apk from Android studio 3.1.1

三世轮回 提交于 2019-11-30 08:36:34
When I try to generate a signed APK, I found this issue : 10:58 Generate Signed APK: Errors while building APK. You can find the errors in the 'Messages' view. No cached version of com.android.tools.lint:lint-gradle:26.1.1 available for offline mode. this is my android studio details : Android Studio 3.1.1 Build #AI-173.4697961, built on April 4, 2018 JRE: 1.8.0_152-release-1024-b02 amd64 JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o Windows 10 10.0 this block for signing the apk : buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'),

implementation 'com.android.support:appcompat-v7:28.0.0'

末鹿安然 提交于 2019-11-30 08:24:53
I am moving my first steps with app programming. I searched the other topics that relate to this matter and tried all the solutions but still it's driving me mad: building on Android Studio I cannot make it through this error about implementation 'com.android.support:appcompat-v7:28.0.0' : All com.android.support libraries must use the exact same version specification (mixing versions can lead to runtime crashes). Found versions 28.0.0 , 26.1.0 . Examples include com.android.support:animated-vector-drawable:28.0.0 and com.android.support:support-v4:26.1.0 There are some combinations of

Execution failed for task ':app:packageDebug' - Failed to read zip file

我与影子孤独终老i 提交于 2019-11-30 08:21:06
Without any changes in my code, suddenly i get this error when I try to run my app: What went wrong: Execution failed for task ':app:packageDebug'. com.android.builder.packaging.PackagerException: java.io.IOException: Failed to read zip file 'C:\Users\Eliran\AndroidStudioProjects\Forum\app\build\outputs\apk\app-debug.apk'. I have no idea why its trying to read the apk as zip file. If I restart Android Studio, I can run the app once and then It happens again. For me it helps (for now) when I Exit Android Studio , next I used Windows Task Manager (Ctrl + Shift + Esc) and kill process Java(TM)

Is there a max value for versioncode?

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-30 08:04:35
We always have to increment versionCode by some arbitary number to publish it to google play. Is there limit to that value and what will happen if it is reached? defaultConfig { applicationId "my.app" minSdkVersion 15 targetSdkVersion 22 versionCode 65 versionName "1.05" setProperty("archivesBaseName", "myapp-$versionCode") } Update 08/11/2016 (UTC): The docs has been updated. Not the old MAX_INT value nor the 2000000000. Warning: The greatest value Google Play allows for versionCode is 2100000000 . Cross-post for visibility here. It seems there was a recent change in Google, making the

How can I check which Gradle Android plugin version is used in my project?

孤街浪徒 提交于 2019-11-30 07:56:58
问题 In my build.gradle file I set the following dependency: dependencies { classpath 'com.android.tools.build:gradle:0.5.+' } This will automatically adapt to the latest released version (like it's described here). How can I check wich current release is used in my project? EDIT 2013-08-08: buildscript { repositories { mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:0.5.+' } } 回答1: Showing the resolved dependencies for the build script class path isn't a built-in

Change generated apk name from “app-debug.apk”

强颜欢笑 提交于 2019-11-30 07:51:12
问题 Every time I run a project with Android Studio (1.02) it's generate an unsigned apk which located in ..\build\outputs\apk folder and get by default the name "app-debug.apk" I want to change that default name to something else. Is it possible? How? 回答1: You can use applicationVariants and change the output file in the build.gradle. You can also modify the name regarding to your needs. buildTypes{ applicationVariants.all { variant -> variant.outputs.each { output -> output.outputFile = file("