2016-11-28 8 views
0

Я пытаюсь построить Android проект Appcelerator через командную строку, используя appc run -b, а затем опцию 1 для Android.Appcelerator Android build не работает во время работы dexer

Эта операция первоначально продолжается, как и ожидалось, но затем вешает на неопределенное то время как Running dexer и в конечном итоге работает из памяти и выдает следующее сообщение об ошибке:

[INFO] Running dexer: /Library/Java/JavaVirtualMachines/jdk1.8.0_77.jdk/Contents/Home/bin/java "-Xmx512M" "-XX:-UseGCOverheadLimit"  "-Djava.ext.dirs=/Users/almcd/Library/android-sdk-macosx/ platform-tools" "-jar" "/Users/almcd/Library/ android-sdk-macosx/build-tools/23.0.1/lib/dx.jar" "--dex" "--output=/Users/almcd/Documents/Appcelerator_Studio_Workspace/ uktvplay_mobile/build/ android/bin/classes.dex" "/Users/almcd/Documents/Appcelerator_Studio_Workspace/uktvplay_mobile/build/ android/bin/classes" "/Users/almcd/Library/Application Support/Titanium/mobilesdk/ osx/5.5.1.GA/android/lib/titanium-verify.jar"  "/Users/almcd/Documents/Appcelerator_Studio_Workspace/uktvplay_mobile/modules/android/com.tripvi.drawerlayout/1.4.2/ drawerlayout.jar" "/Users/ almcd/Documents/Appcelerator_Studio_Workspace/uktvplay_mobile/modules/android/ com.brightcove.uktv/1.4.0/tibrightcove.jar" "/Users/almcd/Documents/Appcelerator_Studio_Workspace/uktvplay_mobile/ modules/ android/com.brightcove.uktv/1.4.0/lib/FWAdManager.jar" "/Users/almcd/Documents/Appcelerator_Studio_Workspace/uktvplay_mobile/ modules/android/com.brightcove.uktv/1.4.0/lib/ android-exoplayer-player-4.6.3.jar" "/Users/almcd/Documents/ Appcelerator_Studio_Workspace/uktvplay_mobile/modules/android/com.brightcove.uktv/1.4.0/lib/android-freewheel-plugin-4.6.3.jar" "/ Users/ almcd/Documents/Appcelerator_Studio_Workspace/uktvplay_mobile/modules/android/com.brightcove.uktv/1.4.0/lib/ android-sdk-4.6.3.jar" "/Users/almcd/Documents/ Appcelerator_Studio_Workspace/uktvplay_mobile/modules/android/ com.brightcove.uktv/1.4.0/lib/android-widevine-plugin-4.6.3.jar" "/Users/almcd/Documents/Appcelerator_Studio_Workspace/  uktvplay_mobile/modules/android/com.brightcove.uktv/1.4.0/lib/com.google.exoplayer-1.5.2.1.jar" "/Users/almcd/Documents/ Appcelerator_Studio_Workspace/uktvplay_mobile/modules/android/ com.brightcove.uktv/1.4.0/lib/spring-appstreaming-android-1.2.3.jar" "/Users/ almcd/Documents/Appcelerator_Studio_Workspace/uktvplay_mobile/modules/android/com.brightcove.uktv/1.4.0/lib/  spring-util-android.jar" "/Users/almcd/Documents/Appcelerator_Studio_Workspace/uktvplay_mobile/modules/android/ analytics.google/3.1.0/analytics.google.jar" "/Users/almcd/Documents/ Appcelerator_Studio_Workspace/uktvplay_mobile/modules/ android/analytics.google/3.1.0/lib/google-play-services.jar" "/Users/almcd/Documents/Appcelerator_Studio_Workspace/ uktvplay_mobile/ modules/android/com.alcoapps.actionbarextras/1.6.9/actionbarextras.jar" "/Users/almcd/Library/Application  Support/Titanium/mobilesdk/osx/5.5.1.GA/android/kroll-v8.jar" "/Users/almcd/Library/ Application Support/Titanium/mobilesdk/ osx/5.5.1.GA/android/modules/titanium-analytics.jar" "/Users/almcd/Library/Application Support/Titanium/mobilesdk/osx/5.5.1.GA/ android/ aps-analytics.jar" "/Users/almcd/Library/Application Support/Titanium/mobilesdk/osx/5.5.1.GA/android/modules/ titanium-android.jar" "/Users/almcd/Library/Application Support/Titanium/mobilesdk/ osx/5.5.1.GA/android/jaxen-1.1.1.jar" "/Users /almcd/Library/Application Support/Titanium/mobilesdk/osx/5.5.1.GA/android/ti-commons-codec-1.3.jar" "/Users/almcd/ Library/Application Support/ Titanium/mobilesdk/osx/5.5.1.GA/android/kroll-common.jar" "/Users/almcd/Library/Application Support/ Titanium/mobilesdk/osx/5.5.1.GA/android/titanium.jar" "/Users/almcd/Library/Application Support/Titanium/mobilesdk/osx/5.5.1.GA/ android/modules/titanium-filesystem.jar" "/Users/almcd/Library/Application Support/Titanium/mobilesdk/osx/5.5.1.GA/android/ modules/ titanium-app.jar" "/Users/almcd/Library/Application Support/Titanium/mobilesdk/osx/5.5.1.GA/android/modules/ titanium-ui.jar" "/Users/almcd/Library/Application Support/Titanium/mobilesdk/ osx/5.5.1.GA/android/ nineoldandroids-appc-2.4.0.jar" "/Users/almcd/Library/Application Support/Titanium/mobilesdk/osx/5.5.1.GA/android/modules/ titanium-media.jar" "/Users/almcd/Library/ Application Support/Titanium/mobilesdk/osx/5.5.1.GA/android/modules/ titanium-appcompat.jar" "/Users/almcd/Library/Application Support/Titanium/mobilesdk/osx/5.5.1.GA/android/  android-support-v4.jar" "/Users/almcd/Library/Application Support/Titanium/mobilesdk/osx/5.5.1.GA/android/ android-support-v7-appcompat.jar" "/Users/almcd/Library/Application Support/Titanium/ mobilesdk/osx/5.5.1.GA/android/modules/ titanium-cardview.jar" "/Users/almcd/Library/Application Support/Titanium/mobilesdk/osx/5.5.1.GA/android/ cardview-v7-23.0.1.jar" "/Users/almcd/ Library/Application Support/Titanium/mobilesdk/osx/5.5.1.GA/android/modules/ titanium-locale.jar" "/Users/almcd/Library/Application Support/Titanium/mobilesdk/osx/5.5.1.GA/android/modules/  titanium-network.jar" "/Users/almcd/Library/Application Support/Titanium/mobilesdk/osx/5.5.1.GA/android/modules/ titanium-xml.jar" "/Users/almcd/Library/Application Support/Titanium/mobilesdk/ osx/5.5.1.GA/android/modules/titanium-utils.jar"  "/Users/almcd/Library/Application Support/Titanium/mobilesdk/osx/5.5.1.GA/android/modules/titanium-geolocation.jar" "/Users/ almcd/Library/ Application Support/Titanium/mobilesdk/osx/5.5.1.GA/android/modules/titanium-accelerometer.jar" "/Users/ almcd/Library/Application Support/Titanium/mobilesdk/osx/5.5.1.GA/android/modules/ titanium-contacts.jar" "/Users/ almcd/Library/Application Support/Titanium/mobilesdk/osx/5.5.1.GA/android/modules/titanium-map.jar" "/Users/almcd/ Library/Application Support/Titanium/ mobilesdk/osx/5.5.1.GA/android/modules/titanium-calendar.jar" "/Users/almcd/Library/ Application Support/Titanium/mobilesdk/osx/5.5.1.GA/android/modules/titanium-gesture.jar" "/Users/almcd/ Library/Application  Support/Titanium/mobilesdk/osx/5.5.1.GA/android/modules/titanium-platform.jar" "/Users/almcd/Library/Application Support/ Titanium/mobilesdk/osx/5.5.1.GA/android/modules /titanium-database.jar" 
    [ERROR] Failed to run dexer: 
    [ERROR] 
    [ERROR] UNEXPECTED TOP-LEVEL ERROR: 
    [ERROR] java.lang.OutOfMemoryError: Java heap space 
    [ERROR]   at java.io.DataInputStream.<init>(DataInputStream.java:58) 
    [ERROR]   at com.android.dx.util.ByteArray$MyDataInputStream.<init>(ByteArray.java:356) 
    [ERROR]   at com.android.dx.util.ByteArray.makeDataInputStream(ByteArray.java:260) 
    [ERROR]   at com.android.dx.cf.direct.StdAttributeFactory.parseLocalVariables(StdAttributeFactory.java:565) 
    [ERROR]   at com.android.dx.cf.direct.StdAttributeFactory.localVariableTable(StdAttributeFactory.java:517) 
    [ERROR]   at com.android.dx.cf.direct.StdAttributeFactory.parse0(StdAttributeFactory.java:178) 
    [ERROR]   at com.android.dx.cf.direct.AttributeFactory.parse(AttributeFactory.java:96) 
    [ERROR]   at com.android.dx.cf.direct.AttributeListParser.parse(AttributeListParser.java:141) 
    [ERROR]   at com.android.dx.cf.direct.AttributeListParser.parseIfNecessary(AttributeListParser.java:115) 
    [ERROR]   at com.android.dx.cf.direct.AttributeListParser.getList(AttributeListParser.java:106) 
    [ERROR]   at com.android.dx.cf.direct.StdAttributeFactory.code(StdAttributeFactory.java:300) 
    [ERROR]   at com.android.dx.cf.direct.StdAttributeFactory.parse0(StdAttributeFactory.java:139) 
    [ERROR]   at com.android.dx.cf.direct.AttributeFactory.parse(AttributeFactory.java:96) 
    [ERROR]   at com.android.dx.cf.direct.AttributeListParser.parse(AttributeListParser.java:141) 
    [ERROR]   at com.android.dx.cf.direct.AttributeListParser.parseIfNecessary(AttributeListParser.java:115) 
    [ERROR]   at com.android.dx.cf.direct.AttributeListParser.getEndOffset(AttributeListParser.java:96) 
    [ERROR]   at com.android.dx.cf.direct.MemberListParser.parse(MemberListParser.java:213) 
    [ERROR]   at com.android.dx.cf.direct.MemberListParser.parseIfNecessary(MemberListParser.java:108) 
    [ERROR]   at com.android.dx.cf.direct.MethodListParser.getList(MethodListParser.java:54) 
    [ERROR]   at com.android.dx.cf.direct.DirectClassFile.parse0(DirectClassFile.java:542) 
    [ERROR]   at com.android.dx.cf.direct.DirectClassFile.parse(DirectClassFile.java:406) 
    [ERROR]   at com.android.dx.cf.direct.DirectClassFile.parseToInterfacesIfNecessary(DirectClassFile.java:388) 
    [ERROR]   at com.android.dx.cf.direct.DirectClassFile.getMagic(DirectClassFile.java:251) 
    [ERROR]   at com.android.dx.command.dexer.Main.parseClass(Main.java:764) 
    [ERROR]   at com.android.dx.command.dexer.Main.access$1500(Main.java:85) 
    [ERROR]   at com.android.dx.command.dexer.Main$ClassParserTask.call(Main.java:1684) 
    [ERROR]   at com.android.dx.command.dexer.Main.processClass(Main.java:749) 
    [ERROR]   at com.android.dx.command.dexer.Main.processFileBytes(Main.java:718) 
    [ERROR]   at com.android.dx.command.dexer.Main.access$1200(Main.java:85) 
    [ERROR]   at com.android.dx.command.dexer.Main$FileBytesConsumer.processFileBytes(Main.java:1645) 
    [ERROR]   at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:284) 
    [ERROR]   at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:166) 

