android-gradle

Getting Error “Gradle DSL method not found: 'compile()'” when Syncing Build.Gradle

风流意气都作罢 提交于 2019-11-27 04:47:06
To add V4 support libraries to android studio, i followed this document: https://developer.android.com/tools/support-library/setup.html#libs-without-res but I get an error. Here is what i did SDK manager> Installed Android Support Library and Android Repository. Go to Build.Gradle and added the line as given in the dcoument. Build.Gradle now looks like this: // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { repositories { jcenter() } dependencies { classpath 'com.android.tools.build:gradle:0.13.2' // NOTE: Do not place your

Multidex issue with Flutter

断了今生、忘了曾经 提交于 2019-11-27 04:40:40
I'm getting the following error compiling with gradle using Flutter in Android Studio: Dex: Error converting bytecode to dex: Cause: com.android.dex.DexException: Multiple dex files define Lcom/google/android/gms/internal/zzcew; UNEXPECTED TOP-LEVEL EXCEPTION: com.android.dex.DexException: Multiple dex files define Lcom/google/android/gms/internal/zzcew; [... stacktrace omitted for brevity ...] * What went wrong: Execution failed for task ':app:transformDexArchiveWithDexMergerForDebug'. > com.android.build.api.transform.TransformException: com.android.dex.DexException: Multiple dex files

Could not resolve com.android.support:appcompat-v7:26.1.0 in Android Studio new project

为君一笑 提交于 2019-11-27 04:36:26
I know about this questions: Failed to resolve: com.android.support:cardview-v7:26.0.0 android Could not resolve com.android.support:appcompat-v7:26.1.0 [duplicate] And I've read this documentations: Migrate to Android Plugin for Gradle 3.0.0 Migrating to Android 8.0 So I'm posting this question believing its not a duplicate. I've installed Android Studio 3.0.1. I didn't have any previous version before and I started a new project. Every setting in Gradle file have been set by Android Studio itself and I've checked them all. These are the file contents: build.gradle (Module:app) apply plugin:

“Hello world” Android app with as few files as possible, no IDE, and text editor only

自闭症网瘾萝莉.ら 提交于 2019-11-27 03:54:06
In nearly all languages that I've used (Python, C, C++, etc.), it's possible to write a "hello world" application with a text editor only and run it from command-line (interpreted languages) or compile/build it from command-line (compiled languages), e.g. cl.exe helloworld1.cpp . On the other hand, every time I'm doing an Android App, I need to use Android Studio (which is slow on my machine), create a new project with the IDE, etc. Question: What is the smallest number of minimalist Java source code files/project files to produce an .apk Android app? How to build it from command-line? (and

OpenCv with Android studio 1.3+ using new gradle - undefined reference

落花浮王杯 提交于 2019-11-27 03:40:47
I'm having trouble using native OpenCv 2.4.11 (3.0.0 is also ok) with Android Studio 1.3+, with new ndk support. All tutorials about .mk files, but I want to use it with new experimental gradle. Using Kiran answer OpenCV in Android Studio I achived to work fine in java. Also I have changed gradle-wrapper.properties: distributionUrl=https\://services.gradle.org/distributions/gradle-2.5-all.zip build.gradle(application): classpath 'com.android.tools.build:gradle-experimental:0.2.0' build.gradle(module): apply plugin: 'com.android.model.application' model { android { compileSdkVersion = 23

How to change the Android app package name when assembling with Gradle?

独自空忆成欢 提交于 2019-11-27 03:38:07
Is it possible to change the package name of an Android application using Gradle? I need to compile two copies of the same app, having a unique package name (so I can publish to the market twice). Ethan You could so something like this android { ... defaultConfig { minSdkVersion 8 versionCode 10 } flavorDimensions "flavor1", "flavor2" productFlavors { flavor1 { applicationId "com.example.flavor1" versionCode 20 } flavor2 { applicationId "com.example.flavor2" minSdkVersion 14 } } } You can also change the field android.defaultConfig.applicationId if you want to do one-off builds. Taken from:

Add pre-built .so files in project using Android Gradle plugin 0.7.3

一个人想着一个人 提交于 2019-11-27 03:36:30
Well after a long time the support to add pre-built .so files in an Android project has been added in Android Gradle plugin 0.7.3. But unlike me a lot of people are still using the hack/workaround to add pre-built .so files, i.e zip the files using a certain hierarchy and then re-name into a .jar. Below is a step by step guide to how to properly add .so files. Ahmad Ali Nasir So how you can add the pre-built .so files ? 1) Upgrade your android studio to 0.4.0 2) Replace "distributionUrl=" in gradle-wrapper.properties with "distributionUrl=http://services.gradle.org/distributions/gradle-1.9-all

Build Android Studio app via command line

笑着哭i 提交于 2019-11-27 02:51:53
I want to build an Android Studio app (the Gradle build system), but I want to do this via the command line. FuegoFro Android Studio automatically creates a Gradle wrapper in the root of your project, which is how it invokes Gradle. The wrapper is basically a script that calls through to the actual Gradle binary and allows you to keep Gradle up to date, which makes using version control easier. To run a Gradle command, you can simply use the gradlew script found in the root of your project (or gradlew.bat on Windows) followed by the name of the task you want to run. For instance, to build a

Invoke-customs are only supported starting with android 0 --min-api 26 [closed]

强颜欢笑 提交于 2019-11-27 02:49:52
before i'm use build version gradle 26 but after change buildtoolsversion to 27 like as this image error : error build gradle screenshot Obakeng Molebatsi After hours of struggling, I solved it by including the following within app/build.gradle : android { compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } } https://github.com/mapbox/mapbox-gl-native/issues/11378 Roshni Kyada If compileOptions doesn't work, try this Disable 'Instant Run'. Android Studio -> File -> Settings -> Build, Execution, Deployment -> Instant Run -> Disable checkbox

Error:Execution failed for task ':ProjectName:mergeDebugResources'. > Crunching Cruncher *some file* failed, see logs

冷暖自知 提交于 2019-11-27 01:47:33
I have this error when trying to make a module of a project apply plugin: 'com.android.library' android { compileSdkVersion 17 buildToolsVersion "19.1.0" defaultConfig { minSdkVersion 8 targetSdkVersion 8 } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' } } } dependencies { compile files('libs/sdk.jar') compile files('libs/ads-lib.jar') compile project(':google-play-services_lib') compile files('libs/hdvdecoderandroid.jar') } How can i fix this error? Edit Here is my logs file, when i try to build it in command line