English 中文(简体)
步履带
原标题:Phonegap app Crashes at Runtime

当一只从模拟器和物理装置操作我的照相机时,它便坠毁。

我有电话:1.3.0:

01-12 14:13:51.742: W/dalvikvm(344): threadid=1: thread exiting with uncaught exception (group=0x40015560)
01-12 14:13:51.791: E/AndroidRuntime(344): FATAL EXCEPTION: main
01-12 14:13:51.791: E/AndroidRuntime(344): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.philipslighting.roadlight/com.philipslighting.roadlight.PhilipsRoadlightFinalActivity}: java.lang.ClassNotFoundException: com.philipslighting.roadlight.PhilipsRoadlightFinalActivity in loader dalvik.system.PathClassLoader[/data/app/com.philipslighting.roadlight-1.apk]
01-12 14:13:51.791: E/AndroidRuntime(344):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1569)
01-12 14:13:51.791: E/AndroidRuntime(344):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
01-12 14:13:51.791: E/AndroidRuntime(344):  at android.app.ActivityThread.access$1500(ActivityThread.java:117)
01-12 14:13:51.791: E/AndroidRuntime(344):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
01-12 14:13:51.791: E/AndroidRuntime(344):  at android.os.Handler.dispatchMessage(Handler.java:99)
01-12 14:13:51.791: E/AndroidRuntime(344):  at android.os.Looper.loop(Looper.java:123)
01-12 14:13:51.791: E/AndroidRuntime(344):  at android.app.ActivityThread.main(ActivityThread.java:3683)
01-12 14:13:51.791: E/AndroidRuntime(344):  at java.lang.reflect.Method.invokeNative(Native Method)
01-12 14:13:51.791: E/AndroidRuntime(344):  at java.lang.reflect.Method.invoke(Method.java:507)
01-12 14:13:51.791: E/AndroidRuntime(344):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
01-12 14:13:51.791: E/AndroidRuntime(344):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
01-12 14:13:51.791: E/AndroidRuntime(344):  at dalvik.system.NativeStart.main(Native Method)
01-12 14:13:51.791: E/AndroidRuntime(344): Caused by: java.lang.ClassNotFoundException: com.philipslighting.roadlight.PhilipsRoadlightFinalActivity in loader dalvik.system.PathClassLoader[/data/app/com.philipslighting.roadlight-1.apk]
01-12 14:13:51.791: E/AndroidRuntime(344):  at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240)
01-12 14:13:51.791: E/AndroidRuntime(344):  at java.lang.ClassLoader.loadClass(ClassLoader.java:551)
01-12 14:13:51.791: E/AndroidRuntime(344):  at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
01-12 14:13:51.791: E/AndroidRuntime(344):  at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
01-12 14:13:51.791: E/AndroidRuntime(344):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1561)
01-12 14:13:51.791: E/AndroidRuntime(344):  ... 11 more
01-12 14:13:51.821: W/ActivityManager(61):   Force finishing activity com.philipslighting.roadlight/.PhilipsRoadlightFinalActivity
01-12 14:13:52.341: W/ActivityManager(61): Activity pause timeout for HistoryRecord{4053ec18 com.philipslighting.roadlight/.PhilipsRoadlightFinalActivity}
01-12 14:13:53.151: I/Process(328): Sending signal. PID: 328 SIG: 9
01-12 14:13:53.181: I/ActivityManager(61): Process com.roadlight.philips (pid 328) has died.
01-12 14:13:54.331: I/Process(344): Sending signal. PID: 344 SIG: 9
01-12 14:13:54.371: W/InputManagerService(61): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@405c2d80
01-12 14:13:54.621: I/ActivityManager(61): Process com.philipslighting.roadlight (pid 344) has died.

