Skip to main content
Participating Frequently
Dec 8, 2015 8:11 AM UTC
Answered

Native Extension ClassNotFound

Hi,

I created a clean air native extension with a simple function that starts an activity from within the ANE, 'DumbActivity'. It worked.

However, after having DumbActivity extend YouTubeFailureRecoveryActivity in order to start using the YouTube API 3.0, I got a ClassNotFoundException on DumbActivity when I run the ANE.

Worth mentioning that when I run the code as a native android app, it runs properly, and I can use YouTube abilities. Also checked, the DumbActivity class is included in the Jar.

Is that some sort of library conflict or something?

This topic is closed to new replies. Start a new post to keep the conversation going.
abhijain19Correct answer
Adobe Employee
Dec 8, 2015 8:32 AM UTC

Hi,

Have you created a platform-options-android.xml for android to include external jar(Youtube API), it should be like:

<platform xmlns="http://ns.adobe.com/air/extension/4.0">
  
<packagedDependencies>
  
<packagedDependency>youtubeapi.jar</packagedDependency>
  
</packagedDependencies>
  
<packagedResources>
  
</packagedResources>
</platform>

You need to specify the name of the Youtube jar file name inside "PackageDependency" tag.


And, The adt command to package the ANE should be like:

adt -package [YOUR NORMAL OPTIONS] -platform Android-ARM -platformoptions platform-options-android.xml -C Android-ARM .



Please Verify.


Thanks,

Adobe AIR Team




7 replies

abhijain19Correct answer
Adobe Employee
Dec 8, 2015 8:32 AM UTC

Hi,

Have you created a platform-options-android.xml for android to include external jar(Youtube API), it should be like:

<platform xmlns="http://ns.adobe.com/air/extension/4.0">
  
<packagedDependencies>
  
<packagedDependency>youtubeapi.jar</packagedDependency>
  
</packagedDependencies>
  
<packagedResources>
  
</packagedResources>
</platform>

You need to specify the name of the Youtube jar file name inside "PackageDependency" tag.


And, The adt command to package the ANE should be like:

adt -package [YOUR NORMAL OPTIONS] -platform Android-ARM -platformoptions platform-options-android.xml -C Android-ARM .



Please Verify.


Thanks,

Adobe AIR Team




Translate
MikeMobAuthor
Participating Frequently
Dec 8, 2015 8:44 AM UTC

Thank you! Now what am I doing when it bugs me about 'Namespace of platform-options-android.xml should match extension namespace.' ?

Translate
MikeMobAuthor
Participating Frequently
Dec 8, 2015 8:45 AM UTC

Oh the version on extension.xml is 3.1. should I state it as 4?

Translate