Skip to main content
Participating Frequently
August 15, 2013
Question

Need some help with ANE on Android

  • August 15, 2013
  • 1 reply
  • 1270 views

I'm trying to use a push notification ANE inside a mobile app for Android. My app keeps crashing on the device.

Here's the error:

java.lang.RuntimeException: Unable to instantiate receiver com.doitflash.air.extensions.gcm.BroadcastReceive: java.lang.ClassNotFoundException: Didn't find class "com.doitflash.air.extensions.gcm.BroadcastReceive"

I feel I have placed the ANE in the proper "native extension" panel and my manifest.xml looks good.

The app will open OK on the device, the error comes when I press the register button, which calls code on the ANE.

Is there any special tricks to packaging the ANE inside an app, maybe I missed something.

Using Flash Builder 4.7

Apache Flex 10, Air 3.8

The ANE is from: http://myappsnippet.com/gcm/

Jerry

This topic has been closed for replies.

1 reply

Mark.fromOP
Inspiring
August 16, 2013

Is your com folder set up properly on your hard drive? Are you importing the com... inside the app? Are you attaching the .ane in the AS3 settings?

Participating Frequently
August 16, 2013

Here is my setup in Flash Builder:

1- In the "Native Extensions"  panel (Flex Build Path) I added the 'gcmExtension.ane"

2- In the "Library path"  panel (Flex Build Path) I added the 'gcmExtensions.swc"

3- Under "Flex Build Packaging"native extensions tab it shows gcmExtentions.ane with the "package" checkbox selected.

4- Also under "Flex Build Packaging" I have a certificate.

The app loads fine onto my Android device, I get the java RuntimeException error when I press the "register" button.

I'm not sure what you are referring to by com folder, I assume you mean the swc file.

Jerry

==============================

<application xmlns="http://ns.adobe.com/air/application/3.8">

<id>com.vdex.pushpop</id>

<android>

        <colorDepth>16bit</colorDepth>

        <manifestAdditions>

        <![CDATA[

                              <manifest android:installLocation="auto">

 

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

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

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

                               <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />

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

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

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

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

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

               

                <permission android:name="air.com.vdex.pushpop.permission.C2D_MESSAGE" android:protectionLevel="signature" />

                <uses-permission android:name="air.com.vdex.pushpop.permission.C2D_MESSAGE" />

            

                 <application android:enabled="true" android:hardwareAccelerated="true">

                                                    <activity>

                                                <intent-filter>

                                                    <action android:name="android.intent.action.MAIN" />

                                                    <category android:name="android.intent.category.LAUNCHER" />

                                                </intent-filter>

                                               

                                                <intent-filter>

                                                    <action android:name="android.intent.action.VIEW" />

                                                    <category android:name="android.intent.category.BROWSABLE" />

                                                    <category android:name="android.intent.category.DEFAULT" />

                                                    <data android:scheme= "air.com.vdex.pushpop"/>

                                                </intent-filter>

                                            </activity>

   

                                                  <receiver

                                                      android:enabled="true"

                                                      android:exported="true"

                                                            android:name="com.doitflash.air.extensions.gcm.BroadcastReceive"

                                                            android:permission="com.google.android.c2dm.permission.SEND" >

                                                            <intent-filter>

                                                                      <action android:name="com.google.android.c2dm.intent.RECEIVE" />

                                                                      <action android:name="com.google.android.c2dm.intent.REGISTRATION" />

                                                                      <category android:name="air.com.vdex.pushpop" />

                                                            </intent-filter>

                                                  </receiver>

 

                                                  <service

                                                  android:enabled="true"

                                                  android:exported="true"

                                                  android:name="com.doitflash.air.extension.gcm.GCMIntentService"/>

 

                                                  <activity android:name="com.doitflash.air.extension.gcm.TypeActions.DialogActivity"

                                                  android:label="@string/app_name"

                                                  android:theme="@android:style/Theme.Translucent" />

                                        </application>

           

                    </manifest>

 

                    ]]>

                    </manifestAdditions>  

    </android>

=================================