Android studio 3.5 doing gradle build for every debug session - android

Every time when we try to debug an app or attach to the running process android studio is triggering a gradle build. Is there any way to stop this?

It is supposed to build app in order for you to do any debugging. Your files need to be bbuilt from the plain java files to something that can be compiled and understood by the system. YOu can't debug code that has not been built by gradle.

Related

INSTALL_PARSE_FAILED_NO_CERTIFICATES on a debug build when using 'Run' button

So I was just making a toy app to test capturing photos and video for an app at work. I set up everything in a standard fashion, make a small activity and when I try to use the 'Run' command in android studio to install on my device, I get the following error:
11/28 11:14:32: Launching 'app' on Unknown Device.
Installation did not succeed.
The application could not be installed: INSTALL_PARSE_FAILED_NO_CERTIFICATES
APK signature verification failed.
Retry
I tried searching google as to why this might happen, but I only found things concerning the generation of a signed apk and usually in a release build. I have done no signing configs on this project. It's basically a standard Android Studio generated project. Here's a screenshot of my gradle file:
module-gradle-file
Has anyone encountered this problem? I'm using Android Studio 3.5, gradle 5.4.1 and gradle plugin 3.5.0
UPDATE
So, I decided to just restart the adb server and it worked. The question of why this happened, though, remains

Android Studio compiling app but no longer updating on phone

I recently built a release apk for the first time to put my app in the app store. Now that I've done that I've switched back to a debug build variant to continue working on the app. However, now when I try to run on my device nothing happens. The app does not open like it used to and when I open it I can see it has not been updated. If I try to run again, android studio says the app is still running and I have to restart it, but I can not see where it is running? The gradle build says:
Information:Gradle tasks [:app:generateDebugSources, :app:generateDebugAndroidTestSources, :app:mockableAndroidJar]
and that the build was successful, but I can't figure out how to get it on my phone.
I'm wondering if I accidentally altered a required setting when trying to get my release apk? (I didn't know how to do it at first so may have clicked the wrong thing at some point.) If anyone knows what setting I may have changed and how to switch it back that will be much appreciated. I'm running Android Studio 3.0.1
Edit: It used to say "Gradle build running" first when I ran the app and now it says "Gradle build using tasks"
When you start release APK build process in Android Studio, it makes some configuration changes. In that one is Build Variant of APK from debug to release. Like below
Maybe you forgot to change it back when start application in debug mode. Just change build variant from release to debug when you want test/update application in debug mode.
Above option can be found on bottom left hand side of Android Studio.
PS: When you start/use app in debug mode, uninstall release APK from your phone (if any).

How to force gradle to build my app, even with errors (root)?

What I have been doing
My app accesses many packages that Android Studio and Gradle denote as errors. However, my app has system privileges and has access to all of these during runtime, such as android.os.SystemProperties
Up until now, I have been compiling and installing this application to my device with:
source build/envsetup.sh
lunch my_device_name
mm
adb install path_to_apk_generated_with_mm
Using this method, I compile the app with mm and directly install it using adb without having to use gradle.
_
What I'm looking for
Because I know that my app will run on my device, is there a way I can force gradle to build it and ignore what it thinks are errors? I would really like to be able to run my app directly from android studio, and more importantly,
I'd like to start making use of android tests
I can't generate an androidTest apk with mm and Gradle won't let me build the apk because it just throws errors.
Is there any way to make gradle build even with errors?

Why xamarin app crashed after publish?

