android - Adding library project and using it in main project -


I am trying to include and use the project in my app. So I removed it and added it as the Android project module for my main project. Then I added some XML of this category in my project.

  & lt; Com.edmodo.rangebar.RangeBar xmlns: custom = "http://schemas.android.com/apk/res-auto" Android: id = "@ + id / rangebar" Android: layout_width = "match_parent" Android: layout_height = "Wrap_content" />   

After it launches, it crashes:

  Reason by: java.lang.ClassNotFoundException: Class not found "com.edmodo. Rangebar.RangeBar "on the path: DexPathList [[ZIP file" /data/app/com.app-1.apk" ],nativeLibraryDirectories=[/data/app-lib/com.app-1, / vendor / lib, / system / lib]]   

Do I need to define something else?

Thank you for helping

First of all, Bar as a module in your project (if the library provides a jar file, you can also add it to your libs folder.)

Library What to do to add:

  1. File - & gt; New Module - & gt; Import an existing project / Android library - & gt; And follow the steps to create the module
  2. After successfully adding the module, click on your main module and select Open Module Settings , select your module (main one) And click the Dependencies button at the bottom + and select Module dependency , compared to that you will show a pop-up with your built-in module Click and select OK Again from Apply and OK .

    And now you should be able to use that library in your project without any error.

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -