Quantcast
Channel: Appcelerator Developer Center Q&A Unanswered Questions 20
Viewing all articles
Browse latest Browse all 8068

Including an external JAR within an Android module

$
0
0

Hi, i created an android module project using the titanium studio's module development wizard, but now i've openend this project on Eclipse because i find it better to work with.

I'm using Mobile SDK 1.8.2 and i've just started a new module development project right now with the wizard (so it's not a porting from an old sdk version).

Btw, the problem is that i need to use an external jar in my android module, but i'm not able to get it work.

I tried to add the jar using the eclipse "Build Path..." option and "Add external Jar". Eclipse recognize the jar, infact it doesn't gives any errors ("X" icons) in the lines where i call the jar classes. But when i try to run "ant" or "ant run.simulator" it gives error like it is unable to find the jar classes (so i think it doens't include the jar when i build with ant):

Buildfile: /Users/ops8086/Documents/sviluppo/TitaniumMobile/BMobile/build.xml
ndk.clean:
pre.clean:
clean:
   [delete] Deleting directory /Users/ops8086/Documents/sviluppo/TitaniumMobile/BMobile/build/classes
   [delete] Deleting directory /Users/ops8086/Documents/sviluppo/TitaniumMobile/BMobile/dist
post.clean:
init:
    [mkdir] Created dir: /Users/ops8086/Documents/sviluppo/TitaniumMobile/BMobile/build/classes
    [mkdir] Created dir: /Users/ops8086/Documents/sviluppo/TitaniumMobile/BMobile/dist
process.annotations:
    [mkdir] Created dir: /Users/ops8086/Documents/sviluppo/TitaniumMobile/BMobile/build/generated/json
    [javac] Compiling 3 source files to /Users/ops8086/Documents/sviluppo/TitaniumMobile/BMobile/build/classes
    [javac] /Users/ops8086/Documents/sviluppo/TitaniumMobile/BMobile/src/doo/bmobile/BannerProxy.java:26: package com.admarvel.android.ads does not exist
    [javac] import com.admarvel.android.ads.AdMarvelView;
    [javac]                                ^
    [javac] /Users/ops8086/Documents/sviluppo/TitaniumMobile/BMobile/src/doo/bmobile/BannerProxy.java:41: cannot find symbol
    [javac] symbol  : class AdMarvelView
    [javac] location: class doo.bmobile.BannerProxy.BannerView
    [javac]         AdMarvelView adView;
    [javac]         ^
    [javac] Note: [KrollBindingGen] Running Kroll binding generator.
    [javac] Note: [KrollBindingGen] No binding data found, creating new data file: org.appcelerator.titanium.bindings/bmobile.json
    [javac] Note: [KrollBindingGen] Found binding for proxy Banner
    [javac] Note: [KrollBindingGen] Found binding for module Bmobile
    [javac] Note: [KrollBindingGen] Found binding for proxy Example
    [javac] Note: [KrollBindingGen] Generating JSON: /Users/ops8086/Documents/sviluppo/TitaniumMobile/BMobile/build/generated/json/org/appcelerator/titanium/bindings/bmobile.json
    [javac] warning: The following options were not recognized by any processor: '[kroll.checkTiContext]'
    [javac] /Users/ops8086/Documents/sviluppo/TitaniumMobile/BMobile/src/doo/bmobile/BannerProxy.java:26: package com.admarvel.android.ads does not exist
    [javac] import com.admarvel.android.ads.AdMarvelView;
    [javac]                                ^
    [javac] /Users/ops8086/Documents/sviluppo/TitaniumMobile/BMobile/src/doo/bmobile/BannerProxy.java:41: cannot find symbol
    [javac] symbol  : class AdMarvelView
    [javac] location: class doo.bmobile.BannerProxy.BannerView
    [javac]         AdMarvelView adView;
    [javac]         ^
    [javac] /Users/ops8086/Documents/sviluppo/TitaniumMobile/BMobile/src/doo/bmobile/BannerProxy.java:58: cannot find symbol
    [javac] symbol  : class AdMarvelView
    [javac] location: class doo.bmobile.BannerProxy.BannerView
    [javac]                 adView = new AdMarvelView(getProxy().getActivity());
    [javac]                              ^
    [javac] Note: Some input files use or override a deprecated API.
    [javac] Note: Recompile with -Xlint:deprecation for details.
    [javac] 3 errors
 
BUILD FAILED
/Users/ops8086/Library/Application Support/Titanium/mobilesdk/osx/1.8.2/module/android/build.xml:59: Compile failed; see the compiler error output for details.
I also tried to copy the jar inside the lib folder in the project, but it doesn't work, and also it get deleted after i run ant.

How can i get ant include the jar and works ?

Thank you very much!


Viewing all articles
Browse latest Browse all 8068

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>