I started developing an android app on my surface but then I decided to move the code to my stationary pc. I copied the whole source on a USB stick and pasted it on the other pc. I started the Android Studio and got an error dialog that it was warning me that the android sdk root path(that it was declared on the project) is not valid and I was propmpted to verify so the Android Studio points to the actual and correct path. After that, I built the project successfully and then I ran the app in the emulator.
I noticed first on the emulator that the app crashed on the deployment
and I saw on the run tab on the Android Studio :
The message “Client not ready yet..” is not the most indicative.
#What I tried and it did not work
Restarted the pc.
Deleted the app from emulator.
I did not add
android:exported="true"
on the MainActivity due to the fact that it had nested intent and it’s exported by default.I Cleaned the project and rebuilt it.
Went through AndroidManifest.xml but I did not find any error or “strange” setting that could explain this erroneous behaviour.
Solution
- I presssed Ctrl + Alt + S to open the settings of the Android Studio.I navigated to Build,Execution,Deployment>Instant Run I disabled the instant run.
I ran the app and it was deployed successfully on the emulator and was running wihhout any problem.
I enabled the Instant Run but i got again the same error.
Removed some comments from AndroidManifest.xml so I can trigger a full build. Instant Deploy builds and deploy only the incremental changes. It doesn’t reinstall the app, neither restart the app nor restart the Activity.
I clicked on the “Clean Project” and then on “Run app”. It was working now even with the Instant Run enabled.
Notes
*I had the same error when I tried to deploy the app on my Samsung S8.
*Android Studio Version : 2.3.3
References
This link is really useful. I learned a lot about Instant Run.