Basically I am developing an android app. Icreated a new library project and generated the aar file. Next in my main project I imported the aar file, added dependecy in my main project app module. Everything is fine till this point.
I wanted to use an activity instance of the aar library into my main project. So I added
<uses-library android:name="com.mylibray.project" android:required="true" />
in the main android manifest.
While installing it in android device/emulator getting INSTALL_FAILED_MISSING_SHARED_LIBRARY error. How to solve this?
I have solved this problem by using Google APIS/Intel Atom x86 as CPU in the emulator, without Google APIS I always get that error you said. ;)
Related
I'm still trying to use ARCore for a native Android app in another IDE (Visual Studio) instead of Android Studio. That's why I need to "DIY" numbers of things (like manually add ARCore dependency in my APK package). So far I made some progress but still the AR session creation fails.
First, it gives me the following error message:
System.err: java.lang.RuntimeException: Application manifest must
contain meta-data com.google.ar.core.min_apk_version System.err: at
com.google.ar.core.SessionCreateJniHelper.getMinApkVersion(SessionCreateJniHelper.java:62)
third_party/arcore/ar/core/android/sdk/session_create.cc: Calling
getMinApkVersion failed.
I followed the suggestions given in the message and add the following line in AndroidManifest.xml:
<meta-data android:name="com.google.ar.core.min_apk_version" android:value="24"/>
After doing this, the first error is solved, but it gives a new error:
[blaze-out/android-armeabi-v7a-opt/genfiles/third_party/arcore/ar/core/android/arcore_c_shim_function_impls.inc:375]
CHECK failed: expression='"false"' Failed to call function:
ArSession_createImplementation, this function version: 171127000 is
higher than requested min apk version
I can not get rid of this error. Anyone know the reason about it? What's meaning of the function's version is higher than requested min apk version?
Found answer myself:
ArCore 1.1 requires the following meta-data must be in the app's AndroidManifest.xml. See the AndroidManifest.xml in the ARCore's aar package.
<meta-data android:name="com.google.ar.core.min_apk_version" android:value="180226000" />
Android studio will merge this meta-data into the final app's ANdroidManifest.xml but Visual Studio does not do any manifest merging. So the solution is manually add it into the manifest.
ARSession is now successfully created.
It took me about 2 days to make ArCore works with Visual Studio (at least AR session is now created). I'd like to share my experience about how to "DIY" to add ARCore in a native Android app in the IDE other than Android Studio:
You need to download ARCore 1.1.0 from maven repository, search it out then click "aar" link so you can download the full package. Alternatively, you can build sample app "hello_ar_c" by Android Studio and then find the aar package in gralde cache directory: "[user dir].gradle\caches\transforms-1\files-1.1\core-1.1.0.aar".
Manage to make ARCore shared library (libarcore_sdk_c.so) packed into your app's APK file under "/lib".
Manage to make ARCore java library (classes.jar) packed into your app's APK file by DEX tools.
Enable ARCore for your app in AndroidManifext.xml by following ARCore guide
Manually add the meta-data "min_apk_version" in AndroidManifest.xml
The step 5 is the most tricky part since ARCore guide does not mentioned this and Android Studio silently add it after merging the manifest.
Hope ArCore team could provide some guide line of using ARCore with other IDEs.
I create a new library with Android Studio. And now I want to use it with Eclipse (because some people use Eclipse for them applications.).
I have tested my jar file from the library in a android project and it's running fine.
But when I want to use it with Eclipse I have some errors :
03-26 14:25:59.442: W/System.err(31062): at
com.mylib.MyLib.access$000(MyLib.java:24)
03-26 14:25:59.442: W/System.err(31062): at
com.mylib.MyLib$2.run(MyLib.java:114)
I don't understand why I don't have no problem with Android Studio and these ones with Eclipse?
After some hours of search, I have found an error in the console log :
java.lang.IllegalStateException: A required meta-data tag in your
app's AndroidManifest.xml does not exist. You must have the following
declaration within the element:
I have followed the indications and is working fine now.
Maybe the other problems are due to this one.
Thanks for the help.
I am trying to use the new Google Play Services for Google Plus integration from this link: http://ankitthakkar90.blogspot.sg/2013/05/google-plus-integration-in-android.html
I was able to get everything right except when i try to run it, it provide me with this error
Android Launch!
adb is running normally.
Performing com.anky.googleplus.MainActivity activity launch
Automatic Target Mode: using device 'CB5A1MQW4P'
Uploading GooglePlusDemo.apk onto device 'CB5A1MQW4P'
Installing GooglePlusDemo.apk...
Success!
Could not find google-play-services_lib.apk!
Starting activity com.anky.googleplus.MainActivity on device CB5A1MQW4P
ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.anky.googleplus/.MainActivity }
I did reference the library via eclipse Properties > Android > Add Library like what is done here: Using the new Google Play Services
This error still occured. Any suggest and feed back is welcome.
When Adding refenced libraries we need only google-play-services_lib.jar.So that we need to remove the project from your project.
Project->Properties->javaBuildPath->Project->select google-play-services->remove.
clean and build.
Well i had this same problem.. I then found out that i had incorrectly referenced it first in the java build path before referencing it from the Properties > Android > Add Library .
Solution
First remove both the reference from the java build and the Properties > Android > Add Library then reference google_Play_services_lib from Properties > Android > Add Library again.
Hope this helps :)
You don't install the google-play-services_lib APK, you should reference it on your project as an Android Library Project and the JAR will be included inside your APK.
http://developer.android.com/google/play-services/setup.html
This link teaches you how to reference an android library project:
http://developer.android.com/tools/projects/projects-eclipse.html#ReferencingLibraryProject
In your manifiest file put it inside
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
In my case this error was fixed by checking Android Private Dependencies checkbox in google-play-services_lib eclipse project > Properties > Java Build Path > Order and Export tab. It was checked as well in the main project which has the reference to google-play-services_lib.
I still get the Could not find google-play-services_lib.apk! error in console but the maps activities run OK, while before the change I got run time errors and the application crashed.
My advice is to copy google-play-services.jar to libs folder of the project. It worked for me.
I think the device on which you are trying to run the Google Play Services does not contain the Google Play services APK.
Check this link on Android Developers for more clearance
Ensuring Devices Have the Google Play services APK
Check whether that the library project is added into project, if not then check whether the library project and your project is in same directory.
I made library for my android games and i wanted to add it to another project to test how it works, but when i ran the application, it does not seemed to be able to find my library files(INSTALL_FAILED_MISSING_SHARED_LIBRARY). I have my library .jar in "libs" folder and i also have it added to my Libraries and Order and Export tabs in build path. In my manifest, i have tag. I have Eclipse with ADT. Is there any way to fix this?
Are you using Google Maps in your application? If so, this may solve your problem: INSTALL_FAILED_MISSING_SHARED_LIBRARY error in Android
You wrote:
In my manifest, i have tag
If you are adding custom uses-library tags, that might be your problem. See: Installation error: INSTALL_FAILED_MISSING_SHARED_LIBRARY
Silly question (noob here) but the tag below in AndroidManifest.xml doesnt work in IntelliJ. The app compiles successfully but crashes on launch. This manifest file works fine in Eclipse. I added the googleadmob*.jar file in the sdk part of the project structure settings.
<activity
android:name="com.google.ads.AdActivity"
...
</activity>
The problem is that you've added the jar to the SDK. It must be configured as a module library instead, refer to the documentation. In this case it will be packaged with your application, while SDK is not packaged as it's already available on the device.
If the class is still shown in red in the editor, try File | Invalidate Caches.