• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Frits Walraven
Bartenders:
  • Carey Brown
  • salvin francis
  • Claude Moore

Running the first Hello World Application (Kotlin)  RSS feed

 
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I tried to run hello world program using tutorial kart. The link is:
Android Programming usingKotlin Tutorial

It does not ask to write any code nor does it ask for altering any built in code. I ran it by connecting both by mobile phone and using emulator.
Error log when connected to mobile ph:
“Session app” Error installing APK
Error log file shows :
12:30 PM Gradle build finished in 21s 332ms

12:33 PM Instant Run is not supported on devices with API levels 20 or lower.
(Don't show again)
12:33 PM Executing tasks: [:app:assembleDebug]
12:34 PM Gradle build finished in 1m 33s 345ms
12:34 PM Session 'app': Error Installing APK

Error log file when connected to emulator:
Error log file while running using an emulator (visual studio android 23 arm ph)
12:34 PM Session 'app': Error Installing APK

12:44 PM Executing tasks: [:app:assembleDebug]

12:44 PM Emulator: emulator: WARNING: UpdateCheck: Failure: Error

12:45 PM Emulator: Process finished with exit code -1073741819 (0xC0000005)

12:46 PM Gradle build finished in 2m 0s 438ms

Also another run:
12:57 PM Executing tasks: [:app:assembleDebug]
12:57 PM Emulator: emulator: WARNING: UpdateCheck: Failure: Error
12:57 PM Gradle build finished in 10s 856ms
12:58 PM ADB rejected shell command (getprop): closed
12:58 PM Emulator: Process finished with exit code -1073741819 (0xC0000005)
Files:
activity_main.xml

main_activity.kt
package com.example.hp.kotlinandroiddemotk

Some body please guide me.
Zulfi.
 
Bartender
Posts: 1868
81
Android Chrome IntelliJ IDE Java MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Looks like from the supplied stacktrace that issue you are experiencing is related to "Instant Run".
You do not need to have this feature enabled and some devices do not.

You stated that you ran this on both an emulator and a physical device, what versions of Android were you running?

You may not be aware of this, but Google supplies free tutorials on Android development which can be found here https://developer.android.com/guide/.
Google has supplied not only the instructions on how to get started, but usually the code needed and a functional sample project.
You may need to update the project to use newer versions of Gradle, but the process is the same for all of the projects that need it.

Google has even provided Kotlin code and project resources.
 
Pete Letkeman
Bartender
Posts: 1868
81
Android Chrome IntelliJ IDE Java MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I just noticed this line:Are you using Visual Studio when following along with the tutorial that you initially posted?
If there, there very well could be an issue with Visual Studio and you may get better/different results with Android Studio.
If you are choosing to stay with Visual Studio, then which version and edition of Visual Studio are you using?
 
Zulfi Khan
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Pete Letkeman,

I am using Android Studio 3.3. I am getting emulator error: 0xc0000005 which is discussed here
How to fix application error 0xc0000005

I am attaching a picture which would tell you the version. I am also attaching 2 pictures caught during running of application.I am not running visual studio along with android studio but I choose the emulator "visual studio android 23 arm ph
android-version_coderanch.jpg
[Thumbnail for android-version_coderanch.jpg]
Run1-screen.jpg
[Thumbnail for Run1-screen.jpg]
Run2-screen.jpg
[Thumbnail for Run2-screen.jpg]
 
Zulfi Khan
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Visual studio's version is VS2017

Zulfi.
 
Pete Letkeman
Bartender
Posts: 1868
81
Android Chrome IntelliJ IDE Java MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm using the same version of Android Studio, so I do not think that is the issue.

Here are a few things that you could try out:
- Create a simple "hello world" app using only Java code.
- Make sure that your environment variables are set up correctly as noted here https://stackoverflow.com/questions/16582107/android-studio-doesnt-start/28472229#28472229.
- Do not use Visual Studio's Android images, but use Android Studio's Android images.
- Update your Android SDKs, if  there is a update to be had that is.
- Try different Android versions like 5, 5.1, 6 etc to see if you get the same result.
- Some people have experienced issues with anti-virus software including Windows Defender. So try temporarily disabling them while running Android Studio.
- How about your system? Over all is it running as it should? Have you recently run a spyware and adware and virus check? This could be part of the problem.
- DANGER/WARNING: You could try the non stable channels of Android Studio, but this may cause problems as well.
 
Zulfi Khan
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I was trying to execute the android application at the following link:
Install Android Studio and Run Hello World

After step 14, it shows a figure which does not match with mine. Is this a problem? What should i do?

Kindly guide me.

Zulfi.
mismatch-with-fig.jpg
[Thumbnail for mismatch-with-fig.jpg]
 
Zulfi Khan
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Number 3 component is not matching.

Zulfi.
given-fig.jpg
[Thumbnail for given-fig.jpg]
 
Pete Letkeman
Bartender
Posts: 1868
81
Android Chrome IntelliJ IDE Java MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
All is fine. In the example provided on the web the person selected the MainActivity class in Android Studio. In the picture provided by you, you have not.

Have you tried the HelloWorld app walk through provided by Google which can be found here https://developer.android.com/training/basics/firstapp/ ?

If you are looking for a learning resource you may be interested in know that Google provides a number of tutorials for Android developers for free along with the required source code found here https://developers.google.com/training/android/.

Were you able to get past the problem which you posted previously regarding Kotlin?
 
Ever since I found this suit I've felt strange new needs. And a tiny ad:
Create Edit Print & Convert PDF Using Free API with Java
https://coderanch.com/wiki/703735/Create-Convert-PDF-Free-Spire
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!