1. Are you ready for the Galaxy S20? Here is everything we know so far!

Client Not Ready

Discussion in 'Android Development' started by 23tony, Jul 22, 2019.

  1. 23tony

    23tony Well-Known Member
    Thread Starter

    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 (Text):
    1.  
    2. <?xml version="1.0" encoding="utf-8"?>
    3. <manifest xmlns:android="http://schemas.android.com/apk/res/android"
    4.     package="com.poc.justamap">
    5.  
    6.     <!--
    7.          The ACCESS_COARSE/FINE_LOCATION permissions are not required to use
    8.          Google Maps Android API v2, but you must specify either coarse or fine
    9.          location permissions for the 'MyLocation' functionality.
    10.     -->
    11.     <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    12.     <uses-permission android:name="android.permission.INTERNET" />
    13.     <uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
    14.  
    15.     <application
    16.         android:allowBackup="true"
    17.         android:icon="@mipmap/ic_launcher"
    18.         android:label="@string/app_name"
    19.         android:roundIcon="@mipmap/ic_launcher_round"
    20.         android:supportsRtl="true"
    21.         android:theme="@style/AppTheme">
    22.  
    23.         <meta-data
    24.             android:name="com.google.android.geo.API_KEY"
    25.             android:value="MY_API_KEY" />
    26.  
    27.         <activity
    28.             android:name=".MapsActivity"
    29.             android:label="@string/title_activity_maps">
    30.             <intent-filter>
    31.                 <action android:name="android.intent.action.MAIN" />
    32.                 <category android:name="android.intent.category.LAUNCHER" />
    33.             </intent-filter>
    34.         </activity>
    35.     </application>
    36.  
    37. </manifest>
    I changed only the activities. Here is what it was:
    Code (Text):
    1.         <activity
    2.             android:name=".MapsActivity"
    3.             android:label="@string/title_activity_maps"></activity>
    4.         <activity android:name=".WelcomeActivity">
    5.             <intent-filter>
    6.                 <action android:name="android.intent.action.MAIN" />
    7.                 <category android:name="android.intent.category.LAUNCHER" />
    8.             </intent-filter>
    9.         </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?
     

    Advertisement

  2. 23tony

    23tony Well-Known Member
    Thread Starter

    Logcat when I try to start:
    Code (Text):
    1.  
    2. 2019-07-22 18:42:53.659 21984-21984/? W/app_process: Unexpected CPU variant for X86 using defaults: x86
    3. 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
    4.     java.lang.IllegalStateException: Handler (android.os.Handler) {756a74c} sending message to a Handler on a dead thread
    5.         at android.os.MessageQueue.enqueueMessage(MessageQueue.java:545)
    6.         at android.os.Handler.enqueueMessage(Handler.java:661)
    7.         at android.os.Handler.sendMessageAtTime(Handler.java:630)
    8.         at android.os.Handler.sendMessageDelayed(Handler.java:600)
    9.         at android.os.Handler.post(Handler.java:356)
    10.         at android.os.ResultReceiver$MyResultReceiver.send(ResultReceiver.java:57)
    11.         at com.android.internal.os.IResultReceiver$Stub.onTransact(IResultReceiver.java:58)
    12.         at android.os.Binder.execTransact(Binder.java:674)
    13. 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?
     
  3. 23tony

    23tony Well-Known Member
    Thread Starter

    Code (Text):
    1. android:exported="true"
    does not help.
     
  4. 23tony

    23tony Well-Known Member
    Thread Starter

    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.
     
  5. Deleted User

    Deleted User Guest

    Have you tried using a full package name, rather than just ".MapsActivity" ?

    Code (Text):
    1.  
    2. android:name=".MapsActivity"
    3.  
     
  6. 23tony

    23tony Well-Known Member
    Thread Starter

    like com.poc.justamap.MapsActivity?

    Just tried that, same result.
     
  7. 23tony

    23tony Well-Known Member
    Thread Starter

    Argh, i think I figured out my problem.

    My MapsActivity declaration:
    Code (Text):
    1. 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 (Text):
    1. public abstract class BaseActivity extends FragmentActivity
    I'm trying to launch of a FragmentActivity. I'm pretty sure that's not allowed.
     
  8. 23tony

    23tony Well-Known Member
    Thread Starter

    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 (Text):
    1. package com.poc.justamap;
    2.  
    3. import android.support.v7.app.AppCompatActivity;
    4. import android.os.Bundle;
    5.  
    6. public class MainActivity extends AppCompatActivity {
    7.  
    8.     @override
    9.     protected void onCreate(Bundle savedInstanceState) {
    10.         super.onCreate(savedInstanceState);
    11.         setContentView(R.layout.activity_main);
    12.     }
    13. }
    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...
     
    #8 23tony, Jul 24, 2019
    Last edited: Jul 24, 2019
  9. 23tony

    23tony Well-Known Member
    Thread Starter

    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.
     
  10. 23tony

    23tony Well-Known Member
    Thread Starter

    AND finally

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

    Ya keep learnin', right?
     
  11. Deleted User

    Deleted User Guest

    When all else fails, try a clean build. It's the equivalent of "have you tried turning it off and on again" :)
     
    23tony likes this.
Loading...
Similar Threads - Client Ready
  1. Android News
    Replies:
    0
    Views:
    153
  2. Bledmuts
    Replies:
    0
    Views:
    284
  3. Bledmuts
    Replies:
    0
    Views:
    134
  4. Cyberdev
    Replies:
    0
    Views:
    225
  5. KorenRon
    Replies:
    0
    Views:
    220
  6. MikeyMikey123
    Replies:
    4
    Views:
    323
  7. Trom
    Replies:
    8
    Views:
    461
  8. Nadzimi43
    Replies:
    1
    Views:
    236
  9. Kantajit Shaw
    Replies:
    1
    Views:
    3,531
  10. tuntunzaw
    Replies:
    7
    Views:
    1,753

Share This Page

Loading...