HipByte / motion-gradle

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

Failed in `rake spec' since v2.0.0 tag #29

Closed Watson1978 closed 8 years ago

Watson1978 commented 8 years ago
$ bundle exec rake spec
bundle exec bacon spec/gradle_spec.rb
spec/gradle_spec.rb:14: warning: already initialized constant Motion::Project::Gradle::GRADLE_ROOT
/Users/watson/prj/motion-gradle/lib/motion/project/gradle.rb:23: warning: previous definition of GRADLE_ROOT was here
motion-gradle
  - creates the dependencies in tmp/Gradle/dependencies [ERROR: ArgumentError]
  - extracts aars dependencies in tmp/Gradle/aar [ERROR: ArgumentError]
  - generates the correct number of dependencies [ERROR: ArgumentError]
  - generates the correct folder structure for aidl [ERROR: ArgumentError]

ArgumentError: wrong number of arguments (2 for 1)
    /Users/watson/prj/motion-gradle/lib/motion/project/gradle.rb:49:in `dependency': motion-gradle - creates the dependencies in tmp/Gradle/dependencies
    spec/gradle_spec.rb:32:in `block (4 levels) in <top (required)>'
    /Users/watson/prj/motion-gradle/lib/motion/project/gradle.rb:16:in `instance_eval'
    /Users/watson/prj/motion-gradle/lib/motion/project/gradle.rb:16:in `gradle'
    spec/gradle_spec.rb:31:in `block (3 levels) in <top (required)>'
    spec/gradle_spec.rb:30:in `instance_eval'
    spec/gradle_spec.rb:30:in `block (2 levels) in <top (required)>'
    spec/gradle_spec.rb:50:in `block in <top (required)>'
    spec/gradle_spec.rb:19:in `<top (required)>'

ArgumentError: wrong number of arguments (2 for 1)
    /Users/watson/prj/motion-gradle/lib/motion/project/gradle.rb:49:in `dependency': motion-gradle - extracts aars dependencies in tmp/Gradle/aar
    spec/gradle_spec.rb:32:in `block (4 levels) in <top (required)>'
    /Users/watson/prj/motion-gradle/lib/motion/project/gradle.rb:16:in `instance_eval'
    /Users/watson/prj/motion-gradle/lib/motion/project/gradle.rb:16:in `gradle'
    spec/gradle_spec.rb:31:in `block (3 levels) in <top (required)>'
    spec/gradle_spec.rb:30:in `instance_eval'
    spec/gradle_spec.rb:30:in `block (2 levels) in <top (required)>'
    spec/gradle_spec.rb:55:in `block in <top (required)>'
    spec/gradle_spec.rb:19:in `<top (required)>'

ArgumentError: wrong number of arguments (2 for 1)
    /Users/watson/prj/motion-gradle/lib/motion/project/gradle.rb:49:in `dependency': motion-gradle - generates the correct number of dependencies
    spec/gradle_spec.rb:32:in `block (4 levels) in <top (required)>'
    /Users/watson/prj/motion-gradle/lib/motion/project/gradle.rb:16:in `instance_eval'
    /Users/watson/prj/motion-gradle/lib/motion/project/gradle.rb:16:in `gradle'
    spec/gradle_spec.rb:31:in `block (3 levels) in <top (required)>'
    spec/gradle_spec.rb:30:in `instance_eval'
    spec/gradle_spec.rb:30:in `block (2 levels) in <top (required)>'
    spec/gradle_spec.rb:67:in `block in <top (required)>'
    spec/gradle_spec.rb:19:in `<top (required)>'

ArgumentError: wrong number of arguments (2 for 1)
    /Users/watson/prj/motion-gradle/lib/motion/project/gradle.rb:49:in `dependency': motion-gradle - generates the correct folder structure for aidl
    spec/gradle_spec.rb:32:in `block (4 levels) in <top (required)>'
    /Users/watson/prj/motion-gradle/lib/motion/project/gradle.rb:16:in `instance_eval'
    /Users/watson/prj/motion-gradle/lib/motion/project/gradle.rb:16:in `gradle'
    spec/gradle_spec.rb:31:in `block (3 levels) in <top (required)>'
    spec/gradle_spec.rb:30:in `instance_eval'
    spec/gradle_spec.rb:30:in `block (2 levels) in <top (required)>'
    spec/gradle_spec.rb:72:in `block in <top (required)>'
    spec/gradle_spec.rb:19:in `<top (required)>'

4 specifications (0 requirements), 0 failures, 4 errors
rake aborted!
Command failed with status (1): [bundle exec bacon spec/gradle_spec.rb...]
/Users/watson/prj/motion-gradle/Rakefile:14:in `block in <top (required)>'
Tasks: TOP => spec
(See full trace by running task with --trace)
jjaffeux commented 8 years ago

