2017-09-29 15 views
0

を失敗この質問は、私はMac miniの(10.12)でのAndroidのビルドにCIを設定しています。このAndroid build issueAndroidのビルドは

に似ています。

私は代理人プロキシがあり、それが私が思うこれらの問題を引き起こす理由です。
まず、〜/ .bash_profileにプロキシ情報を設定しようとしました。

次に、私はcntlmをセットアップし、Androidプロジェクトを構築しようとしました。 ANDROID_HOMEが

/ユーザ/ジェンキンス/ホーム/アンドロイド-SDKに設定されている私は./gradlew --infoを構築し、出力

Initialized native services in: /Users/jenkins/.gradle/native 
Connected to daemon DaemonInfo{pid=6465, address=[3646567b-c480-4beb-a6d2-2ba0120d1cd8 port:54872, addresses:[/0:0:0:0:0:0:0:1, /127.0.0.1]], state=Idle, lastBusy=1506668208517, context=DefaultDaemonContext[uid=6c85c027-6030-4dfe-91b8-6a40166e80af,javaHome=/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home,daemonRegistryDir=/Users/jenkins/.gradle/daemon,pid=6465,idleTimeout=10800000,daemonOpts=-XX:MaxPermSize=256m,-XX:+HeapDumpOnOutOfMemoryError,-Xmx1024m,-Dfile.encoding=UTF-8,-Duser.country=AU,-Duser.language=en,-Duser.variant]}. Dispatching request Build{id=f5180918-cde6-414f-8694-c8777c5c6d05.1, currentDir=/Users/jenkins/home/ws/tankstream-android/tankstreamandroid}. 
Received result [email protected] from daemon DaemonInfo{pid=6465, address=[3646567b-c480-4beb-a6d2-2ba0120d1cd8 port:54872, addresses:[/0:0:0:0:0:0:0:1, /127.0.0.1]], state=Idle, lastBusy=1506668208517, context=DefaultDaemonContext[uid=6c85c027-6030-4dfe-91b8-6a40166e80af,javaHome=/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home,daemonRegistryDir=/Users/jenkins/.gradle/daemon,pid=6465,idleTimeout=10800000,daemonOpts=-XX:MaxPermSize=256m,-XX:+HeapDumpOnOutOfMemoryError,-Xmx1024m,-Dfile.encoding=UTF-8,-Duser.country=AU,-Duser.language=en,-Duser.variant]} (build should be starting). 
The client will now receive all logging from the daemon (pid: 6465). The daemon log file: /Users/jenkins/.gradle/daemon/3.3/daemon-6465.out.log 
Starting 9th build in daemon [uptime: 28 mins 20.507 secs, performance: 100%, no major garbage collections] 
Executing build with daemon context: DefaultDaemonContext[uid=6c85c027-6030-4dfe-91b8-6a40166e80af,javaHome=/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home,daemonRegistryDir=/Users/jenkins/.gradle/daemon,pid=6465,idleTimeout=10800000,daemonOpts=-XX:MaxPermSize=256m,-XX:+HeapDumpOnOutOfMemoryError,-Xmx1024m,-Dfile.encoding=UTF-8,-Duser.country=AU,-Duser.language=en,-Duser.variant] 
Creating new cache for plugin-use-metadata, path /Users/jenkins/.gradle/caches/3.3/plugin-resolution/plugin-use-metadata.bin, access [email protected] 
Creating new cache for client-status, path /Users/jenkins/.gradle/caches/3.3/plugin-resolution/client-status.bin, access [email protected] 
Starting Build 
Settings evaluated using settings file '/Users/jenkins/home/ws/tankstream-android/tankstreamandroid/settings.gradle'. 
Projects loaded. Root project using build file '/Users/jenkins/home/ws/tankstream-android/tankstreamandroid/build.gradle'. 
Included projects: [root project 'tankstreamandroid', project ':app'] 
Evaluating root project 'tankstreamandroid' using build file '/Users/jenkins/home/ws/tankstream-android/tankstreamandroid/build.gradle'. 
Creating new cache for metadata-2.23/module-metadata, path /Users/jenkins/.gradle/caches/modules-2/metadata-2.23/module-metadata.bin, access [email protected] 
Creating new cache for metadata-2.23/artifact-at-repository, path /Users/jenkins/.gradle/caches/modules-2/metadata-2.23/artifact-at-repository.bin, access [email protected] 
Evaluating project ':app' using build file '/Users/jenkins/home/ws/tankstream-android/tankstreamandroid/app/build.gradle'. 
Using 4 worker leases. 
Creating configuration compile 
Creating configuration apk 
Creating configuration provided 
Creating configuration wearApp 
Creating configuration annotationProcessor 
Creating configuration jackPlugin 
Creating configuration androidTestCompile 
Creating configuration androidTestApk 
Creating configuration androidTestProvided 
Creating configuration androidTestWearApp 
Creating configuration androidTestAnnotationProcessor 
Creating configuration androidTestJackPlugin 
Creating configuration testCompile 
Creating configuration testApk 
Creating configuration testProvided 
Creating configuration testWearApp 
Creating configuration testAnnotationProcessor 
Creating configuration testJackPlugin 
NDK is missing a "platforms" directory. 
If you are using NDK, verify the ndk.dir is set to a valid NDK directory. It is currently set to /Users/jenkins/home/android-sdk/ndk-bundle. 
If you are not using NDK, unset the NDK variable from ANDROID_NDK_HOME or local.properties to remove this warning. 

