Unable to start activity

I have a problem with publishing application on google play. The application works without problems on your smartphone and tablet vertically and horizontally. However, google requires that before the publication of errors be fixed. Can someone explain what the problem is?


Process: com.android.phone, PID: 2408
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.android.stk/com.android.stk.StkMenuActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String com.android.stk.StkAppService$StkContext.getStkInstallerTitle()' on a null object reference
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2659)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2724)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1473)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6123)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:867)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:757)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String com.android.stk.StkAppService$StkContext.getStkInstallerTitle()' on a null object reference
at com.android.stk.StkMenuActivity.onCreate(StkMenuActivity.java:124)
at android.app.Activity.performCreate(Activity.java:6672)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1140)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2612)
... 9 more

Here is link to my apk file
Link removed by Chris Ward

Hello Darmet

Sorry but I have removed your link to an APK - that is not allowed on the forum for security reasons. You can if you wish upload your project file.

So you are saying that your own APK testing does not reveal the problem reported by Google Play? Have you tested on a range of devices and a range of Android versions?

Are you using any extensions? They may be out of date.
Are you using Activity Starter? The function syntax may be out of date.

Hello Chris,
I'm using Activity Starters with action "android.intent.action.VIEW" to open urls. I uploaded app to gallery, it's name "gwinty_metryczne_zwykle". Google says that the problem appears on the device Motorola Moto Z Droid
Android 7.0 (SDK 24)
3 840 MB

I'm newbie to creating applications and publishing on google play.

It would really help if you provided a screenshot of your relevant blocks, so we can see what you are trying to do, and where the problem may be.

To get an image of your blocks, right click in the Blocks Editor and select "Download Blocks as Image". You might want to use an image editor to crop etc. if required. Then post it here in the community.


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by Taifun.

No problem

That's a lot of buttons :upside_down_face: Not a part of the issue, but your App might benefit from using a single List View instead.

We can't convert the language of an image, so it's difficult for us to follow the logic of your Blocks. However, although you are setting ActivityStarter DataUri, I cannot see where you are setting ActivityStarter Action, which in this case should be:

... also, you are not catching potential errors that might occur, so if any do occur the App might lock/freeze/crash.

In general, the purpose of the application is that after clicking on the button with the thread size, the following values will be returned: diameter, thread pitch, diameter of the drill bit and outline height. Depending on the selection of the thread, one or two buttons (btnReczne, btnMaszynowe) appear for the threading die taps with which the thread can be made. ActivityStarters was dropped on screen.

  1. Did you get your activity starter fixed?
  2. Now I know what your App does, I don't understand why you launch the Browser - is it because you are using an online service for the calculations?
  3. The thread size selection would definitely be better from a ListView (or ListPicker) than all those buttons.

Ad. 1 Could you explain me how to do that? I was based on this example: https://www.youtube.com/watch?v=7SpFRFbwRu8 Do you mean to put "android.intent.action.VIEW" in the block and not in the "actions" field like here?

Ad. 2 Component "Web" is empty, I forgotten to delete it. I want use activity starter to redirect the user to filtered products (thread taps) in the online store.
Ad. 3 I'll work on it

I'm just editing a copy of your project right now, just to get it to work and show how to cut-out repeated code.

Your icon file must be PNG format (24bit colour) and either 96 x 96 pixels or 512 x 512 pixels.

A number of the Thread Size buttons set visibility:
btnReczne = False
btnMaszynowe = True

......... but others set both True or both False is this correct or simply unfinished?

OK :space_invader:

Here is an edited version of your project:
gwintymetryEdit.aia (783.1 KB)

  1. It uses a ListPicker instead of all the Thread buttons
  2. Block List holds the data (editable). This data has been extracted from your Project. It includes the visibility of btnMaszynowe and btnReczne
  3. The Activity Starter now works.
  4. If the Activity Fails, a Notifier is popped-up

Try it via the Companion on your Smart Phone as-is before modifying it if you require. I don't think the Google Issue is specific to the test device they mentioned, your Activity Starter was simply missing the action field.

Don't forget to fix your icon image - else that will be the next thing to fail with Google.

Hello Darmet

Any luck with this?

A number of the Thread Size buttons set visibility:
btnReczne = False
btnMaszynowe = True

......... but others set both True or both False is this correct or simply unfinished?

This is correct :wink:

Icon was made 96x96px .png (24 bit). ChrisWard thank you for your support. I will try to finish it tonight.

The application that you have changed is much simpler :grinning: but ... the url should depend on the choice of the thread size. For example, you have permanently assigned the url to the thread taps that will make the M3 thread. It should be that when I choose M8 thread, there should be a link to M8 thread taps (of course, I will generate this manually from the store). The links connected to the buttons should be changeable. And so I am grateful for the help.

Hi Darmet

I must have misinterpreted the intent there - lost in language translation. You can add the Url to the Blocks List of thread attributes and give the Activity Starter the URL via List Name and Index, just as the other values work.

Hi Darmet

So, like this.

When extracting from your original file, I found a number of URLs would be launched by the wrong button, so please check every entry carefully.

gwintymetryEdit_2.aia (783.4 KB)

Note, the following is not a text file, it's an HTML table. Rename it to .html to view in your Browser (easier to check than the App Inventor Blocks).
List_ThreadAtributes .txt (24.6 KB)

Hi Darmet

All done and dusted?