Not able to install .apks via adb

2019-07-29 08:20发布

I have been working on a particular Android application for sometime and have been able to run these apps via Android Studio quite fine before but since applying a recent update I have not been able to run the app via Android studio because of the following error:

android.os.TransactionTooLargeException
Error: Could not access the Package Manager.  Is the system running?

I have tried to troubleshoot this issue by connecting via a different TCP/IP instead of through USB (thinking it was a cable fault of sorts), reinstalling ADB, removing the ADB driver and restarting Android Studio, and all of the above yielded the same error when trying to run the app from Android Studio.

The update that was applied was the addition of the YouTube Android Player to a fragment. The fragment that contains YouTube Player was added to FragmentManager of the parent Activity during the onCreate method of this fragment. Could this be the problem? Or am I looking in the wrong place

Any insight would be appreciated.

2条回答
对你真心纯属浪费
2楼-- · 2019-07-29 09:10

I'm not sure, but check if this works.

menu>> tools>>Android>>Enable ADB integration check it

查看更多
虎瘦雄心在
3楼-- · 2019-07-29 09:16

You may have gotten this error while attempting to run an Android application on an emulator or device using Android Studio. The most common cause of this error is simple as stated in this link: You have to manually unlock your Android Virtual Device by swiping the "lock" icon on the screen. Security measures prevent the emulator from letting you connect the debugger before doing this. Make sure also that you are running Android Studio version above 0.3.2 or the latest version. There was some issue reported in AS 0.3.2. You can update it from Help >Check for update.

Found this thread which states that it might be an issue with your emulator not with Android Studio. Maybe you are trying to install application before even the emulator started properly. Wait till the home screen appears in the emulator before trying to install any application.

Also try to install any apk in Emulator from command line

Steps to install

  • Go to $Android_SDK_DIR\platform-tools, right click there keeping shift key pressed and Chose "Open Command Window here".
  • Run command adb devices to make sure yout emulator is running properly. It will show all your running emulators.
  • Now if emulators are showing properly, type the command adb install YOUR_FULL_APK_PATH , YOUR_FULL_APK_PATH is of any .apk file path in your system.

You need to wait for the emulator to full start which may take a few minutes. Once it is fully started (UI on the emulator will change), it should work. You will need to restart the app after the emulator is running and choose the running emulator when prompted. You can check on this bug report the full details.

Hope this helps!

查看更多
登录 后发表回答