@Watson1978 fixed thx.

Watson1978 commented 8 years ago

Thanks :)

Watson1978 commented 8 years ago

There are still 2 failures in my environment.

$ rake spec
bundle exec bacon spec/gradle_spec.rb
spec/gradle_spec.rb:14: warning: already initialized constant Motion::Project::Gradle::GRADLE_ROOT
/Users/watson/prj/motion-gradle/lib/motion/project/gradle.rb:23: warning: previous definition of GRADLE_ROOT was here
motion-gradle
  - creates the dependencies in tmp/Gradle/dependenciesPicked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF8
Download https://repo1.maven.org/maven2/com/android/tools/build/gradle/1.0.1/gradle-1.0.1.pom
Download https://repo1.maven.org/maven2/com/android/tools/build/builder/1.0.1/builder-1.0.1.pom
Download https://repo1.maven.org/maven2/com/android/tools/lint/lint/24.0.1/lint-24.0.1.pom
Download https://repo1.maven.org/maven2/net/sf/proguard/proguard-gradle/5.1/proguard-gradle-5.1.pom
Download https://repo1.maven.org/maven2/net/sf/proguard/proguard-parent/5.1/proguard-parent-5.1.pom
Download https://repo1.maven.org/maven2/com/android/tools/build/builder-model/1.0.1/builder-model-1.0.1.pom
Download https://repo1.maven.org/maven2/com/android/tools/build/builder-test-api/1.0.1/builder-test-api-1.0.1.pom
Download https://repo1.maven.org/maven2/com/android/tools/sdklib/24.0.1/sdklib-24.0.1.pom
Download https://repo1.maven.org/maven2/com/android/tools/sdk-common/24.0.1/sdk-common-24.0.1.pom
Download https://repo1.maven.org/maven2/com/android/tools/common/24.0.1/common-24.0.1.pom
Download https://repo1.maven.org/maven2/com/android/tools/build/manifest-merger/24.0.1/manifest-merger-24.0.1.pom
Download https://repo1.maven.org/maven2/com/android/tools/ddms/ddmlib/24.0.1/ddmlib-24.0.1.pom
Download https://repo1.maven.org/maven2/com/squareup/javawriter/2.5.0/javawriter-2.5.0.pom
Download https://repo1.maven.org/maven2/org/bouncycastle/bcpkix-jdk15on/1.48/bcpkix-jdk15on-1.48.pom
Download https://repo1.maven.org/maven2/org/bouncycastle/bcprov-jdk15on/1.48/bcprov-jdk15on-1.48.pom
Download https://repo1.maven.org/maven2/com/android/tools/lint/lint-checks/24.0.1/lint-checks-24.0.1.pom
Download https://repo1.maven.org/maven2/org/eclipse/jdt/core/compiler/ecj/4.2.2/ecj-4.2.2.pom
Download https://repo1.maven.org/maven2/net/sf/proguard/proguard-base/5.1/proguard-base-5.1.pom
Download https://repo1.maven.org/maven2/com/android/tools/layoutlib/layoutlib-api/24.0.1/layoutlib-api-24.0.1.pom
Download https://repo1.maven.org/maven2/com/android/tools/dvlib/24.0.1/dvlib-24.0.1.pom
Download https://repo1.maven.org/maven2/org/apache/commons/commons-compress/1.8.1/commons-compress-1.8.1.pom
Download https://repo1.maven.org/maven2/org/apache/commons/commons-parent/33/commons-parent-33.pom
Download https://repo1.maven.org/maven2/org/apache/apache/13/apache-13.pom
Download https://repo1.maven.org/maven2/org/apache/httpcomponents/httpclient/4.1.1/httpclient-4.1.1.pom
Download https://repo1.maven.org/maven2/org/apache/httpcomponents/httpcomponents-client/4.1.1/httpcomponents-client-4.1.1.pom
Download https://repo1.maven.org/maven2/org/apache/httpcomponents/project/4.1.1/project-4.1.1.pom
Download https://repo1.maven.org/maven2/org/apache/httpcomponents/httpmime/4.1/httpmime-4.1.pom
Download https://repo1.maven.org/maven2/org/apache/httpcomponents/httpcomponents-client/4.1/httpcomponents-client-4.1.pom
Download https://repo1.maven.org/maven2/com/google/guava/guava/17.0/guava-17.0.pom
Download https://repo1.maven.org/maven2/com/google/guava/guava-parent/17.0/guava-parent-17.0.pom
Download https://repo1.maven.org/maven2/net/sf/kxml/kxml2/2.3.0/kxml2-2.3.0.pom
Download https://repo1.maven.org/maven2/com/android/tools/lint/lint-api/24.0.1/lint-api-24.0.1.pom
Download https://repo1.maven.org/maven2/org/ow2/ow2/1.3/ow2-1.3.pom
Download https://repo1.maven.org/maven2/org/apache/httpcomponents/httpcore/4.1/httpcore-4.1.pom
Download https://repo1.maven.org/maven2/org/apache/httpcomponents/httpcomponents-core/4.1/httpcomponents-core-4.1.pom
Download https://repo1.maven.org/maven2/org/apache/apache/4/apache-4.pom
Download https://repo1.maven.org/maven2/com/android/tools/external/lombok/lombok-ast/0.2.2/lombok-ast-0.2.2.pom
Download https://repo1.maven.org/maven2/com/android/tools/build/gradle/1.0.1/gradle-1.0.1.jar
Download https://repo1.maven.org/maven2/com/android/tools/build/builder/1.0.1/builder-1.0.1.jar
Download https://repo1.maven.org/maven2/com/android/tools/lint/lint/24.0.1/lint-24.0.1.jar
Download https://repo1.maven.org/maven2/net/sf/proguard/proguard-gradle/5.1/proguard-gradle-5.1.jar
Download https://repo1.maven.org/maven2/com/android/tools/build/builder-model/1.0.1/builder-model-1.0.1.jar
Download https://repo1.maven.org/maven2/com/android/tools/build/builder-test-api/1.0.1/builder-test-api-1.0.1.jar
Download https://repo1.maven.org/maven2/com/android/tools/sdklib/24.0.1/sdklib-24.0.1.jar
Download https://repo1.maven.org/maven2/com/android/tools/sdk-common/24.0.1/sdk-common-24.0.1.jar
Download https://repo1.maven.org/maven2/com/android/tools/common/24.0.1/common-24.0.1.jar
Download https://repo1.maven.org/maven2/com/android/tools/build/manifest-merger/24.0.1/manifest-merger-24.0.1.jar
Download https://repo1.maven.org/maven2/com/android/tools/ddms/ddmlib/24.0.1/ddmlib-24.0.1.jar
Download https://repo1.maven.org/maven2/com/squareup/javawriter/2.5.0/javawriter-2.5.0.jar
Download https://repo1.maven.org/maven2/org/bouncycastle/bcpkix-jdk15on/1.48/bcpkix-jdk15on-1.48.jar
Download https://repo1.maven.org/maven2/org/bouncycastle/bcprov-jdk15on/1.48/bcprov-jdk15on-1.48.jar
Download https://repo1.maven.org/maven2/com/android/tools/lint/lint-checks/24.0.1/lint-checks-24.0.1.jar
Download https://repo1.maven.org/maven2/org/eclipse/jdt/core/compiler/ecj/4.2.2/ecj-4.2.2.jar
Download https://repo1.maven.org/maven2/net/sf/proguard/proguard-base/5.1/proguard-base-5.1.jar
Download https://repo1.maven.org/maven2/com/android/tools/layoutlib/layoutlib-api/24.0.1/layoutlib-api-24.0.1.jar
Download https://repo1.maven.org/maven2/com/android/tools/dvlib/24.0.1/dvlib-24.0.1.jar
Download https://repo1.maven.org/maven2/org/apache/commons/commons-compress/1.8.1/commons-compress-1.8.1.jar
Download https://repo1.maven.org/maven2/org/apache/httpcomponents/httpclient/4.1.1/httpclient-4.1.1.jar
Download https://repo1.maven.org/maven2/org/apache/httpcomponents/httpmime/4.1/httpmime-4.1.jar
Download https://repo1.maven.org/maven2/com/google/guava/guava/17.0/guava-17.0.jar
Download https://repo1.maven.org/maven2/net/sf/kxml/kxml2/2.3.0/kxml2-2.3.0.jar
Download https://repo1.maven.org/maven2/com/android/tools/lint/lint-api/24.0.1/lint-api-24.0.1.jar
Download https://repo1.maven.org/maven2/org/apache/httpcomponents/httpcore/4.1/httpcore-4.1.jar
Download https://repo1.maven.org/maven2/commons-codec/commons-codec/1.4/commons-codec-1.4.jar
Download https://repo1.maven.org/maven2/com/android/tools/external/lombok/lombok-ast/0.2.2/lombok-ast-0.2.2.jar

