• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Client Not Ready

23tony

Well-Known Member
I just tried to change my launch activity and I am now getting a "Client not ready" error when I try to launch.

Here is my manifest:
Code:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.poc.justamap">

    <!--
         The ACCESS_COARSE/FINE_LOCATION permissions are not required to use
         Google Maps Android API v2, but you must specify either coarse or fine
         location permissions for the 'MyLocation' functionality.
    -->
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">

        <meta-data
            android:name="com.google.android.geo.API_KEY"
            android:value="MY_API_KEY" />

        <activity
            android:name=".MapsActivity"
            android:label="@string/title_activity_maps">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>

I changed only the activities. Here is what it was:
Code:
        <activity
            android:name=".MapsActivity"
            android:label="@string/title_activity_maps"></activity>
        <activity android:name=".WelcomeActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

I made that change, and deleted the layout & code for WelcomeActivity. I also changed the configurations, once to explicitly define MapsActivity as the launch activity, and once setting it to default. Same result both times.

If I put everything back, it works fine.

Obviously I'm doing something wrong, but I'm not seeing it. Anyone have any ideas?
 
Logcat when I try to start:
Code:
2019-07-22 18:42:53.659 21984-21984/? W/app_process: Unexpected CPU variant for X86 using defaults: x86
2019-07-22 18:42:53.676 21984-21992/? W/MessageQueue: Handler (android.os.Handler) {756a74c} sending message to a Handler on a dead thread
    java.lang.IllegalStateException: Handler (android.os.Handler) {756a74c} sending message to a Handler on a dead thread
        at android.os.MessageQueue.enqueueMessage(MessageQueue.java:545)
        at android.os.Handler.enqueueMessage(Handler.java:661)
        at android.os.Handler.sendMessageAtTime(Handler.java:630)
        at android.os.Handler.sendMessageDelayed(Handler.java:600)
        at android.os.Handler.post(Handler.java:356)
        at android.os.ResultReceiver$MyResultReceiver.send(ResultReceiver.java:57)
        at com.android.internal.os.IResultReceiver$Stub.onTransact(IResultReceiver.java:58)
        at android.os.Binder.execTransact(Binder.java:674)
2019-07-22 18:42:53.825 1666-2895/? W/ActivityManager: Permission Denial: starting Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.poc.justamap/.MapsActivity } from null (pid=22009, uid=2000) not exported from uid 10083

So I see what the problem is, I think. Now, what to do about it?
 
Bump

Has anyone successfully changed your launch activity? I really don't see what I'm doing wrong here, and I've exhausted everything I can find on SO & with various searches.
 
Have you tried using a full package name, rather than just ".MapsActivity" ?

Code:
android:name=".MapsActivity"
 
Argh, i think I figured out my problem.

My MapsActivity declaration:
Code:
public class MapsActivity extends BaseActivity implements OnMapReadyCallback {

BaseActivity implements a callback for my HTML loader functions. I've used this in a few apps I've been working on. Usually, BaseActivity extends AppCompatActivity, but this time:
Code:
public abstract class BaseActivity extends FragmentActivity

I'm trying to launch of a FragmentActivity. I'm pretty sure that's not allowed.
 
At this point I think I'm just sharing my experience. Hopefully this might help someone in the future.

So I created a new activity MainActivity. For the moment, I just put a text box in it saying "hello", and now I'm getting "Error: Activity class {com.poc.justamap/com.poc.justamap.MainActivity} does not exist.

Here is the full code, the default that was created:
Code:
package com.poc.justamap;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;

public class MainActivity extends AppCompatActivity {

    @override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }
}

This post helped some: https://stackoverflow.com/questions/20915266/error-type-3-error-activity-class-does-not-exist

After cleaning, deleting, and restarting, the next issue I encountered was "app-debug.apk does not exist". Seems just running a build fixed that.

Then, "Waiting for Debugger".

I finally resolved THAT issue by rebooting (cold boot) the emulator.

This was a bit of an adventure...
 
Last edited:
That didn't work.

First of all, turns out that AppCompatActivity also extends FragmentActivity, so that couldn't have been the problem.

Second, now my MainActivity simply isn't being executed. When I set a breakpoint on super.onCreate, it tells me "No executable code found..."

I'm wondering if it might be simpler at this point to scrap it all and start over as a new project.
 
AND finally

Don't know what made me think of this, but I hit "Make", and suddenly everything is working.

Ya keep learnin', right?
 
When all else fails, try a clean build. It's the equivalent of "have you tried turning it off and on again" :)
 
Back
Top Bottom