Why xamarin app crashed after publish? - android

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

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: more info about "Error installing app"

When trying to run the app on the device, I'm facing the following issue:
I the Event Log, there is the same message:
Where can I find more info about the error?
Might work if you Clean the project or rebuild the project and if you launching in emulator uninstall from the emulator or from mobile.
UPDATE:
i think there will be no more information about the error...
It's our common mistakes.
As per my knowledge about this issue there can be a few reasons for that:
First is that your app is already installed with the same package
name but with different certificate, To resolve this check if your
phone has that app already installed then uninstall it and try to
install new one.
The second reason can be that you are trying to install the
application that has minimum SDK version higher than the Android
version of device. To solve this make sure that the minimum SDK
version defined in your project's "build.gradle" is lower than the
Android version of your device.
Turning off the Instant run removed error for Android Studio 2.3.
sometimes project location contained the special character.
Example: E:\Android_Projects\T&PUIET,KUK\app\build\outputs\apk\app-debug.apk
close android studio > rename folder containing the special character(here T&PUIET,KUK ) > restart android studio.
Hope it will help!

How to overcome app not installed error when building from Android Studio 3.0?

For giving build for a debug Android app from Android Studio 3.0, it’s not installing in Mobile having Marshmallow and up (in Lollipop not tested).
I have used many solutions from Stack overflow but it’s still not working.
It’s always showing App Not Installed on mobile phone.
Well the original question doesn´t have enough information, but we can have some info getting some comments:
Android studio 3.0 and compileSdkVersion 26, buildToolsVersion '26.0.2',minSdkVersion 15, targetSdkVersion 26
virtual debugging option also on.
I am facing same issue after upgrading android studio from 2.3 to 3.0
Ok the message "App Not Installed" will refer to multiple causes, and please returning to Android Studio 2.3. from 3.0 is not an option!
When we upgrade from Android Studio 2.3 to 3.0 we can find some configuration issues caused mainly by the support libraries, that will cause that our application could not be installed.
To avoid this problem we need to invalidate cache in Android Studio 3.0+ and the problem will be solved.
Please try this option.
First try to generate the debug apk by below steps:
Goto Run
Edit Configurations
select + icon on the left side
Select Gradle
Click the Configuration tab if it is not selected in the right side
In Gradle project add your app as a gradle project
From the tasks select/set "assemble"
Press ok
Now run that configuration.
you will have the debug apk ready in build/outputs/apk/app-debug.apk.
Now install that apk in any device. It should work.
As of Android Studio 3 the Run-Button builds test-only apks. See documentation
Note: The Run button builds an APK with testOnly="true", which means the APK can only be installed via adb (which Android Studio uses). If you want a debuggable APK that people can install without adb, select your debug variant and click Build > Build APK(s).
This solved my issue:
https://stackoverflow.com/a/46661987/7756799
None of the other answers solved the issue. The build and install was going fine when it's triggered from android studio with a device connected to the computer or with an emulator, the only issue was when sending the apk via email or hockey app.
How I could fix it (and this might not be the solution for everybody), I enabled the multidex support by adding this to the default config:
// Enabling multidex support.
multiDexEnabled true
PS: Usually Android Studio build would fail if the multidex support has to be enabled, in this new version this didn't happen, but my Jenkins build was broken and this is how I could solve it.
Ohh this is exactly we have to do:
Go to Build
Build Apk
Locate Apk
In Android studio goto build menu and then Build Aps(s). Its work fine for me.
There are 2 type of APK Signature #1 JAR signature (aka v1) and #2full APK sign (aka v2): Not all the devices recognize it ,so make sure you anable both V1 and V2.
In my case my debug apk worked fine but when I tried to install Signed apk then following error shows
"APP not Installed"
then I haved added
multiDexEnabled true
in gradle fine then its work fine
Android Studio -> Build -> Build Bundle(s) / APK(s) -> Build APK(s) -> Reinstall new APK on mobile phone

Xamarin.Forms shared PCL project Fails to build, An item with the same key has already been added

Xamarin.Forms PCL android project has been working fine and I was deploying to emulator to debug successfully. Now it fails to build and I get an "Unexpected error...Reason: An item with the same key has already been added"
When I just build the project, it builds successfully, but when I build by trying to deploy to an emulator, it fails.
This started happening right after I installed a bunch of Android SDK updates to I could test against the newer Android versions. Also installed the HAXM drivers to try and run a faster emulator. Also did some consolidating and updating of NuGet packages. Also changed target from .NET 4.0 to 4.5.
I can successfully start both the older emulator that I was debugging on previously as well as the new one I've added.
Lots of recent changes so I'm not sure which one is the culprit. I need to know how to get some more detailed logging of why the build failed so I can fix it.
Currently the Build Log is set to Diagnostic, but I don't see any specific reason it's failing to build.
I found the culprit in the Android Options page in the Project Properties.
Under the "Packaging" tab, the "Use Shared Runtime" option was unchecked. As soon as I re-checked this option, I was able to successfully build and deploy again.

android studio run button doesnt do anything

I had my project running. And testing it on mobile device by clicking on the run button. But suddenly it has stopped working. Whenever i click on run button (run configuration is selected) it opens the dialog to choose the device but afterwards it does nothing.
Please help me with this problem. Since it has wasted my whole time.
I had the same issue. Studio project was working fine. After updateding the gradle plugin, it started showing the same issue.
Updating the Android studio to latest version only solved the problem. Looks like compatibility issue
#ShoaibAnwar Firstly Android Studio 2.0 has a security risk. http://www.androidcentral.com/google-advises-developers-upgrade-android-studio-211-over-security-concerns
You should upgrade to the latest dev release (2.1.1) in the dev channel or if you are not in a hurry, the latest stable 1.5.2. in the stable channel. (Perhaps in the future, 1.5.2 will be available in the dev channel) The run button in 2.0 won't work, instant run will not always deploy changes.
Secondly I would not mix TV and mobile modules. It is advised to separate android TV and wear modules from mobile and tablet modules. Just create 2 separate apks.
Any way to make common APK for API-15+ on mobile and API-21+ on TV?
http://tools.android.com/download/studio/builds/1-5-2/

Categories

Resources