Unable to run andorid app in android studio - android

Starting the android studio gives this error
Error:Execution failed for task ':app:prepareComAndroidSupportAppcompatV72220Library'.
Could not expand ZIP '/home/abskpr/Android/Sdk/extras/android/m2repository/com/android/support/appcompat-v7/22.2.0/appcompat-v7-22.2.0.aar'.
Please help!!!

It's a build error; Go to File -> Settings -> Build -> Gradle and select Use default Gradle wrapper (Recommended)

Related

Flutter returns `lifecycle-common-java8.jar (androidx.lifecycle:lifecycle-common-java8:2.0.0)` error

Flutter project won't run in Android Studio with AndroidX compatibility and returns following errors in Run/Console window:
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':flutter_keyboard_visibility:javaPreCompileDebug'.
Could not resolve all files for configuration ':flutter_keyboard_visibility:debugCompileClasspath'.
Could not find lifecycle-common-java8.jar (androidx.lifecycle:lifecycle-common-java8:2.0.0).
Searched in the following locations:
https://dl.google.com/dl/android/maven2/androidx/lifecycle/lifecycle-common-java8/2.0.0/lifecycle-common-java8-2.0.0.jar
And
FAILURE: Build failed with an exception.
What went wrong:
A problem occurred configuring root project 'path_provider'.
SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable.
If you faced those errors just do the following steps:
open Android project in Android Studio (u can open a File or Class in android path then select Open for Editing interface Android Studio like next image)
In Build window select error line then in right side select Affected Modules:
For each modules in opened files (build.gradle) add lifecycle-common-java8 api inside dependencies{} section and then Build project:
dependencies {
...
api "androidx.lifecycle:lifecycle-common-java8:2.2.0"
}
Finally close Android project and run Flutter project.

Error Run Tensorflow Example Android

I,am run Tensorflow Example Android and i get error :
Error:Execution failed for task ':buildNativeBazel'.
A problem occurred starting process 'command '/usr/local/bin/bazel''
how do i solve this problem
Thanks before ....
you should install NDK and rebuild your project .
for install NDk go to this Page and Download that https://developer.android.com/ndk/index.html
Later than install NDK go to the file -> Project Structure -> SDK Location -> Android NDK Location: -> enter NDK Location

version code not found in android studio canary -2

when instant run apply i am getting following in android studio 3.0 canary-2
Error:E:\PublicServer_Share\Extra\app\build\intermediates\instant-run
support\debug\slice_2\AndroidManifest.xml:2 attribute 'android:versionCode'
not found
Error:failed processing manifest
Error:E:\PublicServer_Share\Extra\app\build\intermediates\instant-run-
support\debug\slice_9\AndroidManifest.xml:2 attribute 'android:versionCode'
not found
Error:failed processing manifest
Error:Execution failed for task
':app:transformDexWithInstantRunSlicesApkForDebug'.
com.android.ide.common.process.ProcessException: Failed to execute aapt
Disable Instant Run. Inside File -> Settings -> Build, Execution, Deployment. This will allow you to run your app in the Canary version.
Run Gradle->Clean and try again

Error building in Android Studio

I am new to Android Studio. But after updating my Android Studio to the latest version everything works fine, but when I decide to run the app I get this error:
(Error:Execution failed for task ':app:compileDebugJavaWithJavac'.
java.io.FileNotFoundException: C:\Users\collinluvpc.gradle\caches\2.14.1\classAnalysis\cache.properties (The system cannot find the file specified))
I have tried to invalidate cache and restart but nothing seems to work. Please help.
At first Upgrade SDK Manager .
(Error:Execution failed for task ':app:compileDebugJavaWithJavac'. java.io.FileNotFoundException: C:\Users\collinluvpc.gradle\caches\2.14.1\classAnalysis\cache.properties (The system cannot find the file specified))
This exception is thrown during a failed attempt to open the file denoted by a specified pathname.
What is your classpath ??
You can use
compile 'com.google.android.gms:play-services:current_version'
& Use this
classpath 'com.android.tools.build:gradle:current_version'
Then Clean-Rebuild Your Project .
Go to File > Settings > Build Tools > Gradle > Configure "Gradle User Home to" -> user/.android/.gradle

Gradle project refresh failed with empty error

Ok so that's a first..
After upgrading to Android Studio 1.5.1 and updating Gradle (on a Mac).
I'm getting an empty error and it refuses to build.
Gradle 'MyTaskTeam' project refresh failed, Error:
AS highlighted the "dependencies" part in my build file, so maybe it's a hint?
I experienced a similar error after upgrading to 1.5.1. The problem was caused by my Gradle settings being configured to "Use local gradle distribution". I had to switch to "Use default gradle wrapper (recommended)" in several projects to fix it.
This setting is under File -> Settings (Ctrl+Alt+S) under Build, Execution, Deployment -> Build Tools -> Gradle

Categories

Resources