I create my android app via xamarin and deploy it.In this case app worked currently but when publish app and install it on emulator app crashed.
I open new project with out any code.I put a button inside main activity and then setting up such as this image and repeat publish but app installed and when running crashed.
What is problem?
I m new to Xamarin and recently i Have developed and app and Published successfully i Also had Face savarel errors on Releasing
Resons Behind Crashing The App :
There Can be Savarel Reasons of Crashing a Xamarin App After Releasing
The Default Behaviour of any Xamarin app is to throw exception on any critical error.. so We Have to Digg into Other problems rather Then Focussing on crashing App
Lets Discuss Some that I Faced ..
1.Project Release (Miss) Configuration
The Project Config Worked For me Was :
Set Project from Debug to Release Mode (Right Click on Solution).
Uncheck option "Use Fast Deploymnet"
keep "use" incremental Android Packaging System(aapt2)
Dex Compiler : whatever you like
code Shrinker: Whatever dex Compiler Support or you can keep it
Blank
Keep "Enable developer instrumentation(debugging and Profilling)"
unCheked (must)
Linking : dont keep None keep it "sdk only" or "sdk and User
Assambly"
keep Target Android Version(ANdroid Menifest) lower or Equal to
option Compile using Android version(Aplication)
2.Un-Supported Libraries in projectname.Android & Projectname.ios
-1 of the app crashing reasons is this also .. let me explain
every xamarin project installs a xamarin library by default
and it can be older version then libraries available in letest
version
Eg: i was having a plugin for Toast Notification with version 2.2.0
initiasly in my device project was working fine in Android 10 in
both release and debug mode but but but....,
it was crashing in other versions devices like 11,12,13,9,8..
because of the xamarin library version was older and not supported
new library versions in these devices
Solution : what i did was re-installed that plugin with version
2.0.0(DownGraded version) And It Worked ..!! in release and Debug
Mode..
Eg2:Installing UnNessesary Libraries to projectName.Android And
projectName.ios Projects
i had installed a library that was for only experimental perpose
and later i didn't Used any code from that library in my project
and i was facing error like : "Java.lang.ClassnotFound Exception"
in release mode and app was crashing without any reason
Solution i Removed that library from all 3 projects
.ios,.android,and .csproject it worked errors ware gone!
Installing Un-Nessessary Libraries to .Android and .Ios project
look buddy you dont need every library to be installed in .Android and
.ios Project always Sometimes if you are installing those in only
.csproject(pcl) Project ..! it is sufficiant to run code.
Note!: Try To Install As minimum number of libreries as possible
in .Android And .Ios Project
Signing The Apk After Publishing(Archiving)
One of the major Reason is not Signing Your Apk in publishing(Archiving
Process)
For This Check link: How to Prepare for Deploy And Sign xamarin APP

Ionic build succeeds but does not create .apk file

I was always able to build from this project, this just started happening this morning. When I run ionic build android everything runs smoothly and the build succeeds, but the date modified on the android-debug.apk file stays the same, and I don't see my changes when I run it on a device.
Could it have something to do with messed up permissions and somehow it doesn't have permission to write the apk? I'm running Ubuntu-server 14.04.4.
I know it's been answered before but I'm adding this to let you guys know what I've tried and how it's not working anyways...
I've also faced same issue and tried several things like
Renaming APK file, expecting it will create new one.
Deleting build folder, expecting as usual will create new one.
opening project in Android studio, expecting it will create new one when I use it to launch the APK to device.
I've tried calling ionic prepare platform before calling ionic build.
The ionic build is a proxy for cordova build command.
But in this issue all of above approaches were failed.
The reason I can see behind this is because of no proper response/function of added platform to your project, as when you build it's cordova platform android's responsibility to prepare build on your command. Which is not working.
Lot of people suggests that You need to us ionic/cordova restore, this will restore your state.
Another way is you can use Android Studio's build APK option which helps you not to disturb your plugins by restore or reset commands.
Hope this helps you save your time from trying all these approaches.
Could it that you are looking at a wrong place?
When build command is successfully finished you should see smth like below in console
Built the following apk(s):
<PATH_TO_YOUR_SOURCES>/platforms/android/build/outputs/apk/android-debug.apk
Are you checking this this location?
Okay so the problem isn't with Ionic, it's just that the changed files aren't showing up in the ftp for some reason. So now I will try and figure that out.
As suggested by #mobileevangelist , ionic cordova restore can be done using command
ionic cordova prepare
It fixed my problem.
Try to
Open Android Studio
Choose Import project
Select YourProjectDirectory/platforms/android folder
Choose Build -> Build APK

Categories

Resources