android-gradle-plugin

Compile jar with test classes

无人久伴 提交于 2021-02-11 10:06:17
问题 How can I compile jar with test classes in android? I am using android gradle plugin 1.3.1: classpath 'com.android.tools.build:gradle:1.3.1' I've tried: task testSourcesJar(type: Jar) { from android.sourceSets.test.java.srcDirs } And it creates exactly what is defined: a jar with test sources, not with compiled classes. Where are the compiled classess and on which task I should depend on to create jar with test classes? I need it to prepare test artifact for another project, which must extend

Gradle command line arguments to override properties in build.gradle

让人想犯罪 __ 提交于 2021-02-08 13:33:47
问题 Whenever an existing android project is imported, in most cases we need to change values following with our installed tools version number in project/build.gradle buildscript { ... dependencies { classpath 'com.android.tools.build:gradle:x.x.x' } } in project/app/build.gradle android { compileSdkVersion xx buildToolsVersion "xx.x.x" defaultConfig { applicationId "com.example.app.xyz" minSdkVersion xx targetSdkVersion xx versionCode x versionName "x.x" } ... } dependencies { compile fileTree

Gradle command line arguments to override properties in build.gradle

杀马特。学长 韩版系。学妹 提交于 2021-02-08 13:33:17
问题 Whenever an existing android project is imported, in most cases we need to change values following with our installed tools version number in project/build.gradle buildscript { ... dependencies { classpath 'com.android.tools.build:gradle:x.x.x' } } in project/app/build.gradle android { compileSdkVersion xx buildToolsVersion "xx.x.x" defaultConfig { applicationId "com.example.app.xyz" minSdkVersion xx targetSdkVersion xx versionCode x versionName "x.x" } ... } dependencies { compile fileTree

Android Studio doesn't show new Activity option

自古美人都是妖i 提交于 2021-02-08 08:58:23
问题 My android studio doesn't responding well. It does not show new Activity option. Even it does not display other option too . I Cleaned and rebuild the project . Even I restart Android studio several times too . Please Help me to solve this issue. 回答1: I ran into this same issue and tried numerous things that I found online but nothing worked. Then I just started trying out random things and when I ran "File -> Sync Project with Gradle files" it started working for me. I can now create

Error while launching activity in Android Studio

感情迁移 提交于 2021-02-08 05:57:36
问题 I am trying to make an Android Studio app that has more than one java file. However, when I was trying to run my app, it said: Error while executing: am start -n "com.example.company.appname/com.example.company.appname.Text" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.example.company.appname/.Text } Error type 3 Error: Activity class {com.example.company.appname/com.example

Error while launching activity in Android Studio

爷,独闯天下 提交于 2021-02-08 05:56:05
问题 I am trying to make an Android Studio app that has more than one java file. However, when I was trying to run my app, it said: Error while executing: am start -n "com.example.company.appname/com.example.company.appname.Text" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.example.company.appname/.Text } Error type 3 Error: Activity class {com.example.company.appname/com.example

Espresso-android jar - 'Error in opening zip file' in android studio 8.x

限于喜欢 提交于 2021-02-08 05:54:25
问题 I've been getting this error, I've tried the solution stated here: Android studio - Failed to complete gradle execution - error in opening zip file This error is killing me, I've tried removing the .gradle folder. I've noticed that the .idea\libraries folder has a bunch of xml's in it and I've tried deleting that (thinking its storing something wrong) and that wasn't it either. I've narrowed it down to the jars downloaded from the espresso-android site, espresso-1.1.jar and the test runners -

Could not find method compile()

故事扮演 提交于 2021-02-08 03:41:27
问题 I want to add a lib in android studio but it is not working. Here is a screenshot I also tried to add a dependency in the gradle.build but that also does not work. Maybe it is because I am behind a proxy ? 回答1: You are using the wrong build.gradle file. You can't use compile in the top-level file. Use the module/build.gradle . <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

Set Android.mk flag through Gradle depending on build type

故事扮演 提交于 2021-02-07 20:01:25
问题 I need to set a flag inside Android.mk file which tells to the C code whether it's debug mode or not. LOCAL_MODULE := auth LOCAL_SRC_FILES := auth.c LOCAL_CFLAGS := -DDEBUG_MODE=0 LOCAL_EXPORT_CFLAGS := $(LOCAL_CFLAGS) LOCAL_LDLIBS := -llog LOCAL_C_INCLUDES := auth.h include $(BUILD_SHARED_LIBRARY) The problem is that I often forget to change the value when building a release and viceversa so I'm looking forward to a way that does it automatically. I tried changing Android.mk to: LOCAL_CFLAGS

Android Studio - Gradle generate specific javadoc files

不想你离开。 提交于 2021-02-07 13:36:45
问题 I need to generate some javadoc for a project that contains 3 modules, and I only need specific files from each module. In Android Studio I can go Tools -> Generate JavaDoc and then set custom scope, and selectively choose the files I want and it aggregates them into a single javadoc folder, but this won't work for our automated build. I can't figure out how to do this on the gradle command line? Every example is some variation of this task task javadoc(type: Javadoc) { source = android