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
Related
I have an app that I developed wow like 8 to 10 years ago, but I have been updating it constantly at least once a year or so.
I'm actually in the process of completely redoing the app from scratch, and it's working great when I run it on my Android from my computer, but when I build it with a signing key on PhoneGap Build, I get the error message "App Not Installed." when I try to install the apk.
I've read through several other posts on the topic and I can attest:
I have plenty of storage space on the phone.
The new version number is larger than the old version number.
The signing key is the same as the original version.
I do not have any version of the app currently installed on my phone.
Any other ideas on what may be causing this?
I've removed all my plugins to take that out of the equation, but I still get the same error.
The original app was build with OnsenUI and Cordova.
The new app is build in Ionic 5.4.16, Cordova 9.0.0, and Android 8.1.0.
Something else I have noticed is that if I change the app id (com.company.appname) to anything else (i.e. com.company.appnamedev), it installs. I feel like this is very indicative of the issue, but I don't know what to do with it.
Very much appreciate any guidance to finding the problem.
Unfortunately this isn't going to be the answer many of you solution seekers are hoping for, but I got it to work. Based on Mike N.'s suggestion, I attempted to sign it locally and push it to my device with adb. In doing that, I was having trouble with remnants of two older plugins (onesignal and admob) that I had already removed from my config.xml file.
I'm really not sure why, but after I got rid of those old pieces in my package.json, I attempt to push it to phonegap build again and it was able to install. So, I guess the solution would be to make sure you have fully removed any plugins that may be causing problems.
Now the big trick - adding these pieces of functionality back in. But, the app compiles on PhoneGap Build and the signed file installs on my device now.
UPDATE: So, it turns out this is directly related to the one signal plugin I'm using. Still figuring out why, but when I added it back in, it works great locally, but when I attempt to build with PhoneGap Build and load it to my phone, I get the error "App Not Installed." At least I know what's causing it now.
I finally figured out the root of all my issues. As it turns out, I had another half baked app I started and had on my phone under a different name and app identifier, but I had temporarily dropped the same google-services.json and GoogleService-Info.plist files into that other app that I use for the one in question here.
After employing Mike N's suggestion, I got the error:
adb: failed to install mynewapp.apk: Failure [INSTALL_FAILED_DUPLICATE_PERMISSION: Package com.company.new attempting to redeclare permission com.company.new.permission.RECEIVE_ADM_MESSAGE already owned by com.company.old]
I uninstalled the old app that should not have had those files to begin with and everything installs and works great now. Hopefully this helps someone else out who encounters the same bizarre situation.
You can use My APK application and installing an apk using My APK Installer (MAI).
If there is an error, it will show the detail (like duplicate permission, provider, mismatch signature,...)
I looked at other solutions for the above problem, but none of them seem to resolve my issue.
I am running AS 3.5.2, under Help/About/Check for new versions everything is showing as fully updated.
I am using Windows. When I plug my phone into my computer, it runs the latest updated version.
When I Build APK(s) under Build menu, and then install that version onto my phone, it is an old version.
Up until about 2 weeks ago it was building APKs fine, and today after making a few code changes (been 2 weeks about since I last made changes), it now has this issue.
What I've tried:
1. build.grade (app) - changed the version code and name to 2 from 1
2. Build menu - clean & rebuild project
3. Checked for updates and updated as needed
4. Run/Debug configurations - confirmed Gradle-aware Make is present (even removed then re-added)
So to add some more information. It turns out the Android Studio IS making the correct version. However, my phone just isn't loading it from the APK. This is what I have done:
I created a new version, 1.07, and with my phone plugged into my computer, it correctly runs this version on my phone, even when I unplug the phone and restart the newly installed app on the phone. I then navigated to the APK stored on our intranet (previously saved there as described earlier in this post), downloaded it and installed it on my phone. It has now reverted to v1.06 strangely. So on a different phone that had an older v1.04, I also downloaded the app from the intranet and installed it, and it showed v1.07. This shows that the APK WAS indeed correctly created. Then on a 3rd phone where the app was never previously installed, I installed it from the app, and it was v1.07. Again, correct version.
I then went to my 1st phone again, went into settings, went to the apps, and deleted the cache and data, then uninstalled it from my phone. I then went to downloads and APK's and deleted all previously downloads. So theoretically no trace should be left on my phone.
I then again downloaded the APK, and it is again v1.06!!!
I plug my phone into the PC (to use as the emulator) and it then correctly installs the correct v1.07 onto my phone.
What is happening...!!!? It is almost like it reverts to the previous v1.06 when I do a manually download and install of a v1.07 APK, but where is the v1.06 even coming from? Does the phone keep a history of the app versions?
Please help me make sense, and how to get it working. This app is for about 300 people in our company, hence me distributing the app over the intranet as a link.
Although this method is a bit vague and old fashioned, but it still works.
Step One: Run your android device as a virtual emulator.
Step Two: Run main.dart in your android device. This will install the app in your device.
Step Three: Go to Play Store and install this app called APK Extractor.
Step Four: Extract your APK from the app.
The APKs created through this are smaller and more efficient as compared to the ones created using Android Studio and work pretty well.
Last week I created a new Ionic4 project and wound up having to rip out everything but Android Studio to exorcise version incompatibilities in the build tools. That seemed to fix everything. However, after sending a client a third or fourth debug-signed APK, he reported he couldn't install it. ADB installed it on my tablet just fine, but it couldn't be installed from a webpage or the file system. Since then, some releases have installed, some not.
Investigating with an APK extractor turned up nothing unexpected.
Then I generated a new Ionic project from the sidemenu template, changed the widget ID to a unique name, and changed the homepage a bit. Nothing that should cause an install fail. And it failed!
LogCat showed an install error -22, but nothing more helpful. Turning off the Security Scan option within Play Protect does allow the app to install. If you turn the scan option back on and force a scan, it oddly doesn't complain about the "unsafe" app. Searching Google hasn't turned up any explanation.
Anyone else run into this? Telling clients to turn off security doesn't look great.
I built an android application and signed the apk following all the steps on this tutorial. Even though the APK builds successfully after installing it on a mobile device it fails to load. I only get a white blank screen. I've searched for solutions and tried most of the suggestions but with no luck.
I then decided to start the project from scratch and guess what? the problem still persists. What could I have possible done wrong? I don't really know where to look because I don't even get an error message.
Please help???
I would try debugging that with a tool like GapDebug (https://www.genuitec.com/products/gapdebug/). I would:
Download and install GapDebug.
Attach your device to your PC/Mac via a USB cable.
Deploy your APK to the device and run it.
In GapDebug, choose your app as the app you want to debug.
At this point you may already see one or more errors showing up in the GapDebug console. If not,
On the device, restart the app.
Check the GapDebug console for errors.
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.