HipByte / motion-gradle

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

constructor MainActivity() is already defined in class MainActivity #25

Closed acrogenesis closed 9 years ago

acrogenesis commented 9 years ago

When adding this specific gradle dependency 'com.danikula:videocache:2.3.1' the .java file generated for MainActivity declares public MainActivity() { super(); } twice.

build/Development-19/java/com/yourcompany/hello/MainActivity.java

    // This file has been generated automatically. Do not edit.
    package com.yourcompany.hello;
    import com.rubymotion.*;
    public class MainActivity extends android.app.Activity {
        public MainActivity() { super(); }
        public MainActivity() { super(); }
        public native void onCreate(android.os.Bundle arg0);
        static {
            java.lang.System.loadLibrary("payload");
        }
    }

Code Sample: https://github.com/acrogenesis/rubymotion-constructor-bug

http://community.rubymotion.com/t/mainactivity-is-already-defined-in-class-mainactivity/1127

jjaffeux commented 9 years ago

@acrogenesis Hi, could you explain why you think it's related to motion-gradle ? motion-gradle doesn't generate this MainActivity.java

acrogenesis commented 9 years ago

I'm not sure it's motion-gradle the responsible but it is related because I was able to build the jar and libs myself using the ./gradlew jarRelease and adding it to RubyMotion as an external library. So basically if I add it using the

app.gradle do
    dependency 'com.danikula:videocache:2.3.1'
end

It fails.

jjaffeux commented 9 years ago

Please look at http://community.rubymotion.com/t/rubymotion-bug-mainactivity-is-already-defined-in-class-mainactivity/1127/2 I have answered here, thx.