FAILURE: Build failed with an exception.

* Where:
Build file '/Users/watson/prj/motion-gradle/tmp/Gradle/iinappbillingservice/build.gradle' line: 1

* What went wrong:
A problem occurred evaluating project ':iinappbillingservice'.
> Failed to apply plugin [id 'com.android.library']
   > Gradle version 2.2 is required. Current version is 2.10. If using the gradle wrapper, try editing the distributionUrl in /Users/watson/prj/motion-gradle/gradle/wrapper/gradle-wrapper.properties to gradle-2.2-all.zip

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 31.248 secs
 [FAILED]
  - extracts aars dependencies in tmp/Gradle/aar [FAILED]
  - generates the correct number of dependencies
  - generates the correct folder structure for aidl

Bacon::Error: #<Pathname:/Users/watson/prj/motion-gradle/tmp/Gradle/dependencies>.exist?() failed
    spec/gradle_spec.rb:48:in `block (2 levels) in <top (required)>': motion-gradle - creates the dependencies in tmp/Gradle/dependencies
    spec/gradle_spec.rb:46:in `block in <top (required)>'
    spec/gradle_spec.rb:19:in `<top (required)>'

Bacon::Error: false.==(true) failed
    spec/gradle_spec.rb:57:in `block (2 levels) in <top (required)>': motion-gradle - extracts aars dependencies in tmp/Gradle/aar
    spec/gradle_spec.rb:51:in `block in <top (required)>'
    spec/gradle_spec.rb:19:in `<top (required)>'

