build.gradle

Android Studio: Re-download dependencies and sync project

天涯浪子 提交于 2019-11-27 09:13:26
I downloaded an open source game " ChaseWhisplyProject " source code from Github. I imported the project in my Android Studio (Version 1.5.1). It shows following error message: Error:Failed to open zip file. Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.) Re-download dependencies and sync project (requires network) Re-download dependencies and sync project (requires network) I changed all the dependency versions to latest one bu still it is showing the same message. It has two modules under the main project 1) BaseGameUtils & 2)ChaseWhisply.

How to add Gson extras to an Android project?

[亡魂溺海] 提交于 2019-11-27 08:28:48
问题 I am using gson parser (latest version -> 2.8.2). I would like to use RuntimeTypeAdapterFactory which is part of the gson extras. In my build.gradle there is currently a single compile directive: compile 'com.google.code.gson:gson:2.8.2' However this gives me only the gson lib without the extras (RuntimeTypeAdapterFactory is not recognized in the project...). I have looked at gson extras' pom file (https://github.com/google/gson/blob/master/extras/pom.xml) and tried to add below line to my

Error: The file name must end with .xml or .png when using an mp3 file

…衆ロ難τιáo~ 提交于 2019-11-27 08:28:42
问题 I'm using Gradle 1.5.0 with Android Studio. Project syncs with Gradle without any issues, but when I run the app, I get the follow error message Error:Execution failed for task ':App:mergeDebugResources'. /Users/Zee/Repos/App/res/drawable/notification.mp3: Error: The filename must end with .xml or .png Using an mp3 file, so not sure what to do at this point. Any help is much appreciated. 回答1: You can't put mp3 file in drawable. Drawable folder is for images. Put your mp3 file or any other

How to run copy task with android studio into assets folder

走远了吗. 提交于 2019-11-27 08:16:34
So far I have added the following to the end of my "build.gradle" task copyFiles(type: Copy) copyFiles { description = 'Copies html5 files from the common library...' from '../../www' into 'assets/www' include('**/*') } Now I just need some help on how o make this task get executed everytime (before) compiling the android source. I can run the copy task manually from command line, but Id like to have it run when I click "run" in android studio. With the help of suggestion below, I have added clean.dependsOn copyFiles clean.mustRunAfter copyFiles And with this addition I can get my copy task to

Error: Gradle DSL method not found: compile()

两盒软妹~` 提交于 2019-11-27 08:12:09
问题 enter image description here Hello, we've created an android app for our site, but now you want to turn it into an APK, but I've encountered the following error and do not let me move on with the compilation. Error:(60, 0) Gradle DSL method not found: 'compile()' Possible causes:<ul><li>The project 'Template' may be using a version of the Android Gradle plug-in that does not contain the method (e.g. 'testCompile' was added in 1.1.0). <a href="fixGradleElements">Upgrade plugin to version 2.3.3

Gradle eclipse plugin : Could not find method jcenter() for arguments [] on repository container. See error log for details

为君一笑 提交于 2019-11-27 08:02:40
问题 I am trying to import my gradle project into eclipse and I get the error Could not find method jcenter() for arguments [] on repository container. See error log for details Among other things, my build.gradle contains the following: buildscript { repositories { jcenter() } dependencies { classpath 'org.gradle.api.plugins:gradle-cargo-plugin:1.1' } } The eclipse log contains the following (posting only the tail for brevity): Caused by: org.gradle.api.internal.MissingMethodException: Could not

android : Error converting byte to dex

流过昼夜 提交于 2019-11-27 07:55:40
So, I am getting the following error while running the project after upgrading build.gradle (Project) from dependencies { classpath 'com.android.tools.build:gradle:2.0.0-alpha2' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } to dependencies { classpath 'com.android.tools.build:gradle:2.0.0-alpha3' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } I just changed the gradle from 2.0.0-alpha2 to 2.0.0-alpha3 and then, trying to build the project. Error log:

Could not find property 'outputFile' on com.android.build.gradle.internal.api.ApplicationVariantImpl

╄→гoц情女王★ 提交于 2019-11-27 07:44:49
After updating to AS 1.0 RC 1 and plugin 0.14.4 I am having problems with the renaming part of my build.gradle: applicationVariants.all { variant -> def file = variant.outputFile variant.outputFile = new File(file.parent, file.name.replace(".apk", "-" + defaultConfig.versionName + ".apk")) } throws now: Error:(78, 0) Could not find property 'outputFile' on com.android.build.gradle.internal.api.ApplicationVariantImpl_Decorated@67e7625f. and also I cannot jump to the class ApplicationVariantImpl to look how the property might have been renamed. Anyone knows workarounds for this? Oleg Khalidov

embed crosswalk in android studio

拟墨画扇 提交于 2019-11-27 07:31:03
I'm new about android programming and android studio. I researched crosswalk embed API for my project and tried to embed it in android studio. But I couldn't be succesfull. Even I don't know exactly how can embed an API that has gradle file or not. Maybe there is a problem with gradle system? In brief, how can I embed crosswalk-webview to my project with android studio step by step? Thanks a lot you. Following: https://diego.org/2015/01/07/embedding-crosswalk-in-android-studio/ Open AndroidStudio to project view in app folder edit build.gradle: repositories { maven { url 'https://download.01

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

假如想象 提交于 2019-11-27 07:25: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. the following warnings appear: WARNING [Project: :MyApp] variant.getOutputFile() is deprecated. Call it