Skip to main content
Participating Frequently
December 8, 2015
Answered

Native Extension ClassNotFound

  • December 8, 2015
  • 1 reply
  • 1275 views

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 has been closed for replies.
Correct answer abhijain19

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




1 reply

abhijain19Correct answer
Adobe Employee
December 8, 2015

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




MikeMobAuthor
Participating Frequently
December 8, 2015

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

MikeMobAuthor
Participating Frequently
December 8, 2015

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