I've finished the v1.0 of my app and I would like to install it on my phone for daily use (I'm following the docs here).
I built the apk using flutter build apk --split-per-abi
I then connected my phone* to my pc and ran flutter install but got "No target device connected".
Do I have to follow the steps given in this answer, even if I just want to install the release version of the app?
Does it have to do with my phone being a Huawei?
Also, I've not gone through the steps of signing my app as I don't intend on publishing it.
*Huawei P30 running Android 10
Related
I have an app on Google Play Store. I rewrote that app on Flutter but not published yet. I don't want users to lose their data on update. To solve this I want to write a conversion system but I need to be able to reach old database when Flutter app launches.
Android system doesn't allow two different app with same package name installed. When I try to install Flutter app on a device that has Native app, Visual Studio debugger gives [INSTALL_FAILED_UPDATE_INCOMPATIBLE] error. It uninstalls Native app and installs Flutter app so I won't be able to reach Native app's sqlite database.
Also the reason why I use the Google Play version is I lost my old project's latest update files. There is no fraud no worries :)
What I tried:
Make Flutter app's package name same as Native app's.
Sign debug version with Native app's keystore file.
Give Flutter app a higher version than Native app.
After steps I did above, first build stuck at Running Gradle task 'assembleDebug'.... Output stays like this (I waited several times, maximum for 30 mins):
Launching lib/main.dart on sdk gphone64 arm64 in debug mode...
✓ Built build/app/outputs/flutter-apk/app-debug.apk.
If I clean project, it builds in 30 seconds but uninstalls Native app with this output:
Running "flutter pub get" in projectname_2...
Launching lib/main.dart on sdk gphone64 arm64 in debug mode...
✓ Built build/app/outputs/flutter-apk/app-debug.apk.
Error: ADB exited with exit code 1
Performing Streamed Install
adb: failed to install /Users/xxxxxx/projectname/build/app/outputs/flutter-apk/app.apk: Failure [INSTALL_FAILED_UPDATE_INCOMPATIBLE: Package ataberkw.projectname signatures do not match previously installed version; ignoring!]
Uninstalling old version...
W/FlutterActivityAndFragmentDelegate(11073): A splash screen was provided to Flutter, but this is deprecated. See flutter.dev/go/android-splash-migration for migration steps.
Connecting to VM Service at ws://127.0.0.1:58745/lUE5l2_VlN4=/ws
I realized that Google Play has it's own signature system additional to your keystore signing. Things may not exactly what I said but consequently apks Google Play and apks signed with your keystore doesn't have the same certificate. After this realization I came up with a solution.
Install the app from Google Play Store.
adb adb shell pm path ataberkw.packagename to get path of base.apk.
./adb pull base-apk-path destination-path to get base apk
Rename base.apk to base.zip and open it.
Delete META-INF folder inside base.zip and rename it to base.apk back. Now you have unsigned apk.
I used this automatic apk signer but you can use manual ways too.
Reproduce the data at Native app and now you can install signed (use same jks file) Flutter app without need of uninstall.
Have you checked your app's applicationId's? If they are the same, that might make OS think that you are installing the same app again.
In Flutter, your applicationId is located in android\app\build.gradle file. You can address here for documentation.
As I have stated in the title I'm struggling with .apk I cannot install application on my phone I'm getting app not installed. But when installing via usb I'm able to install application on the emulator phone. It’s always showing App Not Installed on mobile phone.
When I run application via AndroidStudio to USB the application has been installed. I do not know where I should looking for issues. May be someone had the similat issue.
There are two things you can try:
First of all build your apk by Build/Build Bundles/Build APK and not just by creating apk as a side effect of simply running the app under Android Studio
Make sure no other flavors are installed on your device - sometimes devices offer "Uninstall for all users" - that's what you should be looking for.
I made an Android app using Android studio, deployed and ran it directly by using my mobile running Oreo.
It installed successfully. But later I tired to share the APK from my mobile to other mobiles. But none of them are able to Install it.
However, if I build the APK and share the app-debug.apk to other mobiles. It Installs successfully.
I can't build APK and share app-debug.apk it everyone.
I usually deploy it in my mobile, share APK(which used to work before)
Can anyone please help
Please excuse typos, I have typed from mobile.
There might be a signing issue. Is your app signed? The default signing is the debug signing. When you just build and deploy or run it on a connected device, it is signed by default as a debug sign.
If it is not uniquely signed, then running or installing on other devices might not be possible. Look at the app signing instruction and guide by Google, here, if you wish to distribute your app on other devices.
Another problem might be in the security authorization of other devices. Your device on which you are building has the developer options turned on. To run and install unsigned apps you'll need to activate the developer options in the device you want to run it on. Look at this link about Developer Options and how to turn it on.
by default the Android Studio packages just the needed files and installs the app in your mobile. If you share to other mobiles, the app will not install in few devices due to a few reasons like OS version, files mismatch, SHA keys mismatch, etc.
However, if you build the APK and share, the APK is equipped to be installed in any device starting from the minimum SDK version to the target SDK version.
I want to create an Android wearable app on Android studio. I have installed the apk file on mobile to test run it. I would like to know how I can run the same apk on wearable device.Also, apk file created on Studio is different for wearable and mobile devices. How can we run it? Thanks in advance!
As it mentioned at official website you need to create special package signed by release key. See more info about packaging here.
When developing, you install apps directly to the wearable like with handheld apps. Use either adb install or the Play button on Android Studio.
Note: The automatic installation of wearable apps does not work when you are signing apps with a debug key and only works with release keys.
During the development period, do not use release key for signing. Instead, you should build your app which would result in two apks, one for the phone and one for the wear device. Then install each of them separately on the corresponding device using adb or Android Studio. Make sure you are using the same package names for both apks.
When you are done with your development, then build the app with your release key; then the wear apk will be embedded inside your phone apk and installation of your phone apk on a phone will result in the installation of the embedded wear apk on the wear device (make sure you remove the dev apks from both devices prior to this step otherwise installation will fail due to different keys).
Trying to debug through Android Studio as suggested by Julia and Ali, but it is always showing me Parse error while installing or running the code.
I have created a project for both mobile and wear. While running for mobile it works fine in the mobile device but while running the code in the wear it always shows Parse error.
I am using Moto 360 for running and debugging.
My problem is like application working in emulator and the same apk is not working in device(getting application not installed message).
My application using libraries such as twitter,cordova etc.
If am building the same code in previous developer machine then that apk is working in device.
I am using windows 7 enterprise edition 64 bit.
Please suggest me some solution.
I had this error and I had to sign the .apk before installing it on a real device. You can read about it here