Hello All,

I'm currently working on developing a game app for Android. The game app is based off of 'Mr.Nom' from Beginning Android 4 Games Development. I've kept the code the same for this first version, but did make some original graphical and audio attributes. I worked through the last bug I had in the app (a Class Not Found Exception). I fixed that by changing one of the classes in the inheritance hierarchy from abstract to non-abstract. I've added the 'uses-library' attribute to the manifest file, but I'm still getting a new error. Here's the stack trace:

06-27 00:26:42.975: D/PackageManager(64): Scanning package com.wsp.androidgameapps.mmnzambi02
06-27 00:26:42.975: E/PackageManager(64): Package com.wsp.androidgameapps.mmnzambi02 requires unavailable shared library com.badlogic.androidgames.framework.impl; failing!
06-27 00:26:42.975: W/PackageManager(64): Package couldn't be installed in /data/app/com.wsp.androidgameapps.mmnzambi02-1.apk
06-27 00:26:43.095: D/dalvikvm(64): GC_EXPLICIT freed 7423 objects / 395328 bytes in 108ms
06-27 00:26:43.165: D/AndroidRuntime(294): Shutting down VM
06-27 00:26:43.165: D/dalvikvm(294): Debugger has detached; object registry had 1 entries
06-27 00:26:43.204: I/AndroidRuntime(294): NOTE: attach of thread 'Binder Thread #3' failed
06-27 00:26:57.324: E/ThrottleService(64): Error reading data file

Here's my manifest file:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android=""
    package="com.wsp.androidgameapps.mmnzambi02"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk android:minSdkVersion="3" android:targetSdkVersion="8" />

    <application
        android:icon="@drawable/ic_launcher"
        android:label="Mmnzambi02" android:permission="android.permission.WAKE_LOCK" android:debuggable="true">
        <activity

            android:label="@string/app_name" android:name=".MmnzambiGame">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <uses-library android:name="com.badlogic.androidgames.framework.impl" android:required="true"/>
            <uses-library android:name="com.badlogic.androidgames.framework" android:required="true"/> 


    </application>

</manifest>

I've tried changing the 'android:required' attributes to various settings (false for both, or for one or the either). If I set both to false, I get the old 'ClassNotFound' exception. If I set one of them to false and one to true, whichever I set to true, the LogCat readout tells me is the 'missing shared library'. Not sure what to do at this point (I've tried fiddling with the build paths from the various projects (the game I'm working on uses code from the game framework and game framework implementation laid out in the forementioned book, whihc I have in Eclipse as separate projects). I'd really appreciate the help, even if it just means pointing me in the direction of some possible solutions. Thanks in advance...

See ya on the flipside,

Desh2350

Dani AI

Generated

Short diagnosis: the PackageManager error means the manifest is declaring a platform-style shared library dependency (the manifest uses-library mechanism). That mechanism is only for libraries the device/system provides (map libraries, OEM extensions, etc.). Your framework package (the com.badlogic... code from the Mr. Nom/book example) is not a system library, so the installer refuses to install the APK. Toggling required to false will let the APK install but then you get runtime ClassNotFound errors because the framework classes are simply not in your APK.

What to do instead

  • Remove the manifest uses-library entries for the com.badlogic packages. Do not use uses-library to pull in your own code.
  • Include the framework code in the app APK: either add the framework projects as Android library projects (mark them as libraries and add them in Project → Properties → Android → Library), or produce a JAR/AAR of the framework and put it in your app's libs/ (or add it as a Gradle dependency if you migrated to Android Studio). If the framework uses native code, make sure the .so files are packaged under libs/armeabi* so they end up in the APK.

Additional checks and a quick checklist

  • In Eclipse ADT, confirm the framework projects are flagged "Is Library" and the main project references them; check Java Build Path → Order and Export to ensure JARs get packaged; then Project → Clean and rebuild.
  • Verify the final APK contains the framework classes (open it as a zip and inspect classes.dex and lib/).
  • Fix the manifest permissions: request WAKE_LOCK with a top-level <uses-permission android:name="android.permission.WAKE_LOCK" /> instead of using android:permission on the application element.

Note for : your native-library point is valid if the framework actually uses NDK code — then missing .so will cause UnsatisfiedLinkError — but the immediate installer failure shown by is caused by the manifest uses-library declaration.

Hi,
From the above log, it seems there is a shared libary missing. The game library used some native library .so or .dll to get some complex thing done. I think that library is missing. Check out how to link native libraries built using NDK to your Android project.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.