Installation failed with message Invalid File
Click Build tab —> Clean Project Click Build tab —> Build APK Run.
Click Build tab —> Clean Project Click Build tab —> Build APK Run.
Using Android Studio: Add the following values to build.gradle for android gradle plugin v0.14+ android { … defaultConfig { … renderscriptTargetApi 19 renderscriptSupportModeEnabled true } … } For older versions of the android gradle plugin v0.13.3 and below android { … defaultConfig { … renderscriptTargetApi 19 renderscriptSupportMode true } … } Once that is done, … Read more
For Android Studio 3.2.1 update Just add google() in root level build.gradle buildscript { repositories { google() // <–here jcenter() } } allprojects { repositories { google() // <– here jcenter() } } and see the magic – error is gone.
As a simpler alternative to using product flavours as in Ethan’s answer, you can also customise build types. How to choose between the approaches: If you need different package names to be able to have both debug and release apks installed on a device, then use the build type approach below, as Gradle plugin docs … Read more
Instruct Gradle to download Android plugin from Maven Central repository. You do it by pasting the following code at the beginning of the Gradle build file: buildscript { repositories { mavenCentral() } dependencies { classpath ‘com.android.tools.build:gradle:1.1.1’ } } Replace version string 1.0.+ with the latest version. Released versions of Gradle plugin can be found in … Read more
Apparently, the android plugin doesn’t add a compileJava task (like the java plugin would). You can check which tasks are available with gradle tasks –all, and pick the right one for your (otherwise correct) dependency declaration. EDIT: Apparently, the android plugin defers creation of tasks in such a way that they can’t be accessed eagerly … Read more
To define a flavor specific dependency you can use proCompile instead of compile in your dependency section. When you run gradle properties you get an overview of automatic created configurations. The correct build file looks like this: buildscript { repositories { mavenCentral() } dependencies { classpath ‘com.android.tools.build:gradle:1.2.3’ } } apply plugin: ‘com.android.application’ repositories { mavenCentral() … Read more
By default, the SDK Manager from the command line does not include the build tools in the list. They’re in the “obsolete” category. To see all available downloads, use android list sdk –all And then to get one of the packages in that list from the command line, use: android update sdk -u -a -t … Read more
Gradle does a good job of avoiding re-downloading artifacts, but you can pass –offline to Gradle to prevent from accessing the network during builds. e.g. gradle –offline build If it needs something from the network that it doesn’t have, instead of attempting to fetch it, your build will fail.