build.gradle

embed crosswalk in android studio

六眼飞鱼酱① 提交于 2019-11-26 13:20:54
问题 I'm new about android programming and android studio. I researched crosswalk embed API for my project and tried to embed it in android studio. But I couldn't be succesfull. Even I don't know exactly how can embed an API that has gradle file or not. Maybe there is a problem with gradle system? In brief, how can I embed crosswalk-webview to my project with android studio step by step? Thanks a lot you. 回答1: Following: https://diego.org/2015/01/07/embedding-crosswalk-in-android-studio/ Open

Android tests build error: Multiple dex files define Landroid/support/test/BuildConfig

Deadly 提交于 2019-11-26 13:04:17
问题 I\'m trying to add Espresso 2 to my project (which also has lots of other dependencies), but I\'m hitting this error when trying to run tests: UNEXPECTED TOP-LEVEL EXCEPTION: com.android.dex.DexException: Multiple dex files define Landroid/support/test/BuildConfig; at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:596) at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:554) at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:535) ... The non-test

Android dependency has different version for the compile and runtime

五迷三道 提交于 2019-11-26 12:53:54
After updating Android Studio from Canary 3 to Canary 4 , the following error is thrown at the build time. Android dependency 'com.android.support:support-support-v4' has different version for the compile (25.2.0) and runtime (26.0.0-beta2) classpath. You should manually set the same version via DependencyResolution. I ran a complete search throughout the project and the version 25.1.0 is no where used. App-build.gradle android { compileSdkVersion 26 buildToolsVersion '26.0.0' defaultConfig { applicationId "com.xxx.xxxx" minSdkVersion 14 targetSdkVersion versionCode 1 versionName "1.0"

Copy existing project with a new name in Android Studio

柔情痞子 提交于 2019-11-26 12:52:47
问题 I would like to copy my Android project and create a new project from the same files just with a different name. The purpose of this is so I can have a second version of my app which is ad supported in the app store. I found this answer here: Android - copy existing project with a new name But it\'s for Eclipse. How can I do this in Android Studio? 回答1: The steps in the link you specified should also work for Android Studio. Just make a copy (using a file manager) of the entire module folder

How/when to generate Gradle wrapper files?

岁酱吖の 提交于 2019-11-26 12:41:47
I am trying to understand how the Gradle Wrapper works. In many source repos, I see the following structure: projectRoot/ src/ build.gradle gradle.properties settings.gradle gradlew gradlew.bat gradle/ wrapper/ gradle-wrapper.jar gradle-wrapper.properties My questions: How/when does one generate gradlew / gradlew.bat ? Are you supposed to generate them only one time when the project is first created, do you generate them every time you commit/push changes? And how are they generated? Same question above, but for the gradle/wrapper/* files ( gradle-wrapper.jar and gradle-wrapper.properties )?

java.lang.NullPointerException (no error message)

白昼怎懂夜的黑 提交于 2019-11-26 12:38:58
问题 I know that this question of mine has been asked many times and I did follow most of the answers but none of those helped me. So this is my problem, whenever I sync my project it always fails. Here is how the gradle console look like: Executing tasks: [:app:generateDebugSources, :app:generateDebugAndroidTestSources, :app:mockableAndroidJar, :app:prepareDebugUnitTestDependencies] Configuration on demand is an incubating feature. Incremental java compilation is an incubating feature. :app

Conflict with dependency 'com.android.support:support-annotations'. Resolved versions for app (23.1.0) and test app (23.0.1) differ

大憨熊 提交于 2019-11-26 12:20:55
问题 When building I get the following error: Conflict with dependency \'com.android.support:support-annotations\'. Resolved versions for app (23.1.0) and test app (23.0.1) differ. These are my gradle dependencies dependencies { compile fileTree(include: [\'*.jar\'], dir: \'libs\') compile \'com.android.support:support-v4:23.1.0\' compile \'com.android.support:appcompat-v7:23.1.0\' compile \'com.android.support:design:23.1.0\' compile \'com.android.support:cardview-v7:23.1.0\' compile \'com

Execution failed for task ':app:compileDebugAidl': aidl is missing

时间秒杀一切 提交于 2019-11-26 12:19:03
I installed Android Studio on my computer. I created a new project but that got me the error below. What can I do? Error:Execution failed for task ':app:compileDebugAidl'. > aidl is missing My Android Studio version is 1.1.0 . This is my build.gradle file: buildscript { repositories { jcenter() } dependencies { classpath 'com.android.tools.build:gradle:1.1.0' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } } allprojects { repositories { jcenter() } } And : apply plugin: 'com.android.application' android { compileSdkVersion

Why are there two build.gradle files in an Android Studio project?

China☆狼群 提交于 2019-11-26 12:14:21
After having imported an Eclipse project into Android Studio, I see two build.gradle files: 1 - <PROJECT_ROOT>\build.gradle 2 - <PROJECT_ROOT>\app\build.gradle The first version is shorter, the second version contains definitions for compileSdkVersion , etc. What is the purpose behind having two separate files? Are there separate build tasks? Gabriele Mariotti <PROJECT_ROOT>\app\build.gradle is specific for app module . <PROJECT_ROOT>\build.gradle is a "Top-level build file" where you can add configuration options common to all sub-projects/modules. If you use another module in your project,

Android build gradle is too slow (Dependency Resolution)

泄露秘密 提交于 2019-11-26 12:08:23
问题 I\'ve been working with Android Studio (my current version 1.5) for 2 years. Everything was OK, but when I downloaded Canary (2.1 p5), everything went wrong. Every time I want to create a new project or open a project or sync or import a new lib or dependency, gradle is taking too long to build — nearly 20 min . I did not do anything, I just downloaded the Canary version and ran it. Symptoms : It happened when I connected to Internet The first delay is on Gradle: Resolve dependencies \':app: