I spend some time writting basic android apps, and I wanted to share it with my friends. I tried both APK Extractor and sending an APK file from project folder. In both cases after installation an app icon and title are visible, but app crashes in the second it is opened. I even tried to do it on my phone. It works perfectly when I'm openning it via Android Studio, but crashes after installation from APK. What can be the problem? Do I need to put some permission somewhere?
EDIT
I needed to build APK one more time. Now it's working, I'll leave it in case someone will have the same problem. Just go to Build>Build APK
Goto File -> Settings -> Build,Execution -> Instant Run and uncheck the "Enable Instant run ..." Option
uncheck option and click apply button
Related
So I just spend the whole night messing up and reinstalling android studio and vscode and flutter cause I was trying to build an apk for my app that's ready enough to pass out to some friends for testing. when my phone is connected to my computer I can debug my app no problem so I thought no big deal lets push out an apk and show off my work. What a nightmare this has been and still is.
I followed this step by step guide to building an android app... https://docs.flutter.dev/deployment/android
So once I finally got all the mystery errors out enough for it to build an apk I copied the file over to my phone and installed it. Well soon as it installed and still on the pop up I see 2 buttons, Close and Open, only open is greyed out. I cant open my app up.
I tried changing the targetSdkVersion down to my phones android version.I tried building out every possible version and appbundle and apk for all the processors and I just cant seem to get a variant to open. I have the key.properties file all linked up, I used the keytool like in the guide.
Has anyone else build out flutter app but cant open it? I'm stumped... The first few attempts I was getting extra popups for googles play protect so I went and turned off that feature. Ive had my phone in developer mode for years now so I know unknown sources are allowed.
It installs fine, but doesnt create an icon anywhere to be used. Once i exit out of the original install popup the only way Id know it was on my device is to go into settings/apps and find it there, and in there the only options are uninstall and force stop which is also greyed out. So the app is unuseable
i am working on an app, the app installs fine first time then if i uninstall it from the phone after that the app wont install again until i change package name.
i have tried clearing cache of phone restarting it
when installing app using android studio it gives error like application installation failed installed failed conflicting provider
note that the first time app installs fine these issues are when i try to install it again or update it
and if i change the package name the app installs fine but then again i wont be able to update it
Except above recommendations, also there may be 2 possible reason for that.
1- Your device has another account (Guest account etc.) and your uninstallation not reflected to other account. You can try:
Settings -> Applications -> Find your application from list and Uninstall
2- If it is Play Protect Error
Open Google Play app -> Click Menu and choose Play Protect -> Try disable scan device and Improve harmful detection
This happened with me too. I had solved it by disabling instant run.
File > settings > Build, Execution, Development > Instant Run > disable instant run.
Try running your project again.
I generate APK by doing following in Android Studio:
Build -> Build APK(s).
I copy this APK in Phone's memory and launch it. It installs fine, but only for the first time. I then uninstall existing app and launch the same APK again, now it says "App Not Installed".
If I copy the same APK from my computer to this phone again, then again it installs for the first time only.
Problem with Google play update, Open playstore -> Play protect and turning off Scanning device for security threats.
To run your app on a device, you should plug the device into your development computer with a USB cable. In Android Studio, select the app Run Configuration and click on the Run button. You shouldn't copy the APK directly to the phone. Let Android Studio install it instead. For more details, read Run your app from the official Android documentation.
1) Please Disable Instant Run
(File >Settings >Build,Execution,Deployment > Instant Run)
2) Trying cleaning AND rebuilding your project
3) Make sure that your phone is properly connected to your PC with a USB cable and try to install the app.
I had the same issue after I uninstalled my debug apk from my device. For my case, I solved the problem by "Build" -> "Clear Project" then "Rebuild Project". Then I can install the newly rebuilt apk.
I am new to android development and need to create an apk file for an android application I made in Xamarin Studios so my peer can test it on his device. How can I create the apk file?
For even simpler/faster testing, you can:
connect an Android phone to the USB and use it for debugging/testing.
See https://learn.microsoft.com/en-us/xamarin/android/get-started/installation/set-up-device-for-development.
build your app (as debug, for example)
Every time you test on your phone by clicking on the "play button" button example, it automatically creates an APK under bin\Debug\ or bin\Release.
The file you are looking for is the "Signed apk", e.g. com.companyname.MyApp-Signed.apk
Copy this file to the device using any method (I usually use USB or GDrive). On the device, download it and click on it to install.
Important:
"Use Shared Runtime" inside the project properties/Android Options must be Disabled, otherwise Mono Runtime won't be included and your app will crash on phones where Mono isn't installed.Example
Select Build menu next click Archive for Publishing
Right-Click on build which do you want get apk file next select Sign and Distribute
Select Ad Hock and click next button
Select testing certificate and click next button
Publish and choose where do you want save apk file.
With the latest Visual Studio 2019 and the latest xamarin, I will literally walk you through all the steps:
Change your project from "Debug" mode to "Release" mode like below:
Build your android project first.
Right-click on your android project -> click "Archive..."
It'll show something like this: Let it complete its processing
When it's done, click the "Distribute" button, it'll open a menu like this:
Click on the "Ad Hoc" button and click the "+" button like below:
fill the form and click the "Create" button
Select your saved settings and click the "Save As" button
Chose your location to save and save the APK file and get it from where you saved it :)
For simple testing:
Build the project in Release mode
Go to your project's /bin/Release folder
Inside the folder, you will find the required signed apk file.
The apk file should now be installable simply by running it from an Android device.
I am attempting to run my app in an emulator and have been receiving the following error:
Installation failed since the APK was either not signed, or signed incorrectly.
If this is a Gradle-based project, then make sure the signing configuration is specified in the Gradle build script.
I am attempting to run the app with a debug setting so signing the app should not be necessary as it will be given a temporary signature upon building.
This happens often when you install the same app generated on a different computer. Even the unsigned apk has a signature, so your phone is confused why you're trying to install something with the same package name that was generated on a different computer.
Go to your settings -> apps, then find the app in the list, and clear its data and uninstall it.
Then try installing again. That'll fix it.
This problem can be resolved by below two ways
Change Built Variant to debug
Define your application`s signingConfigs
First solution works when you built your application in debug mode. But, once you are ready to publish your application on Google Play store you need to go by second way.
Read for more -> Sign Your App
Hope this will help one and all!
I had this same problem occur last night. Running in debug, in my case the app had previously been installed from weeks ago, and I had deleted it, but I was still getting the error and couldn't install it again. I was able to resolve it by going into the AVD manager and wiping user data from there. After that installation and debugging went fine.
There may be already install current app with certificate
uninstall it and try again
I solved it more or less following the answer of Alex K above, but did not know where to look for 'settings' (total beginner!).
So go to the AVD manager (icon of mobile in toolbar) and click on the arrow on the far right, a small menu appears and here you select 'Wipe Data'.
You do need to first close the emulator.
What I tried:
Clean Project and Build again
Invalidate cache (File -> Invalidate Caches/Restart ...)
Reinstalled Debug certificate in case it expired
Cleared Gradle cache
Add signing process to Gradle
Went to settings -> apps in the Emulator and deleted previous versions (as explained in this thread)
Wiping Emulator data through AVD interface
Upgraded gradle version
None of those solved the issue.
In the end I executed the compilation/signing steps manually until I found the culprid: One of the file in my asset folder was 'Icon?' generated by MacOSX
In order to detect it I followed the instructions here to Build an unsigned APK and sign it manually:
https://developer.android.com/studio/publish/app-signing#sign-manually
When I ran step 3 (apksigner) I got an exception with message cannot sign apk because of file ..\folder\folder\Icon?
I understand that what was happening is that Android Studio did not capture the exception and tried to deploy the unsigned application onto the emulator.
Once I removed the file and tried again I no longer had the issue.
(quite a pain to find the root cause...)
So, step 1:
Run the standard check (clear cache..)
IF you have a MacOSX, check if one or multiple of your file is 'Icon?'
Step 2 - run the steps manually
If you still get this error in debug mode, follow these steps:
Clean your project
Run it again
This works for me on Android 2.2 Beta.