Hi,

I'm working on a Froyo firmware for a multimedia set top box as a hobby 
project. I want to use the android-support-v4 library in several platform 
apps, so I decided to backport it to froyo and include it as a framework 
java library. The platform apps can then define the dependency with the 
uses-library manifest tag. This kind of works, but I'm facing a strange 
behavior:
When I build the firmware and include the apps, they don't work and force 
close with a message like this:

W/dalvikvm(  723): Unable to resolve superclass of 
> Lcom/example/launcher/HomeActivity; (18)
> W/dalvikvm(  723): Link of class 'Lcom/example/launcher/HomeActivity;' 
> failed


HomeActivity inherits from FragmentActivity, which is part of the support 
library. So I suppose, that the support library is not in the classpath of 
the app.

Now the surprise: If I delete the app with "rm" and "pm uninstall", then 
reboot the box and afterwards install the same apk by adb pushing it to 
/system/app (where it has been before deleting it), everything works fine.

Any ideas, what could cause this strange behavior?

Regards
Henrik

Here are the makefiles and the manifest:

Makefile support library:

# Copyright (C) 2011 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
LOCAL_PATH := $(call my-dir)
# Note: the source code is in java/, not src/, because this code is also 
part of
# the framework library, and build/core/pathmap.mk expects a java/ 
subdirectory.
# A helper sub-library that makes direct use of Eclair APIs.
include $(CLEAR_VARS)
LOCAL_MODULE := android-support-v4-eclair
LOCAL_SDK_VERSION := 5
LOCAL_SRC_FILES := $(call all-java-files-under, eclair)
include $(BUILD_STATIC_JAVA_LIBRARY)
# -----------------------------------------------------------------------
# A helper sub-library that makes direct use of Froyo APIs.
include $(CLEAR_VARS)
LOCAL_MODULE := android-support-v4-froyo
LOCAL_SDK_VERSION := 8
LOCAL_SRC_FILES := $(call all-java-files-under, froyo)
include $(BUILD_STATIC_JAVA_LIBRARY)
# Here is the final static library that apps can link against.
include $(CLEAR_VARS)
LOCAL_MODULE := android-support-v4
LOCAL_SDK_VERSION := 4
LOCAL_SRC_FILES := $(call all-java-files-under, java)
LOCAL_STATIC_JAVA_LIBRARIES += \
        android-support-v4-eclair \
        android-support-v4-froyo
include $(BUILD_JAVA_LIBRARY)
# Include this library in the build server's output directory
$(call dist-for-goals, droidcore sdk, 
$(LOCAL_BUILT_MODULE):android-support-v4.jar)

Makefile of app:

LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE_TAGS := optional
LOCAL_PROGUARD_ENABLED := disabled
LOCAL_SRC_FILES := $(call all-java-files-under, src)
LOCAL_PACKAGE_NAME := Launcher
LOCAL_CERTIFICATE := platform
LOCAL_JAVA_LIBRARIES := android-support-v4
include $(BUILD_PACKAGE)

Manifest  of the app

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android";
    xmlns:tools="http://schemas.android.com/tools";
    package="com.example.launcher">
    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:persistent="true"
        android:theme="@android:style/Theme.NoTitleBar.Fullscreen" >
        <uses-library
            android:name="android-support-v4"
            android:required="true" />
        <activity
            android:name=".HomeActivity"
            android:label="@string/app_name"
            android:launchMode="singleTask"
            android:screenOrientation="landscape"
            android:stateNotNeeded="true" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <!-- <category 
android:name="android.intent.category.LAUNCHER" /> -->
                <category android:name="android.intent.category.HOME" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>
    </application>
</manifest>

-- 
-- 
unsubscribe: android-porting+unsubscr...@googlegroups.com
website: http://groups.google.com/group/android-porting

--- 
You received this message because you are subscribed to the Google Groups 
"android-porting" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-porting+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to