02-18 00:02:08.432: ERROR/PackageManager(57): Package com.example.brown requires unavailable shared library com.google.android.maps; failing!
I got this exception in logcat.
Can anyone guide me?
As CommonsWare said, your emulator is missing the library. The Google Maps Library's documentation's Overview page has info on how to create the right kind of virtual device for the emulator. The gist is:
Launch the AVD Manager by using the android command without any options. If you are developing in Eclipse/ADT, you can also access the tool from Window > Android SDK and AVD Manager.
Click the "New" button to begin creating a new AVD.
In the dialog that appears, specify a name for the AVD and select the system image target that you want the AVD to use. Select one of the "Google APIs (Google Inc.)" targets, making sure to choose a version whose API Level matches the android:minSdkVersion attribute in your application's manifest, as described above.
Configure the other options and then click "Create AVD".
Once you've finished creating the AVD, you can run it from the AVD Manager UI or you can use the emulator's command-line interface. If you are developing in Eclipse, you can configure a Run Configuration to start the AVD and install your application on it.
For more information about AVDs, see Android Virtual Devices on the Android Developers site.
I had the similar problem on a real device. After a loot of googling I found this answer
fixing missing shared library. It turns out that on some custom roms the comp.google.android.map library is missing, you have to install it manually.
download googleapps
extract two files
system/etc/permissions/com.google.android.maps.xml
system/framework/com.google.android.maps.jar
remount the /system filesystem rw (mount -o rw,remount /system)
copy the files in
do a chmod 644 on them
reboot
This error occurred to me on an actual device, not an AVD like the other answers. In my case I was running on a Nexus S with a custom ROM that did not have Google Maps installed.
I have read elsewhere that the com.google.android.maps shared library is bundled with the ROM itself and is not bundled as part of an APK.
Therefore the solution for me was to revert to the stock ROM which had Google Maps installed.
BTW, the title of this thread refers to an error that is found in the DDMS LogCat. The first error most users will see (before checking LogCat) will be in the console of Eclipse:
Installation error: INSTALL_FAILED_MISSING_SHARED_LIBRARY
Please check logcat output for more details.
Your emulator is missing the Google APIs. Create a new AVD that contains the Google APIs, and this error should go away.
As jfritz42 I got this error on a real device with a custom ROM (Cyanogenmod). The error was caused by the fact that I did not install the Google Apps package, since it contains a lot of apps that just annoy me. However, there is a solution how to install the google.maps library without massing up your system with the 19 Google Apps in this package. Just download the package (zip file) and remove all .apk files from system/app in this zip. Afterwards, you can install the zip by using the ROM Manager or via the recovery mode. Then you should have the maps library installed on your system. The Google Apps included in this package (e.g. the Maps app) can be installed separately afterwards.
In case with real device try remove from manifest file:
<uses-library android:name="com.google.android.maps" />
I've experienced this error after the AVD was set up properly and working okay. The AVD was still using the Google APIs and I could see the reference to the maps library in Eclipse. The only way I found to resolve this was to delete the AVD and create a new one, as advised by fiXedd.
fiXedd (see above) is correct.
You can edit devices you have already created or create a new one. When you create or edit a device inside the AVD Manager, instead of selecting this kind of version target:
Android x.x.x - API Level x
Simply use this kind instead:
Google APIs (Google Inc.) - API Level x
Related
I am trying to to run a application on my android device. The issue is that I get the PAClient error E0002 From my understanding profile names are only needed when running apps on Remote Devices, which I'm not doing. There are no profiles created for the PAClient and even if i try to create one the only option is Widows 64 and 32-Bit
I recently reinstalled the Android Common Files from Tools -> Manage Platforms. That could have something to do with it. I know there is another post here, but that post has no working answers.
Also here are my computers environment variables
My platform selector
So how do I fix this error?
The Answer:
The PAClient Error was caused by a compatibility issue with the device in question and the Android SDK Installed the computer.
To fix this issue go to C:\Users\Public\Documents\Embarcadero\Studio\21.0\CatalogRepository\<Your Installed SDK>\ open SDK Manager.exe, remove the SDK installed (Ex: Android 10) and install the one corresponding to the Android Version on your phone (Android R Dev. Preview in my case). Then open Delphi, go to Tools -> Options -> Deployment -> Sdk Manager then change the path of the old SDKs to the new SDK path (They should have a exclamation mark next to them). Now the last thing you have to do is go to the Java Tab and change the Keytool and Jarsigner location to a valid one if its not already valid (something like C:\ProgramFiles\<your java installation>\<java jdk version>\bin\keytool.exe and C:\ProgramFiles\<your java installation>\<java jdk version>\bin\jarsigner.exe for the jarsigner).
That's all. Now you can compile & run your application on your device.
Note: You don't have to uninstall the old SDK if you still need it to make apps for other android versions. Only remove it if you don't need it.
I installed Android Studio (1.5.1 -- see image for build details).
While installing I chose the custom option so I could install a specific path.
I knew that my %SystemDrive% was pointed at a network location and I wanted to install to my local disk.
So, this means that by default, the application would've installed to :
\networkpath\users\myUserName\Android\SDK
However, since I chose the custom installation I chose a local path:
c:\users\myUsername\Android\SDK
Project Creation and Build Work Fine
Everything seemed to install fine and I was able to create a new project and build it with no problems.
However, when I attempted to run the built and then basically failed silently.
The emulator never appeared and no error occurred.
Android Monitor just shows a message stating that No Connected Device detected.
AVD Manager
Luckily I knew a bit about checking to see what happened with the emulator and I opened up AVD Manager.
The listed device displayed an error.
I right-clicked the device and chose "View Details".
That's when the AVD manager showed that it is attempting to read from the network path, even though I changed this in the custom installation.
\networkPath\Users\myUserName\Windows.android\avd\Nexus4.avd
and
\networkPath\Users\myUserName\Windows.android\avd\Nexus4.ini
Registry Edit
I closed Android Studio. Then I opened regedit and edited the values at:
HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList
which originally looked like the following:
And changed them so they all point directly to the c:\ drive (instead of %systemdrive%)
Environment Variable : ANDROID_SDK_HOME
I found that others have mentioned the ANDROID_SDK_HOME environment variable and I noticed that my machine doesn't have that value defined at all so I added it and set it up like the following:
c:\users\myUsername\Android\SDK
I then started Android Studio again and started the AVD Manager.
This time there were no devices show, but instead AVD Manager prompted me to create one with the following window:
Now, I'm attempting to download one of the devices with Google APIs, but each time I do, they download and install successfully, but then disappear from the list. Notice, in the next image there are not API Level 15 or 16 with Google APIs for arm architecture.
Notice additionally that there is one listed for API Level 17 with arm.
I will now attempt to install that one.
You can see that it downloaded successfully and installed fine.
Now, I click the [Finish] button.
The item no longer appears in my list.
The API Level 15 item is chosen automatically. I'm assuming because that one was downloaded originally when I installed Android Studio.
Finally, if you uncheck the [ ] show downloadable system images checkbox -- which is terribly confusing -- and I'm assuming shows you the ones you've already downloaded, then you'll see that it only shows the one API Level 15 virtual device.
This is all quite terrible. Has anyone seen this problem?
Has anyone else been able to fix it?
I'm assuming that I'll just have to go and do a complete re-install of Android Studio.
You should look in the idea.properties file in your project (Android Studio path to different directories). It sounds like this is set to override the system's settings.
EDIT 2 With Final Solution
Thanks to an alert and astute SO post-er (code-apprentice) I was able to get to a solution.
Here's what I had to do.
create idea.properties file and place it at the \networkLocation\myUserName\.Android 1.5\
place the two lines in it which point to my local disk
idea.config.path=C:/Users/myUserName/.AndroidStudio1.5/config/
idea.system.path=C:/Users/myUserName/.AndroidStudio1.5/system/
Then I started Android Studio again and I attempt to install a system image which included the Google APIs.
It worked and it was added to the list:
However, it still did not show the other API LEVELS which I had installed before (15, 16, etc).
Deleted Them From Disk
I noticed that they had been located in a local folder at :
%userprofile%\Android\SDK\add-ons
for whatever reason.
I deleted all of the folders under that path and the original APIs with Google choices appeared in my list again. See highlighted item in image.
SOLUTION
Now when I install them they show up in the list and I can create new AVDs based upon them. Everything works.
EDIT
I used a tool I wrote to watch where Android Studio wrote to disk and I found a path that reveals the problem:
Even though I've made extensive changes to insure the installation would install completely on my local disk, Android Studio saves some (a lot) of data out to this path.
I did a Google on : .AndroidStudio 1.5\config\
That led me to the following documentation:
http://tools.android.com/tech-docs/configuration
There, you will see that the installation should be using %userprofile% to determine where it writes this data. My %userprofile% points to my local disk (c:\users\myUserName) but Android Studio still insists on writing data out to the network.
Here's the important information:
Windows:
%USERPROFILE%\.{FOLDER_NAME}\studio.exe.vmoptions
and/or
%USERPROFILE%\.{FOLDER_NAME}\studio64.exe.vmoptions
%USERPROFILE%\.{FOLDER_NAME}\idea.properties
I deleted the remote .Android Studio 1.5 directory and copied it to my %userprofile% (local) directory. Then I restarted Android Studio and it thinks that it needs to generate all that again because it wants to place it at the remote directory again.
Core issue:
Obviously, it is not using %userprofile%
It gets worse.
I uninstalled the application and all of the settings (supposedly).
Then I installed the entire thing again and it looked as if it were choosing the correct installation path by default:
But, when I started Studio back up then it opened up the project I had created with the first install.
Plus, I still cannot see the API image that I supposedly installed before. Only that one image. Nothing else.
This is really not a great installation system. I'm working on a book which helps beginning Android Devs but if they fall into this problem loop there is no way to get them out of it with a good running emulator.
Very unfortunate.
Download the respective SDK and API levels and Image Systems on Android SDK Manager.
And then they'll show up normally on AVD.
I started to look into Android programming today and created a very small app that is supposed to play MP3s. The tools I used where the Android SDK and eclipse. The code executed flawlessly in the Android emulator but after exporting it and attempting to install the apk on my Samsung Galaxy S2 I received a message telling me there was an error when parsing the file.
Here is my phone's configuration: Android v2.3.3, installation from unknown sources = allowed, USB-Debugging = enabled. The target system for my project has been set to Android v2.3.3 as well and the CPU architecture of the AVD has been set to ARM (armeabi).
I signed the apk using a custom keystone when exporting it, as I initially thought the problem might be a debug key which wouldn't work on real devices.
I attempted to install the app using both, the internal file explorer and a custom explorer (ES File Explorer) but it didn't work for.
Suggestions on how to make my phone execute my custom apps would be highly appreciated. :)
First, since it's complaining about the .apk file, try opening the .apk file by renaming the extension to .zip. If you can rename the file, and open it normally in Windows Explorer, then that should indicate the file itself isn't corrupt.
Secondly, I would try installing by connecting your device via usb and using the command adb -d install "path-to-your-apk-file.apk". If this doesn't work, hopefully adb will spit out something more descriptive, and you can update your question with the error.
I found the answer to the parsing error on custom apk files here. Removing the required API level tag android:minSdkVersion in AndroidManifest.xml solved the problem.
I have installed RadPHP XE2 on a Windows 7 Professional 64-bit host.
I ran the Android-setup.exe. Using the SDK manager i have downloaded all available packages and created an Android 2.2 (API Level 8) device.
I opened the PhoneGap examples, ran the "Wizard for Phonegap". Set Android as target device, Set the index page,icons and destination folder. The Export completes.
I select "Emulator". The Emulator drop down is empty. So i enter the path to the emulator (C:\Program Files (x86)\Android\android-sdk\tools\emulator.exe)
The console output gives a warning :Attribute minSdkVersion in AndroidManifest.xml (2) is lower than the target API level (3). I cannot find anywhere to change the API level (or device for that matter). The AndroidManifest.xml gets overwritten at export.
Also 5 different resource identifier errors for aapt.exe : "No resource identifier found for attribute 'largeScreens' in package 'a <-I can't read the rest of the line as it is cut off in the console output window, which i can't resize or scroll!!
It seems like i have some kind of setup problem, but where can I find a "Getting started" or some other info on how to check the setup ?
The documentation for RadPHP seems quite limited. Searching the help for either Phonegap or Android returns zero results :o(
Best regards
Jan
This problem is fixed into update1. Uninstall everything related to Android, install android-setup. When installing android-sdk not download anything from the sdk-manager, deselect the option and exit.
i have made one application which uses google maps APi,i am using titanium 1.2.2 and mobile sdk 1.5.1 for android,wenever i am trying to run the app on emulator,console shows an error
[INSTALL_FAILED_MISSING_SHARED_LIBRARY]
what does this error means and how to fix it??
I had the same issue. Make sure you have changed the target from Android### to Google APIs in the AVD Manager.
Open Android SDK Manager
Select Tools -> Manage AVDs
Select a/the virtual device and click edit
In the target Select Google APIs...
If this target does not exist in the list, you need to install the Google APIs for the Level you require.
This will appear in the check list under the desired Level in the Android SDK Manager. Once this is installed (go grab yourself a coffee, it can take some time), repeat steps 1 - 4.
You can add android:required="false" flag to your manifest file and the application should be able to start.
<uses-library
android:name="com.google.android.maps"
android:required="false"/>
Then you have to make sure to protect your code from throwing an exception in places where you need it. You can try something like this to check if library is present:
Class.forName("com.google.android.maps");
run android.exe or android.sh utility this will bring up the program to install android SDk. Go to third party add-ons and select Google Api's. After they have been deployed/installed. Please make sure to re-start adb. If you are prompted for a restart of adb. Please say yes.
You have to add
<uses-library android:name="com.google.android.maps" />
between the <application> </application>
Tags of the Manifest.
This happens when your application requires a library that you either haven't included or your device doesn't have it.
Make sure you're using the Google API for Google Maps.
The usual suggestion to ensure you are running against a Google APIs android SDK is correct.
However, there is also a bug if you are using Titanium Studio whereby updating the SDK version in Titanium does not update the SDK in the actual android AVD. You will need to open the Android SDK Manager (SDK Manager.exe or SDK Setup.exe), select "Virtual Devices" on the left and then edit all appropriate devices to set their 'Target' to the desired SDK.
I also came across this same problem and followed #CraigS steps but it didnt help.I was working on the emulator.
Then i tried uninstalling the app from the emulator and running the project again. It installed successfully. Just try this also if CraigS method doesn't help. :)