benbahrenburg / benCoding.Android.Tools

A collection of utilities designed to make working with Titanium on Android alittle easier.
Other
59 stars 36 forks source link

BootReciever Not Working ClassNotFoundException #5

Closed nadavho closed 11 years ago

nadavho commented 11 years ago

Hi,

I followed the exact steps in your blog/documentation to register your broadreciever when the device is booted but it fails to work. from the logcat I can see the following exception: 11-08 11:30:08.016: E/TiApplication(547): (main) [336,1217] Sending event: exception on thread: main msg:java.lang.RuntimeException: Unable to instantiate receiver bencoding.android.receivers.BootReciever: java.lang.ClassNotFoundException: bencoding.android.receivers.BootReciever; Titanium 3.1.3,2013/09/18 12:01,222f4d1

The exception tells us that it cannot instantiate receiver cause it doesn't find the class which is weird.

I'm using your latest distribution 0.31. In simulator I tried it on Google APIs level 15. and also my device Samsung Galay 2 JellyBean 4.1.2

This is my android section in tiapp.xml

  <android 
        android:permission="android.permission.RECEIVE_BOOT_COMPLETED" xmlns:android="http://schemas.android.com/apk/res/android">
        <tool-api-level>15</tool-api-level>
        <manifest>
            <uses-sdk android:minSdkVersion="10"/>
            <supports-screens android:anyDensity="false"/>
            <!-- supports-screens 
                  android:smallScreens="true"
                  android:normalScreens="true"
                  android:largeScreens="true"
                  android:xlargeScreens="true" 
                  android:anyDensity="true" / -->
            <application android:debuggable="true" android:theme="@style/Theme.Gontell">
                <activity android:alwaysRetainTaskState="true"
                    android:configChanges="keyboardHidden|orientation"
                    android:label="GoNTell"
                    android:launchMode="singleTop"
                    android:name=".GontellActivity" android:theme="@style/Theme.Titanium">
                    <intent-filter>
                        <action android:name="android.intent.action.MAIN"/>
                        <category android:name="android.intent.category.LAUNCHER"/>
                    </intent-filter>
                </activity>
                <receiver android:exported="true" android:name="bencoding.android.receivers.BootReciever">
                <intent-filter>
                    <action android:name="android.intent.action.BOOT_COMPLETED"/>
                    <action android:name="android.intent.action.QUICKBOOT_POWERON" />
                </intent-filter>
                <meta-data android:name="enable" android:value="true"/>
                <meta-data android:name="bootType" android:value="restart"/>
                <meta-data android:name="sendToBack" android:value="true"/>
                </receiver>
                <receiver android:name="bencoding.alarmmanager.AlarmNotificationListener"/>
                <receiver android:name="bencoding.alarmmanager.AlarmServiceListener"/>
            </application>
            <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
            <uses-permission android:name="android.permission.CALL_PHONE"/>
            <uses-permission android:name="android.permission.WAKE_LOCK"/>
        </manifest>
        <activity android:name="ti.modules.titanium.ui.android.TiPreferencesActivity"/>
        <activities>
            <activity android:alwaysRetainTaskState="true"
                android:theme="@style/Theme.Titanium" url="services/handheld/android/scripts/openSessionDetails.js">
                <intent-filter>
                    <action android:name="android.intent.action.VIEW"/>
                    <category android:name="android.intent.category.DEFAULT"/>
                </intent-filter>
            </activity>
            <activity android:alwaysRetainTaskState="true"
                android:theme="@style/Theme.Titanium" url="services/handheld/android/scripts/openFeebacksList.js">
                <intent-filter>
                    <action android:name="android.intent.action.VIEW"/>
                    <category android:name="android.intent.category.DEFAULT"/>
                </intent-filter>
            </activity>
        </activities>
        <services>
            <service type="interval" url="services/handheld/android/NotificationService.js"/>
        </services>
    </android>

please help :(, I'm kind of lost.

Thanks,

Nadav

danimarin commented 11 years ago

There is just a little error:

android:name="bencoding.android.receivers.BootReciever">

It should say: BootReceiver

;)

nadavho commented 11 years ago

Thanks man!!! works like a charm :+1: , feels a bit silly not checking that :).

benbahrenburg you should update it in your docs.

BootReciever --> BootReceiver

Thanks,

benbahrenburg commented 11 years ago

Was updated awhile back, if you find any other typos a PR would be helpful in maintaining the project.