build.gradle

Gradle build null console object

家住魔仙堡 提交于 2019-12-17 10:38:16
问题 I'm trying to get my gradle builds to prompt at the console for a password using examples from stack overflow When I have a statment such as: def password = System.console().readLine("Enter keystore password ") When I run I get the error Cannot invoke method readLine() on null object It seems console is coming out as null . What I've read this requires java 6 which if I go to a command prompt and type java -version I'm running Java(TM) SE Runtime Environment (build 1.6.0_27-b07). This issue

What does transitive = true in Gradle exactly do (w.r.t. crashlytics)?

柔情痞子 提交于 2019-12-17 10:12:55
问题 What does Gradle transitive = true do exactly? It is not clear from the Gradle documentation. This is in the context of compile within build.gradle . In my case I'm depending Android's crashlytics. compile('com.crashlytics.sdk.android:crashlytics:2.2.2@aar') { transitive = true; } Several Gradle docs (here and here) imply that "transitive" defaults to true. Yet removing transitive = true results in transitive dependencies not being brought in (in particular KitGroup ). class file for io

Gradle warning: variant.getOutputFile() and variant.setOutputFile() are deprecated

狂风中的少年 提交于 2019-12-17 09:19:30
问题 I am using the following simplified configuration in an Android application project. android { compileSdkVersion 20 buildToolsVersion "20.0.0" defaultConfig { minSdkVersion 8 targetSdkVersion 20 versionCode 1 versionName "1.0.0" applicationVariants.all { variant -> def file = variant.outputFile def fileName = file.name.replace(".apk", "-" + versionName + ".apk") variant.outputFile = new File(file.parent, fileName) } } } Now that I updated the Gradle plug-in to v.0.13.0 and Gradle to v.2.1.

How to replace a string for a buildvariant with gradle in android studio?

非 Y 不嫁゛ 提交于 2019-12-17 08:48:33
问题 I have two flavors of my project: flavor1 -> packagename: com.example.flavor1 flavor2 -> packagename: com.example.flavor2 Now I want to build a buildvariant of flavor1 and flavor2. The only difference of the buildvariant is another packagename. My project uses MapFragments and has just one Manifest - so I put the the permission name of MAPS_RECEIVE in my string resource files of the respective flavors. The question is: how can I replace a string resource of a buildvariant? I tried the

Could not find method android() for arguments

瘦欲@ 提交于 2019-12-17 04:30:15
问题 I've been trying to import a project to Android Studio and this is where I am stuck, there is a similar question on Stack Overflow but it did not provide a solution to my particular error. This is my error log: C:\<some location>\build.gradle Error:(24, 1) A problem occurred evaluating root project '<project name>'. > Could not find method android() for arguments [build_4fli1jm76ubcnxesnhqnhie47$_run_closure3@6e71db85] on root project '<project name>'. Information:BUILD FAILED The Gradle sync

DexIndexOverflowException issue after updating to latest appcompat and support library

…衆ロ難τιáo~ 提交于 2019-12-16 20:13:38
问题 I'm using the below settings through gradle : compileSdkVersion 21 ANDROID_BUILD_MIN_SDK_VERSION=14 ANDROID_BUILD_TARGET_SDK_VERSION=21 ANDROID_BUILD_TOOLS_VERSION=21.0.2 ANDROID_BUILD_SDK_VERSION=21 I also have the following settings in my gradle file: compile 'com.android.support:support-annotations:21.0.0' compile 'com.android.support:appcompat-v7:21.0.0' compile 'com.android.support:support-v4:21.0.0' I always get the error UNEXPECTED TOP LEVEL EXCEPTION . But when I make the 21.0.0 to 20

Gradle project does not build when I add RoboBlender

半城伤御伤魂 提交于 2019-12-14 03:52:04
问题 I have added RoboGuice 3 dependency into my gradle build file it compiles and runs, however the application crashes because of NoClassDefFoundError: AnnotationDatabaseImpl. Did some research that suggested that RoboBlender was necessary to generate the definition (I'm familiar with RoboGuice 2 which does not require RoboBlender) but when I add RoboBlender the project no longer builds. dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) compile 'com.android.support:appcompat-v7:21

Could not find any version that matches com.google.android.gms:strict-version-matcher-plugin:[15.0.0, 16.0.0)

社会主义新天地 提交于 2019-12-14 03:47:07
问题 The project was working fine until two days ago when error occured abruptly. I am not sure how to solve it as I have done everything I can including reinstalling android studio and gradle. Could not resolve all files for configuration ':app:debugCompileClasspath'. Could not find any version that matches com.google.android.gms:strict-version->matcher-plugin:[15.0.0, 16.0.0). Versions that do not match: 1.1.0 1.0.3 1.0.2 1.0.1 1.0.0 Required by: project :app > com.google.gms:google-services:4.2

Dex error On Android Studio 3.0 Beta4

我与影子孤独终老i 提交于 2019-12-14 02:36:07
问题 Error:java.lang.RuntimeException: java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex Error:java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex Error:com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex Error:com.android.dex.DexException: Multiple dex files define Lcom/google/zxing/integration/android/IntentResult; 回答1: I have same problem with Android Studio 3.0 beta 4. I

How to fix gradle task ':app:mergeDebugJniLibFolders' in flutter gradle build for opencv native with NDK?

非 Y 不嫁゛ 提交于 2019-12-14 02:20:15
问题 I'm setting up a new flutter app and I want to add opencv native (c++) plugin using NDK. I've installed and configured OpenCV and NDK (using differents tutorials) and I got this error while I'm trying to build my project ( flutter run ): FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':app:mergeDebugJniLibFolders'. > java.lang.NullPointerException (no error message) * Try: Run with --stacktrace option to get the stack trace. Run with --info or -- debug