android-gradle

Could not find method android() for arguments when building Android project from gradle

白昼怎懂夜的黑 提交于 2019-11-28 04:56:32
I have an gradle-based Android project with 4 submodules - two libraries and two applications. I was trying to simplify the build.gradle files of each submodule by moving some of of the shared code/configurations to the top level build.gradle file and use subprojects {} to make that code available to each submodule. The file system structure looks like this: Root |- App1/ |- App2/ |- Lib1/ |- Lib2/ |- build.gradle |- settings.gradle The problem is that if I add an android {} section to the subprojects then gradle tasks fail. For example, this is my top-level build.gradle file: subprojects {

Cannot change dependencies of configuration (after enabling instant run)

£可爱£侵袭症+ 提交于 2019-11-28 04:50:15
I just enabled instant run in my android studio project. (Followed the instructions here ) My project contains git submodules and somehow these do not compile anymore. This is the error i get: Error:(8, 0) Cannot change dependencies of configuration ':libraries:my_library:classpath' after it has been resolved. Any idea what could be wrong there ? Top level build.gradle: buildscript { repositories { mavenCentral() jcenter() maven { url 'https://maven.fabric.io/public' } } dependencies { classpath 'com.android.tools.build:gradle:2.0.0-alpha1' classpath 'com.novoda:bintray-release:0.2.7'

Crashlytics found an invalid API key

橙三吉。 提交于 2019-11-28 04:41:43
When I am trying to build project with value of meta-data tag as a string reference, crashlytics fail with following error: Crashlytics found an invalid API key: @string/crashlytics. Check the Crashlytics plugin to make sure that the application has been added successfully! Contact support@crashlytics.com for assistance. Doesn't work <meta-data android:name="com.crashlytics.ApiKey" android:value="@string/crashlytics"/> Works <meta-data android:name="com.crashlytics.ApiKey" android:value="1234567890..."/> I am want to define different keys inside string.xml for different productFlavors of my

What does “multiDexEnabled true” mean?

落花浮王杯 提交于 2019-11-28 04:29:04
What is meant by "multiDexEnabled true" in Android gradle. Why do we use this? What is the effect if it is enabled? Android application (APK) files contain executable bytecode files in the form of Dalvik Executable (DEX) files, which contain the compiled code used to run your app. The Dalvik Executable specification limits the total number of methods that can be referenced within a single DEX file to 65,536, including Android framework methods, library methods, and methods in your own code. Getting past this limit requires that you configure your app build process to generate more than one DEX

Android Studio Could not find method runProguard() for arguments?

末鹿安然 提交于 2019-11-28 04:27:23
/Library/Java/JavaVirtualMachines/jdk1.7.0_60.jdk/Contents/Home/bin/java "- com.intellij.rt.execution.application.AppMain org.gradle.launcher.GradleMain --build-file /Users/Tom/Documents/Git_open_sources/android-material-drawer-template/app/build.gradle FAILURE: Build failed with an exception. * Where: Build file '/Users/Tom/Documents/Git_open_sources/android-material-drawer-template/app/build.gradle' line: 16 * What went wrong: A problem occurred evaluating project ':app'. > Could not find method runProguard() for arguments [false] on BuildType_Decorated{name=release, debuggable=false,

Dynamically generating product flavors

南笙酒味 提交于 2019-11-28 04:25:09
I've created an Android App which needs to be build in many (30+) flavors. My idea was to generate the different productFlavors directly from the folder structure in my src directory, since the configuration is always very similar (basically just another packageName, a new launcher icon and some strings change). The src folder look like this: └── src ├── flavor1 │ ├── flavor2.keystore │ ├── res ├── flavor2 │ ├── res │ ├── flavor2.keystore └── main ├── AndroidManifest.xml ├── java └── res If I had to create the gradle properties by hand it would look somehow like this: android { ....

NoSuchFieldError: No static field MapAttrs of type when Using MapFragment with Play Services 6.5

倾然丶 夕夏残阳落幕 提交于 2019-11-28 04:21:41
Maybe I am missing something here, but I am not able to use the new Maps only dependency in Play Services 6.5 I get the following exception: java.lang.NoSuchFieldError: No static field MapAttrs of type [I in class Lcom/google/android/gms/R$styleable; or its superclasses (declaration of 'com.google.android.gms.R$styleable' appears in /data/app/com.kaching.merchant.dev1-1/base.apk) at com.google.android.gms.maps.GoogleMapOptions .createFromAttributes(Unknown Source) at com.google.android.gms.maps.SupportMapFragment .onInflate(Unknown Source) Manifest: <meta-data android:name="com.google.android

Android Studio 1.0 and error “Library projects cannot set applicationId”

不羁的心 提交于 2019-11-28 04:01:53
After updating Android Studio to 1.0, I see this error: Error: Library projects cannot set applicationId. applicationId is set to 'com.super.app' in default config. I updated the Gradle plugin as suggested but I did not understand how to fix this. Joel Based on this info : ApplicationId in Library Projects You cannot use applicationId to customize the package of a library project. The package name has to be fixed in library projects (and specified as packageName in the manifest). The Gradle plugin did not enforce this restriction earlier. Removing applicationId variable from the library's

Android Gradle Project upgrading build tools to 21.0.1: aapt throws Exception

孤街浪徒 提交于 2019-11-28 03:38:52
We have an android gradle project. Today I wanted to upgrade the android build tools version from 20 to 21.0.1, but now the aapt is failing. * What went wrong: Execution failed for task ':myproject-android:processDebugResources'. > com.android.ide.common.internal.LoggedErrorException: Failed to run command: c:\_DEVELOP\AndroidSDK\sdk\build-tools\21.0.1\aapt.exe package -f --no-crunch -I c:\_DEVELOP\AndroidSDK\sdk\platforms\android-16\android.jar -M D:\_MY_PROJECT\trunk\myproject_bin\gradle\build\re lease\myproject-android\intermediates\manifests\full\debug\AndroidManifest.xml -S D:\_MY_PROJECT

aarch64-linux-android-strip file Missing

这一生的挚爱 提交于 2019-11-28 03:38:35
I updated to Android studio 2.3 and my project got these errors Error:org.gradle.process.internal.ExecException: A problem occurred starting process 'command 'C:\Users\...\AppData\Local\Android\sdk\ndk-bundle\toolchains\aarch64-linux-android-4.9\prebuilt\windows-x86_64\bin\aarch64-linux-android-strip'' Error:net.rubygrapefruit.platform.NativeException: Could not start 'C:\Users\...\AppData\Local\Android\sdk\ndk-bundle\toolchains\aarch64-linux-android-4.9\prebuilt\windows-x86_64\bin\aarch64-linux-android-strip' Error:java.io.IOException: Cannot run program "C:\Users\...\AppData\Local\Android