这里,我和roid表示:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.philipslighting.roadlight"
    android:versionCode="4"
    android:versionName="1.2" >

    <supports-screens
        android:largeScreens="true"
        android:normalScreens="true"
        android:smallScreens="true"
        android:resizeable="true"
        android:anyDensity="true"
        />

        <uses-permission android:name="android.permission.INTERNET" />


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

    <application 
        android:icon="@drawable/icon"
        android:label="@string/app_name">

            <activity
                android:label="@string/app_name" 
                android:name=".activities.MainActivity" 
                android:configChanges="keyboardHidden|orientation">

                    <intent-filter>
                            <action android:name="android.intent.action.MAIN" />
                            <category android:name="android.intent.category.LAUNCHER" />
                    </intent-filter>

            </activity>
    </application>

</manifest>

在活动方面,你能否进口电话缺口活动?

提前感谢!

问题回答

It you have used this tutorial http://phonegap.com/start#android then to fix java.lang.ClassNotFoundException as above you need to check the box next to cordova-XXX.jar in the "Order and Export" tab then you add a dependency for cordova-XXX.jar in Libraries tab at "Configure Build Path".

当然,主等名称必须在<条码>上正确:姓名=“<主等名称及格字;

I was following the phonegap droid getting started guide In my case, I had created a folder called lib instead of libs. A symptom of this was that I had to manually add the jar to the build path. I removed the jar from the build path, renamed the lib folder to libs and things started working immediately.

In activity you import the file for PhoneGap please check it. and see the index.html file in your folder.

I think just follow this path : http://phonegap.com/start#android

See, video you will find solution for this.

        <activity
            android:label="@string/app_name" 
            android:name=".activities.MainActivity" 
            android:configChanges="keyboardHidden|orientation">

                <intent-filter>
                        <action android:name="android.intent.action.MAIN" />
                        <category android:name="android.intent.category.LAUNCHER" />
                </intent-filter>

        </activity>

you should mention with package name along with main class name in activity tag,look at below example:

和roid:名称=“com.philipslighting.roadlight.MainActative”

       <activity
            android:label="@string/app_name" 
            android:name="yourPACKAGEname.MainActivity" 
            android:configChanges="keyboardHidden|orientation">

                <intent-filter>
                        <action android:name="android.intent.action.MAIN" />
                        <category android:name="android.intent.category.LAUNCHER" />
                </intent-filter>

        </activity>




相关问题
Android - ListView fling gesture triggers context menu

I m relatively new to Android development. I m developing an app with a ListView. I ve followed the info in #1338475 and have my app recognizing the fling gesture, but after the gesture is complete, ...

AsyncTask and error handling on Android

I m converting my code from using Handler to AsyncTask. The latter is great at what it does - asynchronous updates and handling of results in the main UI thread. What s unclear to me is how to handle ...

Android intent filter for a particular file extension?

I want to be able to download a file with a particular extension from the net, and have it passed to my application to deal with it, but I haven t been able to figure out the intent filter. The ...

Android & Web: What is the equivalent style for the web?

I am quite impressed by the workflow I follow when developing Android applications: Define a layout in an xml file and then write all the code in a code-behind style. Is there an equivalent style for ...

TiledLayer equivalent in Android [duplicate]

To draw landscapes, backgrounds with patterns etc, we used TiledLayer in J2ME. Is there an android counterpart for that. Does android provide an option to set such tiled patterns in the layout XML?

Using Repo with Msysgit

When following the Android Open Source Project instructions on installing repo for use with Git, after running the repo init command, I run into this error: /c/Users/Andrew Rabon/bin/repo: line ...

Android "single top" launch mode and onNewIntent method

I read in the Android documentation that by setting my Activity s launchMode property to singleTop OR by adding the FLAG_ACTIVITY_SINGLE_TOP flag to my Intent, that calling startActivity(intent) would ...

From Web Development to Android Development

I have pretty good skills in PHP , Mysql and Javascript for a junior developer. If I wanted to try my hand as Android Development do you think I might find it tough ? Also what new languages would I ...

热门标签