Gradle build successful but no app installed on android device - android-studio

I am working on android kotlin room basic app. I was able to successfully gradle build on Android Dolphin but the app does not install on a physical android phone. How can I install the app on the phone?
Stack trace:
1:01:09 PM: Executing 'app:assemble'...
Executing tasks: [app:assemble] in project C:\Users\E6400\AndroidStudioProjects\android-basics-kotlin-sql-basics-app
> Task :app:createDebugVariantModel UP-TO-DATE
> Task :app:preBuild UP-TO-DATE
> Task :app:preDebugBuild UP-TO-DATE
> Task :app:mergeDebugNativeDebugMetadata NO-SOURCE
> Task :app:compileDebugAidl NO-SOURCE
> Task :app:compileDebugRenderscript NO-SOURCE
> Task :app:generateDebugBuildConfig UP-TO-DATE
> Task :app:checkDebugAarMetadata UP-TO-DATE
> Task :app:generateDebugResValues UP-TO-DATE
> Task :app:mapDebugSourceSetPaths UP-TO-DATE
> Task :app:generateDebugResources UP-TO-DATE
> Task :app:mergeDebugResources UP-TO-DATE
> Task :app:createDebugCompatibleScreenManifests UP-TO-DATE
> Task :app:extractDeepLinksDebug UP-TO-DATE
> Task :app:processDebugMainManifest UP-TO-DATE
> Task :app:processDebugManifest UP-TO-DATE
> Task :app:processDebugManifestForPackage UP-TO-DATE
> Task :app:processDebugResources UP-TO-DATE
> Task :app:kaptGenerateStubsDebugKotlin UP-TO-DATE
> Task :app:kaptDebugKotlin UP-TO-DATE
> Task :app:compileDebugKotlin UP-TO-DATE
> Task :app:javaPreCompileDebug UP-TO-DATE
> Task :app:compileDebugJavaWithJavac UP-TO-DATE
> Task :app:mergeDebugShaders UP-TO-DATE
> Task :app:compileDebugShaders NO-SOURCE
> Task :app:generateDebugAssets UP-TO-DATE
> Task :app:mergeDebugAssets UP-TO-DATE
> Task :app:compressDebugAssets UP-TO-DATE
> Task :app:processDebugJavaRes NO-SOURCE
> Task :app:mergeDebugJavaResource UP-TO-DATE
> Task :app:checkDebugDuplicateClasses UP-TO-DATE
> Task :app:dexBuilderDebug UP-TO-DATE
> Task :app:desugarDebugFileDependencies UP-TO-DATE
> Task :app:mergeExtDexDebug UP-TO-DATE
> Task :app:mergeDexDebug UP-TO-DATE
> Task :app:mergeDebugJniLibFolders UP-TO-DATE
> Task :app:mergeDebugNativeLibs NO-SOURCE
> Task :app:stripDebugDebugSymbols NO-SOURCE
> Task :app:validateSigningDebug UP-TO-DATE
> Task :app:writeDebugAppMetadata UP-TO-DATE
> Task :app:writeDebugSigningConfigVersions UP-TO-DATE
> Task :app:packageDebug UP-TO-DATE
> Task :app:createDebugApkListingFileRedirect UP-TO-DATE
> Task :app:assembleDebug UP-TO-DATE
> Task :app:createReleaseVariantModel UP-TO-DATE
> Task :app:buildKotlinToolingMetadata UP-TO-DATE
> Task :app:preReleaseBuild UP-TO-DATE
> Task :app:compileReleaseAidl NO-SOURCE
> Task :app:compileReleaseRenderscript NO-SOURCE
> Task :app:generateReleaseBuildConfig UP-TO-DATE
> Task :app:checkReleaseAarMetadata UP-TO-DATE
> Task :app:generateReleaseResValues UP-TO-DATE
> Task :app:mapReleaseSourceSetPaths UP-TO-DATE
> Task :app:generateReleaseResources UP-TO-DATE
> Task :app:mergeReleaseResources UP-TO-DATE
> Task :app:createReleaseCompatibleScreenManifests UP-TO-DATE
> Task :app:extractDeepLinksRelease UP-TO-DATE
> Task :app:processReleaseMainManifest UP-TO-DATE
> Task :app:processReleaseManifest UP-TO-DATE
> Task :app:processReleaseManifestForPackage UP-TO-DATE
> Task :app:processReleaseResources UP-TO-DATE
> Task :app:kaptGenerateStubsReleaseKotlin UP-TO-DATE
> Task :app:kaptReleaseKotlin UP-TO-DATE
> Task :app:compileReleaseKotlin UP-TO-DATE
> Task :app:javaPreCompileRelease UP-TO-DATE
> Task :app:compileReleaseJavaWithJavac UP-TO-DATE
> Task :app:extractProguardFiles UP-TO-DATE
> Task :app:lintVitalAnalyzeRelease UP-TO-DATE
> Task :app:lintVitalReportRelease UP-TO-DATE
> Task :app:lintVitalRelease
> Task :app:mergeReleaseJniLibFolders UP-TO-DATE
> Task :app:mergeReleaseNativeLibs NO-SOURCE
> Task :app:stripReleaseDebugSymbols NO-SOURCE
> Task :app:extractReleaseNativeSymbolTables NO-SOURCE
> Task :app:mergeReleaseNativeDebugMetadata NO-SOURCE
> Task :app:checkReleaseDuplicateClasses UP-TO-DATE
> Task :app:dexBuilderRelease UP-TO-DATE
> Task :app:desugarReleaseFileDependencies UP-TO-DATE
> Task :app:mergeExtDexRelease UP-TO-DATE
> Task :app:mergeDexRelease UP-TO-DATE
> Task :app:mergeReleaseArtProfile UP-TO-DATE
> Task :app:compileReleaseArtProfile UP-TO-DATE
> Task :app:mergeReleaseShaders UP-TO-DATE
> Task :app:compileReleaseShaders NO-SOURCE
> Task :app:generateReleaseAssets UP-TO-DATE
> Task :app:mergeReleaseAssets UP-TO-DATE
> Task :app:compressReleaseAssets UP-TO-DATE
> Task :app:processReleaseJavaRes NO-SOURCE
> Task :app:mergeReleaseJavaResource UP-TO-DATE
> Task :app:optimizeReleaseResources UP-TO-DATE
> Task :app:collectReleaseDependencies UP-TO-DATE
> Task :app:sdkReleaseDependencyData UP-TO-DATE
> Task :app:writeReleaseAppMetadata UP-TO-DATE
> Task :app:writeReleaseSigningConfigVersions UP-TO-DATE
> Task :app:packageRelease UP-TO-DATE
> Task :app:createReleaseApkListingFileRedirect UP-TO-DATE
> Task :app:assembleRelease
> Task :app:assemble
BUILD SUCCESSFUL in 45s
73 actionable tasks: 1 executed, 72 up-to-date
Build Analyzer results available
1:02:00 PM: Execution finished 'app:assemble'.

