Is there any difference on building apk in Ubuntu vs Windows - android

I have issue. First I was use Windows10. I change my mind 1 years later and I using ubuntu. I building app-debug.apk in Ubuntu but not work on my devices. I encounter with two error Sometimes block by play protect, sometimes the package conflicts with an existing package by the same name. But when i open Windows10 and building app-debug.apk there is no issue Have you ever solution this issue?

Try disabling the instant run in android studio. It causes lot of errors.

Related

Android Studio generating correct app-debug.apk file but showing old version of code

I have an app that is build using React and is wrapped in capacitor. I was having no issues running the app in debug mode on android studio a month ago, or creating release files, but now I am.
I have checked the app-debug.apk (static/js/main.chunk......) file that is created when I select run, and it contains the updated code, I have sent the package to a colleague who ran the .apk on their machine and saw the updated code, but on my emulator and on my android devices, I am seeing an old version of the code.
I have removed all debug-release.apk files on my Mac and followed steps online such as clean build/rebuild, updates off mac, android studio etc but still no luck.
I am at a complete loss now.
Any ideas?
Thanks
Update: After much troubleshooting, we deleted the build folder android>app>build and the rebuilt the app, and ran it, and it fixed the issue.

Android Gradle plugin 3.0.0 update issue

After I've updated android project gradle version to 3.0.0 I've faced weird issue. When I'm trying to install my app with Fabric or send *.apk via email it says "App cant be installed" but when I work directly with IDE everything is fine.
I've already spent a lots of hours browsing all known gradle 3.0.0 issues, but didn found anything.
Maybe anybody faced similar issue?
P.S. sorry, there is no match code to share, because I think its not related on configurations, cause it works via Android Studio.
Maybe anybody faced similar issue?
Yes, and I blogged about it a couple of days ago.
If you are going to distribute the APK, build the APK explicitly for that role, such as:
Using the “Build APK(s)” menu option
Using the assembleDebug or assembleRelease Gradle tasks
The APK from an IDE build now has FLAG_TEST_ONLY set, and such an APK cannot be installed normally. adb install -t will install it, but that would require the recipient to have the Android SDK.
Adding to CommonsWare answer, there is one more issue.
You might enabled Instant Run. One major drawback of this feature is, you can not use apk for other device (other than the device which you are using for development).
If so, after disabling this feature you will be able to use created apk (debug apk) to other device also (by using unknown sources option or adb option)

Phonegap Unable to Install the apk file on android

I have recently got the following error while installing PhoneGap build apk on phone or emulator
pkg: /data/local/tmp/android-debug.apk
Failure [INSTALL_FAILED_UPDATE_INCOMPATIBLE]
Then I found the reason for it is due to signatures of the build app So then I uninstalled my android studio and Updated my Node js. Now I can install it on Emulator but not the phone Still I am getting the same error.
I have already gone through the solution available on the Internet including INSTALL_FAILED_UPDATE_INCOMPATIBLE when I try to install compiled .apk on device
With help of available solutions, I can install in Emulator but not in my when phone and I don't have any previous versions of the app to uninstall the app
Still, I have no clue how to solve this error.
Please help to how to solve it.
Yes, I solved my Problem.
The problem If you have Android Studio, and PhoneGap installed in the same system the Signature key Generated by Android Studio will make your build app by Phonegap, leads to the problem mentioned above. To solve this one, Uninstall all the Android studio, Phonegap New Desktop application, and CLI and reinstall only PhoneGap then the problem is solved.
Hope this helps you.

Failure to install APK [INSTALL_FAILED_DEXOPT] Android Studio

I have tried literally everything to try and rectify this error when trying to deploy an app to an actual android device for debugging but have been unable to solve the matter. Everytime I try to launch I get a failed [INSTALL_FAILED_DEXOPT] error and when checking the logcat it is always because there is no classes.dex in my debug apk.
If I run gradlew.bat clean assembleDebug, there is no difference in the apk size so I'm assuming there is a build error in android studio. I am using android studio beta 0.86 and have tried it on 0.89 with the same result. I have tried build tools for 19.1 to 21 with no result. I have also tried different devices and created a new project (that has never been installed on my devices) and android studio seems to think it needs to be uninstalled first when attempting to deploy.
I have tried switching my device to ART, uninstalling and reinstalling android studio, redownloading the sdk and restarting my computer. NOTHING and I mean NOTHING has worked. I think the problem started after I downloaded the lollipop apis but am not sure. I have tried uninstalling all apps with my package signature on my device but NOTHING works! Not even Project -> Clean Project -> Rebuild
This is extremely frustrating as I cannot debug my apps anymore :/ has anyone had any experience with this error or ways to rectify it?
So turns out that the issue was mismatching sdks between Android Studio and the Project. The project was using an old sdk and once I made them the same, I cleaned and rebuilt the project and everything was good to go.
UPDATE:
I ran into the problem again after I tried to update my SDK and its tools. Turns out that when you try to do this, the SDK locks the tools folder and then you get an error saying some file couldn't be overridden. When this happened to me, all the build tools were deleted so there were errors in the .dex file created when debuggin my app.
We are using android 2.2 (really old i know) and couldn't find a fix for this error. Eventually we found this bug https://android-review.googlesource.com/#/c/30900/. The only solution for us was to remove some libraries...
I kept having the same problem - manually building worked fine, but Android Studio would not build a proper APK.
The problem was that I started the project on Android Studio and Android Gradle plugin version 2.0-beta2. After updating the Gradle plugin to 2.0-beta6 through a simple build.gradle change, the builds stopped working.
Turns out that, although I installed a beta version of Android Studio, the update checker only checked the stable channel. After setting the updater to check the canary channel as well, I was able to upgrade Android Studio to version 2.0-beta6 and builds continued to work normally.
You can change the update preference in Android Studio settings under Appearance and Behavior -> System Settings -> Updates.
I encountered this error when storage of the device is full. Try to open some space.
Try run these commands
adb reconnect
adb reconnect device

Android studio running app on Huawei G700 hangs at Uploading file

I know Android Studio is currently in beta, but still maybe somebody has a solution to this. Similar to Android studio running app on Samsung Galaxy S3 hangs at Uploading file I have issues when trying to run my app. It doesn't actually matter if its the physical phone or the android emulator.
I've tried with my app and a new empty project: same result. After compilation it tries to upload the app and just gets stuck. I've tried re-installation of Androidstudio and rebooting. Fun fact: on my laptop everything works just fine.
Any more ideas would be appreciated.
So actually it looks like something with the Platform tools was going wrong. A delete and install in the SDK Manager solved my issue. Weird, that the tools coming with the studio bundle are broken on my system.
Go to build and Rebuild your project. It will solve the problem.

Categories

Resources