Creating configuration debugCompile 
Creating configuration debugApk 
Creating configuration debugProvided 
Creating configuration debugWearApp 
Creating configuration debugAnnotationProcessor 
Creating configuration debugJackPlugin 
Creating configuration testDebugCompile 
Creating configuration testDebugApk 
Creating configuration testDebugProvided 
Creating configuration testDebugWearApp 
Creating configuration testDebugAnnotationProcessor 
Creating configuration testDebugJackPlugin 
Creating configuration releaseCompile 
Creating configuration releaseApk 
Creating configuration releaseProvided 
Creating configuration releaseWearApp 
Creating configuration releaseAnnotationProcessor 
Creating configuration releaseJackPlugin 
Creating configuration testReleaseCompile 
Creating configuration testReleaseApk 
Creating configuration testReleaseProvided 
Creating configuration testReleaseWearApp 
Creating configuration testReleaseAnnotationProcessor 
Creating configuration testReleaseJackPlugin 
Parsing the SDK, no caching allowed 
SDK initialized in 3 ms 
Creating new cache for metadata-2.23/artifact-at-url, path /Users/jenkins/.gradle/caches/modules-2/metadata-2.23/artifact-at-url.bin, access [email protected] 
Resource missing. [HTTP GET: http://jcenter.bintray.com/com/android/support/appcompat-v7/25.3.1/appcompat-v7-25.3.1.pom] 
Resource missing. [HTTP HEAD: http://jcenter.bintray.com/com/android/support/appcompat-v7/25.3.1/appcompat-v7-25.3.1.jar] 
Resource missing. [HTTP GET: http://jcenter.bintray.com/com/android/support/constraint/constraint-layout/1.0.2/constraint-layout-1.0.2.pom] 
Resource missing. [HTTP HEAD: http://jcenter.bintray.com/com/android/support/constraint/constraint-layout/1.0.2/constraint-layout-1.0.2.jar] 
Resource missing. [HTTP GET: http://jcenter.bintray.com/com/android/support/design/25.3.1/design-25.3.1.pom] 
Resource missing. [HTTP HEAD: http://jcenter.bintray.com/com/android/support/design/25.3.1/design-25.3.1.jar] 
Resource missing. [HTTP GET: http://jcenter.bintray.com/com/android/support/support-v4/25.3.1/support-v4-25.3.1.pom] 
Resource missing. [HTTP HEAD: http://jcenter.bintray.com/com/android/support/support-v4/25.3.1/support-v4-25.3.1.jar] 
Resource missing. [HTTP GET: http://jcenter.bintray.com/com/google/android/gms/play-services-maps/11.0.1/play-services-maps-11.0.1.pom] 
Resource missing. [HTTP HEAD: http://jcenter.bintray.com/com/google/android/gms/play-services-maps/11.0.1/play-services-maps-11.0.1.jar] 
Resource missing. [HTTP GET: http://jcenter.bintray.com/com/google/android/gms/play-services-location/11.0.1/play-services-location-11.0.1.pom] 
Resource missing. [HTTP HEAD: http://jcenter.bintray.com/com/google/android/gms/play-services-location/11.0.1/play-services-location-11.0.1.jar] 
Resource missing. [HTTP GET: http://jcenter.bintray.com/com/google/android/gms/play-services-plus/11.0.1/play-services-plus-11.0.1.pom] 
Resource missing. [HTTP HEAD: http://jcenter.bintray.com/com/google/android/gms/play-services-plus/11.0.1/play-services-plus-11.0.1.jar] 
Resource missing. [HTTP GET: http://jcenter.bintray.com/com/google/android/gms/play-services-analytics/11.0.1/play-services-analytics-11.0.1.pom] 
Resource missing. [HTTP HEAD: http://jcenter.bintray.com/com/google/android/gms/play-services-analytics/11.0.1/play-services-analytics-11.0.1.jar] 
Resource missing. [HTTP GET: http://jcenter.bintray.com/com/android/support/cardview-v7/23.4.0/cardview-v7-23.4.0.pom] 
Resource missing. [HTTP HEAD: http://jcenter.bintray.com/com/android/support/cardview-v7/23.4.0/cardview-v7-23.4.0.jar] 
Resource missing. [HTTP GET: http://jcenter.bintray.com/com/android/support/customtabs/23.4.0/customtabs-23.4.0.pom] 
Resource missing. [HTTP HEAD: http://jcenter.bintray.com/com/android/support/customtabs/23.4.0/customtabs-23.4.0.jar] 
Creating new cache for metadata-2.23/module-artifacts, path /Users/jenkins/.gradle/caches/modules-2/metadata-2.23/module-artifacts.bin, access [email protected] 
Parsing /Users/jenkins/home/android-sdk/build-tools/25.0.2/package.xml 
Parsing /Users/jenkins/home/android-sdk/build-tools/26.0.1/package.xml 
Parsing /Users/jenkins/home/android-sdk/build-tools/26.0.2/package.xml 
Parsing /Users/jenkins/home/android-sdk/emulator/package.xml 
Parsing /Users/jenkins/home/android-sdk/patcher/v4/package.xml 
Parsing /Users/jenkins/home/android-sdk/platform-tools/package.xml 
Parsing /Users/jenkins/home/android-sdk/platforms/android-25/package.xml 
Parsing /Users/jenkins/home/android-sdk/platforms/android-26/package.xml 
Parsing /Users/jenkins/home/android-sdk/tools/package.xml 
java.net.ConnectException: Connection refused (Connection refused) 
IOException: https://dl.google.com/android/repository/addons_list-3.xml 
java.net.ConnectException: Connection refused (Connection refused) 
IOException: https://dl.google.com/android/repository/addons_list-2.xml 
java.net.ConnectException: Connection refused (Connection refused) 
IOException: https://dl.google.com/android/repository/addons_list-1.xml 
java.net.ConnectException: Connection refused (Connection refused) 
Failed to download any source lists! 

FAILURE: Build failed with an exception. 

* What went wrong: 
A problem occurred configuring project ':app'. 
> java.lang.NullPointerException (no error message) 

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

BUILD FAILED 

Total time: 10.186 secs 
Stopped 0 worker daemon(s). 
Received result Failure[value=org.gradle.initialization.ReportedException: org.gradle.internal.exceptions.LocationAwareException: A problem occurred configuring project ':app'.] from daemon DaemonInfo{pid=6465, address=[3646567b-c480-4beb-a6d2-2ba0120d1cd8 port:54872, addresses:[/0:0:0:0:0:0:0:1, /127.0.0.1]], state=Idle, lastBusy=1506668208517, context=DefaultDaemonContext[uid=6c85c027-6030-4dfe-91b8-6a40166e80af,javaHome=/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home,daemonRegistryDir=/Users/jenkins/.gradle/daemon,pid=6465,idleTimeout=10800000,daemonOpts=-XX:MaxPermSize=256m,-XX:+HeapDumpOnOutOfMemoryError,-Xmx1024m,-Dfile.encoding=UTF-8,-Duser.country=AU,-Duser.language=en,-Duser.variant]} (build should be done). 
の下に持って走った。このエラー

NDK is missing a "platforms" directory. 
If you are using NDK, verify the ndk.dir is set to a valid NDK directory. It is currently set to /Users/jenkins/home/android-sdk/ndk-bundle. 
If you are not using NDK, unset the NDK variable from ANDROID_NDK_HOME or local.properties to remove this warning. 

java.net.ConnectException: Connection refused (Connection refused) 
IOException: https://dl.google.com/android/repository/addons_list-3.xml 
java.net.ConnectException: Connection refused (Connection refused) 
IOException: https://dl.google.com/android/repository/addons_list-2.xml 
java.net.ConnectException: Connection refused (Connection refused) 
IOException: https://dl.google.com/android/repository/addons_list-1.xml 
java.net.ConnectException: Connection refused (Connection refused) 
Failed to download any source lists! 

FAILURE: Build failed with an exception. 

* What went wrong: 
A problem occurred configuring project ':app'. 
> java.lang.NullPointerException (no error message) 

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

次へ]を得ました

〜/ .gradle /と/ Users/jenkins/home/android-sdk/platforms/

にgradle.propertiesを入れてみました

どうすればいいですか?

注:事前に
おかげで(私はGoogleのリポジトリをダウンロードした後に)
同じプロジェクトでは、WindowsマシンとLinuxマシンにAndroidのメーカーから正常に動作します。

+0

誰でも?私はまだこの問題に直面しており、これまでの運はありません。 アンドロイドビルドツールで設定されたcntlmプロキシ設定が採用されていないのに驚いています。 CNTLMが正しく設定され、テストされています。 – VVP

答えて

0

私はそれを理解しました。問題はbuild.gradleファイルにありました。 明らかに、Windows/Linux/Mac用に複数のリポジトリを使用する必要があります。

1)ウィンドウにビルド中に リポジトリhttp://jcenter.bintray.com/から十分です。

しかし、MAC/Linux上でAndroidのビルドをしながら、私たちはhttps://maven.google.com

が必要そこで私は

maven { 
      url 'https://maven.google.com' 
     } 

を追加し、私の最後のbuild.gradleは以下のようになります。

// Top-level build file where you can add configuration options common to all sub-projects/modules. 

buildscript { 
    repositories { 
     jcenter { 
      url "http://jcenter.bintray.com/" 
     } 
     maven { 
      url 'https://maven.google.com' 
     } 

    } 
    dependencies { 
     classpath 'com.android.tools.build:gradle:2.3.3' 

     // NOTE: Do not place your application dependencies here; they belong 
     // in the individual module build.gradle files 
    } 
} 

allprojects { 
    repositories { 
     jcenter { 
      url "http://jcenter.bintray.com/" 
     } 
     maven { 
      url 'https://maven.google.com' 
     } 
    } 
} 

は今のWindows/Linuxの/ Mac上で起こっているを構築します。

関連する問題