build.gradle

gradle compileJava error: package org.junit does not exist

☆樱花仙子☆ 提交于 2019-12-19 05:06:11
问题 I'm trying to implement a simple junit test using gradle and running into the following issue when I run gradle test : :compileJava /Users/wogsland/Projects/gradling/src/test/CalculatorTest.java:1: error: package org.junit does not exist import static org.junit.Assert.assertEquals; ^ /Users/wogsland/Projects/gradling/src/test/CalculatorTest.java:1: error: static import only from classes and interfaces import static org.junit.Assert.assertEquals; ^ /Users/wogsland/Projects/gradling/src/test

Import app compat dependency in all libraries

狂风中的少年 提交于 2019-12-19 04:53:27
问题 I have 2 modules in my application, I want to modify both of them to use AppCompat Widgets for which I have to extend them with same. The problem is that I do not want to add appcompat dependency to each of them, So how could I possibly add Dependency to both modules and my app. If I do add compile 'com.android.support:appcompat-v7:23.1.1' to every module, would it affect the application size? 回答1: Using compile 'com.android.support:appcompat-v7:23.1.1' in every module doesn't mean to add it

Android Studio : UNEXPECTED TOP-LEVEL EXCEPTION:

﹥>﹥吖頭↗ 提交于 2019-12-19 04:46:52
问题 How Can I solve this error Error:Execution failed for task ':app:dexDebug'. com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Library/Java/JavaVirtualMachines/jdk1.7.0_67.jdk/Contents/Home/bin/java'' finished with non-zero exit value 2 App Build.gradle apply plugin: 'com.android.application' android { compileSdkVersion 22 buildToolsVersion "22.0.1" packagingOptions { exclude 'META-INF/DEPENDENCIES' exclude 'META-INF/ASL2.0' exclude

Android Studio : UNEXPECTED TOP-LEVEL EXCEPTION:

£可爱£侵袭症+ 提交于 2019-12-19 04:46:00
问题 How Can I solve this error Error:Execution failed for task ':app:dexDebug'. com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Library/Java/JavaVirtualMachines/jdk1.7.0_67.jdk/Contents/Home/bin/java'' finished with non-zero exit value 2 App Build.gradle apply plugin: 'com.android.application' android { compileSdkVersion 22 buildToolsVersion "22.0.1" packagingOptions { exclude 'META-INF/DEPENDENCIES' exclude 'META-INF/ASL2.0' exclude

How to make Android Studio 1.1 call generateDebugTestSources instead of assembleDebugTest during “Make” instruction?

怎甘沉沦 提交于 2019-12-19 04:11:05
问题 I have a project with 1,000+ tests running fine with Robolectric. After switching to Android Studio 1.1 when I go to "Run" -> "All Tests" during the "Make" instruction Android Studio calls Gradle's assembleDebugTest instead of generateDebugTestSources .. In my case this makes the build system to start dexing and packaging the test APK which is useless for me since all the tests are JVM tests. I found this change that might be causing it: - if (testCompileType == TestCompileType.ANDROID_TESTS)

How to build a runnable ShadowJar with a gradle script Kotlin build file?

陌路散爱 提交于 2019-12-18 22:20:24
问题 Simplest possible Kotlin hello world for gradle script Kotlin: thufir@dur:~/github/gradleScriptKotlin$ thufir@dur:~/github/gradleScriptKotlin$ gradle clean shadowJar;java -jar build/libs/gradleScriptKotlin.jar > Task :compileKotlin Using Kotlin incremental compilation > Task :shadowJar A problem was found with the configuration of task ':shadowJar'. Registering invalid inputs and outputs via TaskInputs and TaskOutputs methods has been deprecated and is scheduled to be removed in Gradle 5.0. -

Could not find com.android.tools.build:gradle:5.6

穿精又带淫゛_ 提交于 2019-12-18 18:07:21
问题 I have a problem with my gradle, i have try many solution that i have found on stackoverflow and other documentation but it still doesn't work, please help me 回答1: Don't confuse gradle with the Android Gradle plugin. classpath 'com.android.tools.build:gradle:5.6' It is the Android Gradle plugin and 5.6 doesn't exist . Use the latest stable release: classpath 'com.android.tools.build:gradle:3.5.0' Check the release notes for other versions. To change the gradle version, edit the file gradle

how to change android app name in the build gradle file

萝らか妹 提交于 2019-12-18 17:16:29
问题 I'm creating different flavors using gradle for 2 small android apps ,i wanna just know if i can edit app name on the xml file in the build.gradle , for my different flavors . 回答1: What do you mean by app name ? the application package name in the manifest or the application name as it appears in the launcher? If the former, do: android { productFlavors { flavor1 { packageName 'com.example.flavor1' } flavor2 { packageName 'com.example.flavor2' } } } It's possible to override the app name as

com.android.dex.DexException: Multiple dex files define Landroid/support/annotation/AnimRes;

ぃ、小莉子 提交于 2019-12-18 16:58:26
问题 Hello I am working on a project for which I am using Android Studio. I have setup everything but when I run my project then I get below errors. I could not resolve it for last 2 days. What could be the problem in my project that causing this error Please help if anyone know about this. app build.gradle apply plugin: 'com.android.application' android { compileSdkVersion 22 buildToolsVersion "21.1.2" defaultConfig { applicationId "in.xyz" minSdkVersion 15 targetSdkVersion 22 versionCode 1

Failed to generate apk from Android studio 3.1.1

依然范特西╮ 提交于 2019-12-18 13:01:09
问题 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 :