4 specifications (7 requirements), 2 failures, 0 errors
rake aborted!
Command failed with status (1): [bundle exec bacon spec/gradle_spec.rb...]
/Users/watson/prj/motion-gradle/Rakefile:14:in `block in <top (required)>'
Tasks: TOP => spec
(See full trace by running task with --trace)
jjaffeux commented 8 years ago

@Watson1978 yes this is a bug in Gradle it thinks 2.10 is instead 2.1 and detect it as inferior to 2.2. It will be fixed in next Gradle version, for now the best is to use gradle 2.9

Watson1978 commented 8 years ago

Thank you for replying. I installed gradle 2.9. But, I still meet errors.

$ which gradle
/usr/local/bin/gradle

$ gradle -version

------------------------------------------------------------
Gradle 2.9
------------------------------------------------------------

Build time:   2015-11-17 07:02:17 UTC
Build number: none
Revision:     b463d7980c40d44c4657dc80025275b84a29e31f

Groovy:       2.4.4
Ant:          Apache Ant(TM) version 1.9.3 compiled on December 23 2013
JVM:          1.7.0_79 (Oracle Corporation 24.79-b02)
OS:           Mac OS X 10.11.4 x86_64

$ rake spec
bundle exec bacon spec/gradle_spec.rb
spec/gradle_spec.rb:14: warning: already initialized constant Motion::Project::Gradle::GRADLE_ROOT
/Users/watson/prj/motion-gradle/lib/motion/project/gradle.rb:23: warning: previous definition of GRADLE_ROOT was here
motion-gradle
  - creates the dependencies in tmp/Gradle/dependenciesPicked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF8

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':iinappbillingservice'.
> SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 3.267 secs
 [FAILED]
  - extracts aars dependencies in tmp/Gradle/aar [FAILED]
  - generates the correct number of dependencies
  - generates the correct folder structure for aidl

Bacon::Error: #<Pathname:/Users/watson/prj/motion-gradle/tmp/Gradle/dependencies>.exist?() failed
    spec/gradle_spec.rb:48:in `block (2 levels) in <top (required)>': motion-gradle - creates the dependencies in tmp/Gradle/dependencies
    spec/gradle_spec.rb:46:in `block in <top (required)>'
    spec/gradle_spec.rb:19:in `<top (required)>'

Bacon::Error: false.==(true) failed
    spec/gradle_spec.rb:57:in `block (2 levels) in <top (required)>': motion-gradle - extracts aars dependencies in tmp/Gradle/aar
    spec/gradle_spec.rb:51:in `block in <top (required)>'
    spec/gradle_spec.rb:19:in `<top (required)>'

4 specifications (7 requirements), 2 failures, 0 errors
rake aborted!
Command failed with status (1): [bundle exec bacon spec/gradle_spec.rb...]
/Users/watson/prj/motion-gradle/Rakefile:14:in `block in <top (required)>'
Tasks: TOP => spec
(See full trace by running task with --trace)
jjaffeux commented 8 years ago

@Watson1978 did you set ANDROID_HOME ? It should be the same than RUBYMOTION_ANDROID_SDK

➜ echo $RUBYMOTION_ANDROID_SDK (02-01 09:12) /Users/joffreyjaffeux/.rubymotion-android/sdk ➜ echo $ANDROID_HOME (02-01 09:12) /Users/joffreyjaffeux/.rubymotion-android/sdk

Watson1978 commented 8 years ago

I have just configured RUBYMOTION_ANDROID_SDK and RUBYMOTION_ANDROID_NDK following http://www.rubymotion.com/jp/developers/guides/manuals/android/getting-started/

After configured ANDROID_HOME, succeeded to run rake spec. Thanks