android-gradle

Using buildToolsVersion 23 fails because Multiple dex files define 'AnimRes'

送分小仙女□ 提交于 2019-11-30 11:32:14
Before you claim DUPLICATE please read the question. This only occurs with the latest version of the build tools. Older versions do not display this problem. I've already tried the solutions offered on other questions here for multiple definitions of @AnimRes . None have helped so far, which is why I posted a new question. Same symptoms, different cause, different solution. I can build without problem when using buildToolsVersion 22.0.1 , but when I switch to buildToolsVersion 23 the build fails with error UNEXPECTED TOP-LEVEL EXCEPTION: com.android.dex.DexException: Multiple dex files define

Android Studio: Error Code 1: Gradle: Execution failed for task ':app:processDebugResources'

孤街浪徒 提交于 2019-11-30 11:32:05
I want to compile a project, I got Error:Gradle: Execution failed for task ':app:processDebugResources'. here is the exception: Error:Gradle: Execution failed for task ':app:processDebugResources'. com.android.ide.common.internal.LoggedErrorException: Failed to run command: D:\devtools\adt\sdk\build-tools\21.1.1\aapt.exe package -f --no-crunch -I D:\devtools\adt\sdk\platforms\android-21\android.jar -M E:\code\android\TVMediaPlayer\app\build\manifests\debug\AndroidManifest.xml -S E:\code\android\TVMediaPlayer\app\build\res\all\debug -A E:\code\android\TVMediaPlayer\app\build\assets\debug -m -J

React-Native Android - Could not find com.android.tools:common

橙三吉。 提交于 2019-11-30 11:18:25
It seems that somehow the android/tools/common library has been deleted ( pom , jar ). This caused many react native libraries that are using an old gradle version in their classpath (e.g com.android.tools.build:gradle:2.2.3 ) to not being able to sync How can i fix it? Update , I had to add more code to build.gradle This is my fix, I did not fork repos just used this workaround: add this to your build.gradle file, the sibling of settings.gradle file buildscript { repositories { google() jcenter { url "http://jcenter.bintray.com/"} maven { url "https://dl.bintray.com/android/android-tools" } }

org.gradle.execution.MultipleBuildFailures: Build completed with 1 failures [closed]

与世无争的帅哥 提交于 2019-11-30 11:11:04
After updating Andriod Studio to 3.3v I am getting following error: I have updated all the gradle dependencies. Are there any solutions to this? I solved this problem by disabling instant run. I had a similar problem, when I added a ButterKnife library: implementation 'com.jakewharton:butterknife:10.0.0' annotationProcessor 'com.jakewharton:butterknife-compiler:10.0.0' But, then I notice that version did not work very well and changed it by (GRADLE): implementation 'com.jakewharton:butterknife:8.4.0' annotationProcessor 'com.jakewharton:butterknife-compiler:8.4.0' Maybe you need to check the

How to switch/change testInstrumentationRunner dynamically with gradle

帅比萌擦擦* 提交于 2019-11-30 11:05:05
My project has 2 different groups of tests. One group runs only with the default AndroidJUnitRunner the other has to be run with a custom implementation TestRunner extends MonitoringInstrumentation . Currently I switch the testInstrumentationRunner by editing the build.gradle each time I need to run the other group of tests: android{ defaultConfig { //testInstrumentationRunner "my.custom.TestRunner" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } } I know that flavours can have their own testInstrumentationRunner but my current app already has 2 flavourDimensions .

Dagger 2 and android Studio: working but can't see generated classes

梦想的初衷 提交于 2019-11-30 10:57:55
I'm trying to use Dagger 2 in an Android Studio Project. I've used the CoffeeMaker example. I've managed to make the app build and working however: - I don't success in seeing the generated code. - If I debug, I can't see it neither. - Moreover DaggerCoffeeApp_Coffee as marked as reed (Cannot resolve symbol) My gradle files are: // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { repositories { jcenter() } dependencies { classpath 'com.android.tools.build:gradle:1.1.3' // NOTE: Do not place your application dependencies here; they

Proper way to use System environment variables in gradle using Android Studio

雨燕双飞 提交于 2019-11-30 10:55:50
I am using Android Studio to build my project on an Ubuntu 14.04 system. I wrote the following in my build.gradle files to avoid hardcoding storeFile, storePassword, keyAlias and keyPassword in my git repo: signingConfigs { debug { storeFile file(System.getenv("KEYSTORE")) storePassword System.getenv("KEYSTORE_PASSWORD") keyAlias System.getenv("KEY_ALIAS") keyPassword System.getenv("KEY_PASSWORD") } But gradle sync errors out with the following: Error:(49, 0) Neither path nor baseDir may be null or empty string. path='null' basedir='./pathto/TMessagesProj' My .bashrc contains: source ~/

Gradle issue in flutter when using firebase

左心房为你撑大大i 提交于 2019-11-30 10:39:56
In my flutter application i am using firebase_auth for google_sign_in and it is working fine. But when i add cloud_firestore: to pubspec.yaml then get dependencies and then restart my app it show me an error like this: FAILURE: Build failed with an exception. * What went wrong: The library com.google.android.gms:play-services-base is being requested by various other libraries at [[15.0.1,15.0.1]], but resolves to 16.0.1. Disable the plugin and check your dependencies tree using ./gradlew :app:dependencies. * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug

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

Android Studio “error: failed to read metadata” after update to 3.0.0

巧了我就是萌 提交于 2019-11-30 09:58:55
I've updated Android Studio to v3.0.0 and now I cant build my project. Android Studio add .flat to resources file names on build and the build crash because it can't recognize the .flat extension. I've tried to clean the project and rebuild it but I still get this error. I don't have any idea of what could cause this. I hope someone can help me solve my problem cause since Studio can't do a successful build, it can't find my dependencies and I can't work. Gradle Console Output Executing tasks: [clean, :TP2A:assembleDebug, :TP2B:assembleDebug] Configuration on demand is an incubating feature.