Поиск сообщений в Failed to run dexer ошибок вызывает ряд предложений. До сих пор я пытался:

  • Запуск «Проект> Clean ...» изнутри Appcelerator студии
  • Установка appc ti config android.dx.maxMemory 512M
  • Переустановка Appcelerator Studio, ИКС и Android SDK

Ни один из выше, разрешил ошибку, но я остаюсь полагаю, что проблема связана с моим Android SDK.

Запуск appc ti setup check обеспечивает следующий вывод:

uktvplay_mobile->appc ti setup check 
Appcelerator Command-Line Interface, version 6.0.0 
Copyright (c) 2014-2016, Appcelerator, Inc. All Rights Reserved. 

Enter ctrl-c at any time to quit. 

──────────────────┤ Check Environment ├─────────────────── 

Node.js 
    ✓ node    installed (v5.10.1) 
    ✓ npm    installed (v3.8.3) 

Titanium CLI 
    ✓ cli    bleeding edge (v5.0.10) 

Titanium CLI Dependencies 
    ✓ acs    up-to-date (v1.2.2) 
    ✓ alloy    up-to-date (v1.9.4) 
    ✓ appc-cli-titanium up-to-date (v4.2.83) 
    ✓ appc-inquirer  up-to-date (v0.1.8) 
    ✓ appc-logger  up-to-date (v1.1.27) 
    ✓ appc-platform-sdk up-to-date (v1.3.8) 
    ✓ arrow    up-to-date (v1.8.12) 
    ✓ async    up-to-date (v1.5.2) 
    ✓ chalk    up-to-date (v1.1.3) 
    ✓ char-spinner  up-to-date (v1.0.1) 
    ✓ columnify   up-to-date (v1.5.4) 
    ✓ commander   up-to-date (v2.9.0) 
    ✓ debug    up-to-date (v2.3.0) 
    ✓ ejs    up-to-date (v2.5.2) 
    ✓ fields    up-to-date (v0.1.24) 
    ✓ fs-extra   up-to-date (v0.26.7) 
    ✓ inquirer   up-to-date (v0.11.4) 
    ✓ ip     up-to-date (v1.1.4) 
    ✓ jwt-simple   up-to-date (v0.3.1) 
    ✓ lodash    up-to-date (v3.10.1) 
    ✓ mkdirp    up-to-date (v0.5.1) 
    ✓ node-appc   up-to-date (v0.2.39) 
    ✓ node-forge   up-to-date (v0.6.45) 
    ✓ npmconf   up-to-date (v2.1.2) 
    ✓ plural    up-to-date (v0.2.0) 
    ✓ progress   up-to-date (v1.1.8) 
    ✓ recursive-readdir up-to-date (v1.3.0) 
    ✓ request   up-to-date (v2.78.0) 
    ✓ semver    up-to-date (v5.3.0) 
    ✓ tar    up-to-date (v2.2.1) 
    ✓ tar.gz    up-to-date (v1.0.2) 
    ✓ tiapp.xml   up-to-date (v0.2.2) 
    ✓ titanium   up-to-date (v5.0.10) 
    ✓ which    up-to-date (v1.2.11) 
    ✓ wrench    up-to-date (v1.5.9) 

