HipByte / motion-gradle

Integrate 3rd-party Java dependencies in RubyMotion for Android projects using Gradle
MIT License
16 stars 10 forks source link

motion-gradle not finding extra .jar files in aar dependencies #15

Closed darinwilson closed 9 years ago

darinwilson commented 9 years ago

This example repo was built by converting working Java code into RubyMotion. There is one dependency in the Rakefile - the standard appcompat library. This was also true of the Java version of the project.

app.gradle do
  dependency "com.android.support:appcompat-v7:22.1.0"
end

This library has its own dependency on the v4 support library:

$ ls vendor/Gradle/dependencies
appcompat-v7-22.1.0.aar        support-annotations-22.1.0.jar support-v4-22.1.0.aar

When I try to build the project, I get this error:

./build/Development-22/java/net/darinwilson/android/geoquiz/QuizActivity.java:4: error: cannot access DrawerLayoutImpl
public class QuizActivity extends android.support.v7.app.AppCompatActivity implements android.view.View.OnClickListener {
       ^
  class file for android.support.v4.widget.DrawerLayoutImpl not found
rake aborted!

It appears that motion-gradle looks for classes.jar at the top of the unpacked .aar tree, but the appcompat library has another .jar file buried in a subdirectory:

$ find ./vendor/Gradle/aar/support-v4-22.1.0 -name '*.jar'
./vendor/Gradle/aar/support-v4-22.1.0/classes.jar
./vendor/Gradle/aar/support-v4-22.1.0/libs/internal_impl-22.1.0.jar

It doesn't look like the internal_impl-22.1.0.jar file is getting added to the build.

It would be easy enough to change motion-gradle to scan the aar subdirs and find all the jar files, but it doesn't look like you can push more than one jar file to config.vendor_options. Is that true, or am I missing something?

jjaffeux commented 9 years ago

SHould be solved by #18