You will have to go into developer mode of the phone. Go to Settings -> About Phone -> look for Build Version. Tap build version about 8 times. This will enable developer mode on the phone.
Now go into the developer mode and scroll down and toggle on the USB Debugging. Plug your device in the computer while Android studio is open. When you plug in the phone you will want to allow file transfer. Then Android Studio will send a message to the phone and you will select Allow and check the box that says remember choice.
Once you have completed that Android should detect the device in the drop down under devices. If you don't see it go to the AVD and look for physical device.
If it does auto detect, then you run the app and it will show on the device instead of the emulator.
Some Android phones may be different in getting to the build version. So just get to build version then everything else will be following the prompts.
Also your phone will have to be the same API version or higher. Example, Android 10 based API will not install on an Android 9 based phone. Be sure the API are equivalent or better.

Related

execution failed for appmergeDebugResources task in intelliJ android project

I am not able to get over this error. I'm using IntelliJ 2020.1.1 and I've tried every suggested solution- upgrading(6.1) and downgrading(both 6.0 and 5.6.4) gradle, changing gradle properties, clean/rebuild etc. Nothing works.
Executing tasks: [:app:assembleDebug] in project D:\MyApplication1
Task :app:preBuild UP-TO-DATE
Task :app:preDebugBuild UP-TO-DATE
Task :app:compileDebugAidl NO-SOURCE
Task :app:generateDebugBuildConfig UP-TO-DATE
Task :app:compileDebugRenderscript NO-SOURCE
Task :app:javaPreCompileDebug UP-TO-DATE
Task :app:mainApkListPersistenceDebug UP-TO-DATE
Task :app:generateDebugResValues UP-TO-DATE
Task :app:generateDebugResources UP-TO-DATE
Task :app:createDebugCompatibleScreenManifests UP-TO-DATE
Task :app:extractDeepLinksDebug UP-TO-DATE
Task :app:processDebugManifest UP-TO-DATE
Task :app:mergeDebugShaders
Task :app:compileDebugShaders
Task :app:generateDebugAssets
Task :app:mergeDebugAssets
Task :app:mergeDebugResources FAILED
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:mergeDebugResources'.
Multiple task action failures occurred:
A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
AAPT2 aapt2-3.6.0-rc01-6040484-windows Daemon #3: Daemon startup failed
Please check if you installed the Windows Universal C Runtime.
This should not happen under normal circumstances, please file an issue if it does.
A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
AAPT2 aapt2-3.6.0-rc01-6040484-windows Daemon #4: Daemon startup failed
Please check if you installed the Windows Universal C Runtime.
This should not happen under normal circumstances, please file an issue if it does.
A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
AAPT2 aapt2-3.6.0-rc01-6040484-windows Daemon #5: Daemon startup failed
Please check if you installed the Windows Universal C Runtime.
This should not happen under normal circumstances, please file an issue if it does.
A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
AAPT2 aapt2-3.6.0-rc01-6040484-windows Daemon #6: Daemon startup failed
Please check if you installed the Windows Universal C Runtime.
This should not happen under normal circumstances, please file an issue if it does.
A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
AAPT2 aapt2-3.6.0-rc01-6040484-windows Daemon #7: Daemon startup failed
Please check if you installed the Windows Universal C Runtime.
This should not happen under normal circumstances, please file an issue if it does.
A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
AAPT2 aapt2-3.6.0-rc01-6040484-windows Daemon #8: Daemon startup failed
Please check if you installed the Windows Universal C Runtime.
This should not happen under normal circumstances, please file an issue if it does.
A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
AAPT2 aapt2-3.6.0-rc01-6040484-windows Daemon #9: Daemon startup failed
Please check if you installed the Windows Universal C Runtime.
This should not happen under normal circumstances, please file an issue if it does.
A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
AAPT2 aapt2-3.6.0-rc01-6040484-windows Daemon #10: Daemon startup failed
Please check if you installed the Windows Universal C Runtime.
This should not happen under normal circumstances, please file an issue if it does.
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.4.1/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 33s
11 actionable tasks: 4 executed, 7 up-to-date`
It worked after installing Universal C Runtime.
I was getting "The update is not applicable to your computer" message everytime I tried to install CRT. Turns out Service pack 1 was not installed on my system. CRT was installed after this update and my project also executed finally.

Android Studio says FAILURE: Build failed with an exception after updating to 3.6.2

All my codes was running fine. But When I updated the android studio to 3.6.2 it show:
Executing tasks: [:app:assembleDebug] in project /home/AK_47/AndroidStudioProjects/MyProject
> Task :app:preBuild UP-TO-DATE
> Task :app:preDebugBuild UP-TO-DATE
> Task :app:generateDebugBuildConfig UP-TO-DATE
> Task :app:javaPreCompileDebug UP-TO-DATE
> Task :app:compileDebugRenderscript NO-SOURCE
> Task :app:compileDebugAidl NO-SOURCE
> Task :app:mainApkListPersistenceDebug UP-TO-DATE
> Task :app:generateDebugResValues UP-TO-DATE
> Task :app:generateDebugResources UP-TO-DATE
> Task :app:mergeDebugResources FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:mergeDebugResources'.
> Could not resolve all files for configuration ':app:_internal_aapt2_binary'.
> Could not resolve com.android.tools.build:aapt2:3.6.2-6040484.
Required by:
project :app
> No cached version of com.android.tools.build:aapt2:3.6.2-6040484 available for offline mode.
> No cached version of com.android.tools.build:aapt2:3.6.2-6040484 available for offline mode.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 1s
5 actionable tasks: 1 executed, 4 up-to-date
I was trying to make an ANDROID application. But after updating it isn't working. Any solution?
Try to turn off Gradle Offline mode from Gradle tool located at right side of Android Studio.
then please follow below steps:
Run following command to clear gradle cache:
rm -rf ~/.gradle/caches/
after that please click on Invalidate Caches/Restart from File menu then further processing will happen which dowloads all the libraries again so it takes time but also resolves this issue.
The error indicates that the dependency can't be downloaded because you are in offline mode or have an active Internet connection is not available.
Steps to try
Try to turn Off Gradle's offline mode. You are turn off by
View > Tool Windows > Gradle
from the menu bar.Here On the top of the Gradle window ,click on Toggle Offline Mode button in the Gradle window.
Check the internet connection and build again.
Hope this answer will help...
At Gradle I used
rm -rf ~/.gradle/
Then gradle clean build
And ./gradlew test

Android studio error after update to 3.6.2

I recently updated my android studio from 3.5 to 3.6.2. After that for all my projects I receive below error even for new projects with clean and empty activity.
Task :app:preBuild UP-TO-DATE
Task :app:preDebugBuild UP-TO-DATE
Task :app:compileDebugAidl NO-SOURCE
Task :app:generateDebugBuildConfig UP-TO-DATE
Task :app:compileDebugRenderscript NO-SOURCE
Task :app:javaPreCompileDebug FAILED
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:javaPreCompileDebug'.
Could not resolve all files for configuration ':app:debugCompileClasspath'.
Could not find collection.jar (androidx.collection:collection:1.0.0).
Searched in the following locations:
https://dl.google.com/dl/android/maven2/androidx/collection/collection/1.0.0/collection-1.0.0.jar
Could not find lifecycle-common.jar (androidx.lifecycle:lifecycle-common:2.0.0).
Searched in the following locations:
https://dl.google.com/dl/android/maven2/androidx/lifecycle/lifecycle-common/2.0.0/lifecycle-common-2.0.0.jar
Could not find core-common.jar (androidx.arch.core:core-common:2.0.0).
Searched in the following locations:
https://dl.google.com/dl/android/maven2/androidx/arch/core/core-common/2.0.0/core-common-2.0.0.jar
Could not find annotation.jar (androidx.annotation:annotation:1.0.0).
Searched in the following locations:
https://dl.google.com/dl/android/maven2/androidx/annotation/annotation/1.0.0/annotation-1.0.0.jar
Could not find constraintlayout-solver.jar (androidx.constraintlayout:constraintlayout-solver:1.1.3).
Searched in the following locations:
https://dl.google.com/dl/android/maven2/androidx/constraintlayout/constraintlayout-solver/1.1.3/constraintlayout-solver-1.1.3.jar
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
BUILD FAILED in 1s
2 actionable tasks: 1 executed, 1 up-to-date

Why is localbuild for a REACT app is failing in nodeSetup task in Eclipse in Windows machine?

Attempting to do a localbuild for a REACT app in a windows machine. It is failing in the nodeSetup task of the localbuild. I was getting an incompatible win32 on Yarn but that is corrected. Attached are the gradle refresh and localbuild dumps.
Installed are:
Eclipse IDE for Enterprise Java Dev 2019-09 R (4.13.0)
node v12.10.0
npm v6.12.0-next.0
Removed and reinstalled node.js, yarn
From the localbuild dump:
Task :clean UP-TO-DATE
boson:clean boson:clean took: [0.001] secs
Task :nodeSetup FAILED
boson:nodeSetup boson:nodeSetup took: [0.379] secs
build completed
org.gradle.internal.exceptions.LocationAwareException: Execution failed for task ':nodeSetup'.
...
Caused by: org.gradle.internal.resolve.ModuleVersionNotFoundException: Could not find org.nodejs:node:8.15.0.
Searched in the following locations:
- https://.../repository/nodemodules/source/v8.15.0/ivy.xml
- https://.../repository/nodemodules/source/v8.15.0/node-v8.15.0-win-x64.zip
Required by:
project :

Android Studio will not debug (only builds) since trying to generate a signed apk

AS builds the debug APK just fine, but will not load to the phone and debug on the phone
Here is the output on a debug [assembleDebug] run:
7:52:18 PM: Executing task 'assembleDebug'...
Executing tasks: [assembleDebug]
Configuration on demand is an incubating feature.
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:compileDebugAidl UP-TO-DATE
:app:compileDebugRenderscript UP-TO-DATE
:app:checkDebugManifest UP-TO-DATE
:app:generateDebugBuildConfig UP-TO-DATE
:app:prepareLintJar UP-TO-DATE
:app:mainApkListPersistenceDebug UP-TO-DATE
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources UP-TO-DATE
:app:mergeDebugResources UP-TO-DATE
:app:createDebugCompatibleScreenManifests UP-TO-DATE
:app:processDebugManifest UP-TO-DATE
:app:splitsDiscoveryTaskDebug UP-TO-DATE
:app:processDebugResources UP-TO-DATE
:app:generateDebugSources UP-TO-DATE
:app:javaPreCompileDebug UP-TO-DATE
:app:compileDebugJavaWithJavac UP-TO-DATE
:app:compileDebugNdk NO-SOURCE
:app:compileDebugSources UP-TO-DATE
:app:mergeDebugShaders UP-TO-DATE
:app:compileDebugShaders UP-TO-DATE
:app:generateDebugAssets UP-TO-DATE
:app:mergeDebugAssets UP-TO-DATE
:app:transformClassesWithDexBuilderForDebug UP-TO-DATE
:app:transformDexArchiveWithExternalLibsDexMergerForDebug UP-TO-DATE
:app:transformDexArchiveWithDexMergerForDebug UP-TO-DATE
:app:mergeDebugJniLibFolders UP-TO-DATE
:app:transformNativeLibsWithMergeJniLibsForDebug UP-TO-DATE
:app:processDebugJavaRes NO-SOURCE
:app:transformResourcesWithMergeJavaResForDebug UP-TO-DATE
:app:validateSigningDebug UP-TO-DATE
:app:packageDebug
:app:assembleDebug
BUILD SUCCESSFUL in 2s
26 actionable tasks: 1 executed, 25 up-to-date
7:52:20 PM: Task execution finished 'assembleDebug'.
Note that it never attempts to install or debug...
I finally gave up and created a new project and copied over my files and it is working.

Resources