android-emulator does not start - android

I used to be able to compile and run the project in the emulator of android-studio but I don't know which setting I have changed and now I am able to create the apk by using the assemble comand. However, whenever I press the "Run" button i get this error message: app-release-unsigned.apk is not signed. Please configure the signing information for the selected flavor using the Project Structure dialog. I don't care whether the app is signed or not, I just want the app to run in the emulator.

Related

After sending APK to other device, application crash

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

Android Build and Installation error: INSTALL_PARSE_FAILED_NOT_APK

Have these erro when i'm trying to build the apk to some devices. Have no idea whats going on.
I get that when i build and install apk on device at the first time.
Someone have some tips for that?
[[EDIT]]
Well, after creating a debug key on keystore, i can build and deploy the apk via ADP to the device. But, dont know why, the error just return...
And now, we have other error:
UPDATE:
I Fix that issue removing all Android SDK and Android Studio and ReInstall it.
The problem can be solved by addding the install flags -r -t in the Run/Debug Configuration Dialog like it's showed in the given image
You can find Run/Debug Configuration Dialog location here according to Jetbrains.
UPDATE: Depending on the Android Studio version the Run/Debug Configuration position in the IDE can be slightly different, but always refer Jetbrains to find whatever you are looking for
When you've installed an APK from another source, Android Studio warns you before overwriting.
For example, if I've developed an application, uploaded it onto the Google Play Store, downloaded it, then try to re-deploy that same application from Android Studio, I'll get this warning.
It's trying to tell you that the way the package is signed is different; it's warning you that another app might be masquerading as the original.
The reason is you are trying to install the application with the same package name.
If you have already downloaded the same application from the play store /app market, then simply uninstall that application and RE-RUN.
This error can also occur if you recently switched branch which had different build variants declared in build.gradle file and you didn't perform gradle sync.
For example you had release and debug and then you switched to branch which has releas, deubg and staging variants; your project will still build but while installing apk this error can pop up.

Android Studio: Installation failed since APK was not signed

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.

Mobilefirst application apk file not installing in real devices

i am using mobilefirst platform for hybrid application development.
I created an application in and created .apk file of this application:
Generated Android project folder -> Android tools -> Export unassigned application
I then copied this apk file to android device and try to install this .apk file. At this time its showing Application not installed.
It's properly working in simulator and browser.
What is the issue here?
The problem you are facing is due to the fact that you have exported an unsigned application, which is not intended for distribution purposes.
Try Exporting a signed application package, by following one of the following steps :
"Right click project -> Export -> Export Android Application"
"Right click project -> Android Tools -> Export Signed Application Package"
Both of the above methods will export a signed application file, used for distribution purposes.
You may also test your app on a real device by just connecting your device to the testing machine via a USB cable and then following step below :
Right Click on your Project root -> Go to Run As -> Select Android Application -> Now a popup is shown with all the active devices -> Select your device from the list
**
Newbie Guide to Export Signed Application and configuring keystore file in Eclipse :
"Right click project -> Android Tools -> Export Signed Application Package"
A popup as shown below would appear, if your project won't contains any erros :
Click Next
On clicking Next, you'll get a screen as shown below :
5.On this screen, make sure Create new keystore is checked.
6.Browse to the location, you want to create a new keystore at, and also add a password to access it later.
7.Then Click Next
8.On clicking next you'll get a screen as shown below :
9.Fill all the fields in this screen, (ONLY first five are mandatory), In validity fill the number of years this key would be valid for, then click Next.
10.On clicking Next you'll get a screen as shown below :
11.Browse to the location you want to keep for apk file in, and Click Finish, and you are done!
Hope this helps!
Did you try with a Signed application package rather than an Unsigned application package?
It could be that in your device settings (under Security) you have not allowed to install applications from Unknown Sources.
Enable support for Unknown Sources
Try again with an unsigned package
When you select Run As > Run on Android device", the application gets signed with the debug keystore supplied by Android, so it's still a "signed" package.

Android - Install signed apk via Eclipse

Good day.
I have an application and I recently wrote a code to make it update programatically by fetching the updated apk file on a server I host. I made the updated apk by changing the version code to version 2 and version name to 1.0.1 in the Android Manifest file. I also placed a textView in the first activity to know if it is the updated application or not. However, an issue I encountered while updating is that I get the An existing package by the same name with a conflicting signature is already installed error when Android tries to install the downloaded apk file. Since the error is about a conflicting signature, I guessed that whenever I install an application to my device (Nexus 7) from Eclipse, the application is not signed. What I did was that I Exported a signed copy of the version 1 of the application, moved it to my Nexus 7, and installed. From that signed application version, I tried to update and I encountered no problems.
However, this process is not efficient at all because if I want to debug my application to see if data stored like the database or sharedPreferences persist between app updates, what I'll have to do is to export my app, copy to tablet, then install. This does not allow me to use logCat efficiently - as the session filter won't work. The only way for me to see my logs is via the All Messages category and look for my tags.
So, my main question is: Is there a way to install a signed copy of your application via Eclipse so you can still debug efficiently via LogCat?
A secondary question: What happens to the private app data like the SQLite Database and the SharedPreferences when the application upgrades versions? Are they deleted?
When you debug (or run) Android will use the default store key for signing your application, and you can change it on Windows -> Preferences -> Android -> Build
Change your debug keystore there with custom debug keystore
Yes Its possible to install signed copy your application via Eclipse and you can still debug efficiently via LogCat.
Follow These steps.
1. Right click on your project from project list in eclipse.
2. Click Export.
3. Then select Export Android Application
4. Then select the project to export.
5. Click Next.
6. Then give the path of signing key (Keystore file). If you don't have any then create new keystore file by selecting Create new Keystore radio button on that Dialog.
7. Enter and confirm password and click Next.
8. Select Alias of Keystore file. which you have given while creating that file.
9. Enter password for that Alias and click Next.
10. Select the destination to export apk file and click finish.
It may take few minutes to build your app. Time depends on your application size.

Categories

Resources