Titanium SDK 
    ✓ latest sdk   installed (v6.0.0.GA) 
    ✓ selected sdk  up-to-date (v6.0.0.GA) 

Mac OS X Environment 
    ✓ CLI Tools   installed 

iOS Environment 
    ✓ Xcode    installed (8.1) 
    ✓ iOS SDK   installed (10.1) 
    ✓ WWDR cert   installed 
    ✓ developer cert  installed (1 found) 
    ! distribution cert not found 
    ✓ dev provisioning installed (5 found) 
    ✓ dist provisioning installed (2 found) 

Android Environment 
    ✓ sdk    installed (/Users/almcd/Library/android-sdk-macosx) 
    ! tools    untested version 24.4.1; may or may not work 
    ✓ platform tools  installed (v23.1.0) 
    ✓ build tools  installed (v23.0.1) 
    ✓ adb    installed /Users/almcd/Library/android-sdk-macosx/platform-tools/adb 
    ✓ android   installed /Users/almcd/Library/android-sdk-macosx/tools/android 
    ✓ emulator   installed /Users/almcd/Library/android-sdk-macosx/tools/emulator 
    ✓ mksdcard   installed /Users/almcd/Library/android-sdk-macosx/tools/mksdcard 
    ✓ zipalign   installed /Users/almcd/Library/android-sdk-macosx/build-tools/23.0.1/zipalign 
    ✓ aapt    installed /Users/almcd/Library/android-sdk-macosx/build-tools/23.0.1/aapt 
    ✓ aidl    installed /Users/almcd/Library/android-sdk-macosx/build-tools/23.0.1/aidl 
    ✓ targets   installed (1 found) 
    ✓ avds    installed (1 found) 
    ! ndk    Android NDK not found 

