2015-06-09 143 views
5

我travis.yml文件:Retrolambda上特拉維斯CI

language: android 

jdk: oraclejdk8 

android: 
    components: 
    - build-tools-22.0.1 
    - android-22 
    - extra-android-m2repository 

script: 
    - gradle build connectedCheck 

期間app:compileRetrolambdaDebug錯誤消息Process 'command '/usr/lib/jvm/java-8-oracle/bin/java'' finished with non-zero exit value 1它失敗。

是否可以在Travis CI上運行Retrolambda?

增加--debug參數後,我得到了以下信息:

13:44:02.064 [INFO] [system.out] Error! Failed to transform some classes 
13:44:02.073 [INFO] [system.out] java.lang.RuntimeException: java.lang.IllegalAccessException: no such method: cz.skaut.warehousemanager.fragment.ItemDetailFragment.lambda$onViewCreated$32(Bitmap)void/invokeSpecial 
at net.orfjackal.retrolambda.lambdas.LambdaReifier.reifyLambdaClass(LambdaReifier.java:42) 
at net.orfjackal.retrolambda.lambdas.BackportLambdaInvocations$InvokeDynamicInsnConverter.backportLambda(BackportLambdaInvocations.java:105) 
at net.orfjackal.retrolambda.lambdas.BackportLambdaInvocations$InvokeDynamicInsnConverter.visitInvokeDynamicInsn(BackportLambdaInvocations.java:94) 
at net.orfjackal.retrolambda.asm.ClassReader.readCode(ClassReader.java:1439) 
at net.orfjackal.retrolambda.asm.ClassReader.readMethod(ClassReader.java:1017) 
at net.orfjackal.retrolambda.asm.ClassReader.accept(ClassReader.java:693) 
at net.orfjackal.retrolambda.asm.ClassReader.accept(ClassReader.java:506) 
at net.orfjackal.retrolambda.Transformers.lambda$transform$4(Transformers.java:106) 
at net.orfjackal.retrolambda.Transformers$$Lambda$2/1190900417.accept(Unknown Source) 
at net.orfjackal.retrolambda.Transformers.transform(Transformers.java:120) 
at net.orfjackal.retrolambda.Transformers.transform(Transformers.java:106) 
at net.orfjackal.retrolambda.Transformers.backportClass(Transformers.java:46) 
at net.orfjackal.retrolambda.Retrolambda.run(Retrolambda.java:72) 
at net.orfjackal.retrolambda.Main.main(Main.java:26) 
13:44:02.086 [INFO] [system.out] Caused by: java.lang.IllegalAccessException: no such method: cz.skaut.warehousemanager.fragment.ItemDetailFragment.lambda$onViewCreated$32(Bitmap)void/invokeSpecial 
at java.lang.invoke.MemberName.makeAccessException(MemberName.java:872) 
at java.lang.invoke.MemberName$Factory.resolveOrFail(MemberName.java:993) 
at java.lang.invoke.MethodHandles$Lookup.resolveOrFail(MethodHandles.java:1379) 
at java.lang.invoke.MethodHandles$Lookup.findSpecial(MethodHandles.java:997) 
at net.orfjackal.retrolambda.lambdas.Types.toMethodHandle(Types.java:42) 
at net.orfjackal.retrolambda.lambdas.Types.asmToJdkType(Types.java:19) 
at net.orfjackal.retrolambda.lambdas.LambdaReifier.callBootstrapMethod(LambdaReifier.java:106) 
at net.orfjackal.retrolambda.lambdas.LambdaReifier.reifyLambdaClass(LambdaReifier.java:37) 
... 13 more 
13:44:02.089 [INFO] [system.out] Caused by: java.lang.NoClassDefFoundError: android/support/v4/view/LayoutInflaterFactory 
at java.lang.ClassLoader.defineClass1(Native Method) 
at java.lang.ClassLoader.defineClass(ClassLoader.java:760) 
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) 
at java.net.URLClassLoader.defineClass(URLClassLoader.java:455) 
at java.net.URLClassLoader.access$100(URLClassLoader.java:73) 
at java.net.URLClassLoader$1.run(URLClassLoader.java:367) 
at java.net.URLClassLoader$1.run(URLClassLoader.java:361) 
at java.security.AccessController.doPrivileged(Native Method) 
at java.net.URLClassLoader.findClass(URLClassLoader.java:360) 
at net.orfjackal.retrolambda.NonDelegatingClassLoader.loadClass(NonDelegatingClassLoader.java:25) 
at java.lang.invoke.MethodHandleNatives.resolve(Native Method) 
at java.lang.invoke.MemberName$Factory.resolve(MemberName.java:965) 
at java.lang.invoke.MemberName$Factory.resolveOrFail(MemberName.java:990) 
... 19 more 
13:44:02.092 [INFO] [system.out] Caused by: java.lang.ClassNotFoundException: android.support.v4.view.LayoutInflaterFactory 
at java.net.URLClassLoader$1.run(URLClassLoader.java:372) 
at java.net.URLClassLoader$1.run(URLClassLoader.java:361) 
at java.security.AccessController.doPrivileged(Native Method) 
at java.net.URLClassLoader.findClass(URLClassLoader.java:360) 
at java.lang.ClassLoader.loadClass(ClassLoader.java:424) 
at java.lang.ClassLoader.loadClass(ClassLoader.java:357) 
at net.orfjackal.retrolambda.NonDelegatingClassLoader.loadClass(NonDelegatingClassLoader.java:27) 
... 32 more 

類似的錯誤報告here,所以它可能是搖籃,retrolambda插件的問題。

+0

我們一定會需要更多的信息。我相信你可以在gradle命令中添加--debug以獲得更詳細的日誌記錄,然後我們可以診斷更多。 – BoredAndroidDeveloper

+0

謝謝,編輯更多的信息。 –

+0

您是否嘗試添加該線程中建議的解決方案? retrolambda {0} {0} {0} jvmArgs'-noverify' } – BoredAndroidDeveloper

回答

14

與此擺弄周圍的幾天,對我以後它的工作通過使用下面的.travis.yml文件:

language: android 
jdk: 
    - oraclejdk7 
    - oraclejdk8 
android: 
    components: 
    - build-tools-22.0.1 
    - android-22 
    - extra-android-support 
    - extra-android-m2repository 
    licenses: 
    - '.+' 

before_install: 
    - export JAVA7_HOME=/usr/lib/jvm/java-7-oracle 
    - export JAVA8_HOME=/usr/lib/jvm/java-8-oracle 
    - export JAVA_HOME=$JAVA7_HOME 
script: 
    - ./gradlew clean assemble || ./gradlew clean assemble 

最重要的是要注意的是,我們的出口JAVA_HOMEJAVA7_HOME,我沒」不要在任何在線示例中查看。