Installation failed with message INSTALL_FAILED_MISSING_SHARED_LIBRARY:

From here I have setup the EMDK
http://techdocs.zebra.com/emdk-for-android/7-3/guide/setup/

When I am using this tag in manifest in barcodesample1 from your github example
https://github.com/Zebra/samples-emdkforandroid-7_3

<uses-library android:name="com.symbol.emdk" android:required="true"/>

Then Application does not get installed.

And if I change the value from true to false it get installed but app crashes and I get these errors.

2019-06-13 18:54:29.071 11328-11328/com.symbol.barcodesample1 E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.symbol.barcodesample1, PID: 11328
java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.symbol.barcodesample1/com.symbol.barcodesample1.MainActivity}: java.lang.ClassNotFoundException: Didn't find class "com.symbol.barcodesample1.MainActivity" on path: DexPathList[[zip file "/system/framework/org.apache.http.legacy.boot.jar", zip file "/data/app/com.symbol.barcodesample1-Y11NujkCJicTE2fSXraWSA==/base.apk"],nativeLibraryDirectories=[/data/app/com.symbol.barcodesample1-Y11NujkCJicTE2fSXraWSA==/lib/x86, /system/lib]]
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2843)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3048)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1808)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6669)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.symbol.barcodesample1.MainActivity" on path: DexPathList[[zip file "/system/framework/org.apache.http.legacy.boot.jar", zip file "/data/app/com.symbol.barcodesample1-Y11NujkCJicTE2fSXraWSA==/base.apk"],nativeLibraryDirectories=[/data/app/com.symbol.barcodesample1-Y11NujkCJicTE2fSXraWSA==/lib/x86, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:134)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at android.app.AppComponentFactory.instantiateActivity(AppComponentFactory.java:69)
at android.app.Instrumentation.newActivity(Instrumentation.java:1215)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2831)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3048) 
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78) 
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108) 
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1808) 
at android.os.Handler.dispatchMessage(Handler.java:106) 
at android.os.Looper.loop(Looper.java:193) 
at android.app.ActivityThread.main(ActivityThread.java:6669) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858) 
Suppressed: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/symbol/emdk/EMDKManager$EMDKListener;
at java.lang.VMClassLoader.findLoadedClass(Native Method)
at java.lang.ClassLoader.findLoadedClass(ClassLoader.java:738)
at java.lang.ClassLoader.loadClass(ClassLoader.java:363)
... 15 more
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.symbol.emdk.EMDKManager$EMDKListener" on path: DexPathList[[zip file "/system/framework/org.apache.http.legacy.boot.jar", zip file "/data/app/com.symbol.barcodesample1-Y11NujkCJicTE2fSXraWSA==/base.apk"],nativeLibraryDirectories=[/data/app/com.symbol.barcodesample1-Y11NujkCJicTE2fSXraWSA==/lib/x86, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:134)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
... 18 more

Kindly tell me whats the issues and what should I do to solve this issue.

Attachments: 

Hi - I believe this issue is because you're trying to run the application on a device that doesn't have the EMDK. As you've noticed, if you changed the 'uses-library' tag android:required to true, then the application will not install because the EMDK is not present on the device.

If you want to run this application on a device that doesn't have the EMDK, then you need to change the way you implement the EMDK in your application. I have a sample app which shows an example EMDK implementation for running on devices without the EMDK. You can find the sample here: https://github.com/JamesSwinton/Savanna-Print-Demo. The relevant class for initializing the EMDK is here: https://github.com/JamesSwinton/Savanna-Print-Demo/blob/master/app/src/m...

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’