Java Development Kit 
    ✓ jdk    installed (v1.8.0) 
    ✓ java    installed /Library/Java/JavaVirtualMachines/jdk1.8.0_77.jdk/Contents/Home/bin/java 
    ✓ javac    installed /Library/Java/JavaVirtualMachines/jdk1.8.0_77.jdk/Contents/Home/bin/javac 
    ✓ keytool   installed /Library/Java/JavaVirtualMachines/jdk1.8.0_77.jdk/Contents/Home/bin/keytool 
    ✓ jarsigner   installed /Library/Java/JavaVirtualMachines/jdk1.8.0_77.jdk/Contents/Home/bin/jarsigner 

Intel® Hardware Accelerated Execution Manager (HAXM) 
    ✓ compatible   
    ✓ installed   

Network 
    ✓ online    
    - no proxy server configured 
    ✕ https://www.google.com (HTTP status: 404) is unreachable 
    ✓ Java-based connection test 

Directory Permissions 
    ✓ home directory  
    ✓ titanium config directory 
    ✓ titanium sdk install directory 
    ✓ temp directory  

Я заметил, что tools под Android Environment определяет предупреждение untested version 24.4.1; may or may not work. Может ли это быть проблемой? Однако более старые версии инструментов Android больше не доступны (после этого ответа: https://stackoverflow.com/a/26365848/2096363).

В противном случае любые рекомендации относительно возможного источника проблемы будут приветствоваться.

Другие подробности о моей среде:

  • ОС Mac OS Sierra v10.12
  • Узел v5.10.1
  • NPM v3.8.3
  • Appcelerator Студия v4.8.0.201611121409
  • Appc CLI v6.0.0
  • Titanium SDK v5.5.1.GA
  • Java v1.8.0_77

ответ

0

Я смог решить эту проблему, удалив каждый модуль Titanium из проекта один за другим и попытавшись построить.

В моем случае этот процесс в конечном итоге привел к тому, что я идентифицировал модуль analytics.google, который я использовал в качестве источника проблемы. Замена этого модуля для более активно поддерживаемого модуля ti.ga исправлена.

Проводя этот ответ в надежде, что такой подход к определению источника ошибки может быть полезен для всех, кто сталкивается с той же проблемой.

 Смежные вопросы

  • Нет связанных вопросов^_^