Cordova google-analytics-plugin导致phonegap iOS版本失败

时间:2015-11-24 17:24:12

标签: ios cordova phonegap-plugins

我为我的phonegap应用程序安装了cordova google-analytics插件(1),它可以正常使用android,但它会导致我的iOS版本失败(如果我删除插件,那么我可以成功运行iOS版本当我运行phonegap build ios时,我收到以下错误:

Undefined symbols for architecture i386:                                                                                                                                                                                                                             [115/15414]
  "_deflate", referenced from:
      +[GAICompressionUtil gai_dataByCompressingBytes:length:compressionLevel:mode:] in libGoogleAnalyticsServices.a(GAICompressionUtil.o)
  "_deflateEnd", referenced from:
      +[GAICompressionUtil gai_dataByCompressingBytes:length:compressionLevel:mode:] in libGoogleAnalyticsServices.a(GAICompressionUtil.o)
  "_deflateInit2_", referenced from:
      +[GAICompressionUtil gai_dataByCompressingBytes:length:compressionLevel:mode:] in libGoogleAnalyticsServices.a(GAICompressionUtil.o)
  "_inflate", referenced from:
      +[GAICompressionUtil gai_dataByInflatingBytes:length:isRawData:] in libGoogleAnalyticsServices.a(GAICompressionUtil.o)
  "_inflateEnd", referenced from:
      +[GAICompressionUtil gai_dataByInflatingBytes:length:isRawData:] in libGoogleAnalyticsServices.a(GAICompressionUtil.o)
  "_inflateInit2_", referenced from:
      +[GAICompressionUtil gai_dataByInflatingBytes:length:isRawData:] in libGoogleAnalyticsServices.a(GAICompressionUtil.o)
  "_sqlite3_bind_blob", referenced from:
      -[TAGDataLayerPersistentStoreImpl writeEntriesToDatabase:expireTime:] in libGoogleAnalyticsServices.a(TAGDataLayerPersistentStoreImpl.o)
  "_sqlite3_bind_double", referenced from:
      -[GAIAnalyticsPropertiesStore bindRecord:toUpsertStatement:] in libGoogleAnalyticsServices.a(GAIAnalyticsPropertiesStore.o)
  "_sqlite3_bind_int", referenced from:
      -[TAGDataLayerPersistentStoreImpl deleteEntries:] in libGoogleAnalyticsServices.a(TAGDataLayerPersistentStoreImpl.o)
  "_sqlite3_bind_int64", referenced from:
      -[TAGDataLayerPersistentStoreImpl writeEntriesToDatabase:expireTime:] in libGoogleAnalyticsServices.a(TAGDataLayerPersistentStoreImpl.o)
      -[TAGDataLayerPersistentStoreImpl peekEntryIds:] in libGoogleAnalyticsServices.a(TAGDataLayerPersistentStoreImpl.o)
      -[TAGDataLayerPersistentStoreImpl deleteEntriesOlderThan:] in libGoogleAnalyticsServices.a(TAGDataLayerPersistentStoreImpl.o)
      -[GAIAnalyticsPropertiesStore bindRecord:toUpsertStatement:] in libGoogleAnalyticsServices.a(GAIAnalyticsPropertiesStore.o)
  "_sqlite3_bind_text", referenced from:
      -[GAISqlStore tableExists:] in libGoogleAnalyticsServices.a(GAISqlStore.o)
      -[TAGDataLayerPersistentStoreImpl clearKeysWithPrefixSingleThreaded:] in libGoogleAnalyticsServices.a(TAGDataLayerPersistentStoreImpl.o)
      -[TAGDataLayerPersistentStoreImpl writeEntriesToDatabase:expireTime:] in libGoogleAnalyticsServices.a(TAGDataLayerPersistentStoreImpl.o)
      -[GAIAnalyticsPropertiesStore bindRecord:toUpsertStatement:] in libGoogleAnalyticsServices.a(GAIAnalyticsPropertiesStore.o)
      -[GAIAnalyticsPropertiesStore selectStmtWithTrackingId:] in libGoogleAnalyticsServices.a(GAIAnalyticsPropertiesStore.o)
  "_sqlite3_close", referenced from:
      -[GAISqlStore closeDatabase] in libGoogleAnalyticsServices.a(GAISqlStore.o)
      -[TAGDataLayerPersistentStoreImpl closeDatabase] in libGoogleAnalyticsServices.a(TAGDataLayerPersistentStoreImpl.o)
  "_sqlite3_column_blob", referenced from:
      -[TAGDataLayerPersistentStoreImpl loadSerialized] in libGoogleAnalyticsServices.a(TAGDataLayerPersistentStoreImpl.o)
  "_sqlite3_column_bytes", referenced from:
      -[TAGDataLayerPersistentStoreImpl loadSerialized] in libGoogleAnalyticsServices.a(TAGDataLayerPersistentStoreImpl.o)
  "_sqlite3_column_count", referenced from:
      -[GAISqlStore openAndValidateDatabase] in libGoogleAnalyticsServices.a(GAISqlStore.o)
  "_sqlite3_column_double", referenced from:
      -[GAIAnalyticsPropertiesStore propertyRecordForTrackingId:] in libGoogleAnalyticsServices.a(GAIAnalyticsPropertiesStore.o)
  "_sqlite3_column_int", referenced from:
      -[GAISqlStore rowCountForTableWithName:] in libGoogleAnalyticsServices.a(GAISqlStore.o)
  "_sqlite3_column_int64", referenced from:
      -[TAGDataLayerPersistentStoreImpl peekEntryIds:] in libGoogleAnalyticsServices.a(TAGDataLayerPersistentStoreImpl.o)
      -[TAGDataLayerPersistentStoreImpl numStoredEntries] in libGoogleAnalyticsServices.a(TAGDataLayerPersistentStoreImpl.o)
      -[GAIAnalyticsPropertiesStore propertyRecordForTrackingId:] in libGoogleAnalyticsServices.a(GAIAnalyticsPropertiesStore.o)
  "_sqlite3_column_text", referenced from:
      -[GAISqlStore openAndValidateDatabase] in libGoogleAnalyticsServices.a(GAISqlStore.o)
      -[TAGDataLayerPersistentStoreImpl loadSerialized] in libGoogleAnalyticsServices.a(TAGDataLayerPersistentStoreImpl.o)
      -[GAIAnalyticsPropertiesStore hasValidPropertyColumns] in libGoogleAnalyticsServices.a(GAIAnalyticsPropertiesStore.o)
      -[GAIAnalyticsPropertiesStore propertyRecordForTrackingId:] in libGoogleAnalyticsServices.a(GAIAnalyticsPropertiesStore.o)
  "_sqlite3_errcode", referenced from:
      -[TAGDataLayerPersistentStoreImpl prepareSql:description:] in libGoogleAnalyticsServices.a(TAGDataLayerPersistentStoreImpl.o)
"_sqlite3_errmsg", referenced from:                                                                                                                                                                                                                                 [61/15414]
      -[GAISqlStore errorMessage] in libGoogleAnalyticsServices.a(GAISqlStore.o)
      -[TAGDataLayerPersistentStoreImpl clearKeysWithPrefixSingleThreaded:] in libGoogleAnalyticsServices.a(TAGDataLayerPersistentStoreImpl.o)
      -[TAGDataLayerPersistentStoreImpl writeEntriesToDatabase:expireTime:] in libGoogleAnalyticsServices.a(TAGDataLayerPersistentStoreImpl.o)
      -[TAGDataLayerPersistentStoreImpl deleteEntries:] in libGoogleAnalyticsServices.a(TAGDataLayerPersistentStoreImpl.o)
      -[TAGDataLayerPersistentStoreImpl numStoredEntries] in libGoogleAnalyticsServices.a(TAGDataLayerPersistentStoreImpl.o)
      -[TAGDataLayerPersistentStoreImpl deleteEntriesOlderThan:] in libGoogleAnalyticsServices.a(TAGDataLayerPersistentStoreImpl.o)
      -[TAGDataLayerPersistentStoreImpl tablePresent:] in libGoogleAnalyticsServices.a(TAGDataLayerPersistentStoreImpl.o)
      ...
  "_sqlite3_finalize", referenced from:
      -[GAISqlStore removeStatementForQuery:] in libGoogleAnalyticsServices.a(GAISqlStore.o)
      -[GAISqlStore finalizeAndClearStatements] in libGoogleAnalyticsServices.a(GAISqlStore.o)
      -[GAISqlStore openAndValidateDatabase] in libGoogleAnalyticsServices.a(GAISqlStore.o)
      -[GAISqlStore prepareSql:] in libGoogleAnalyticsServices.a(GAISqlStore.o)
      -[GAISqlStore executeSql:] in libGoogleAnalyticsServices.a(GAISqlStore.o)
      -[TAGDataLayerPersistentStoreImpl clearKeysWithPrefixSingleThreaded:] in libGoogleAnalyticsServices.a(TAGDataLayerPersistentStoreImpl.o)
      -[TAGDataLayerPersistentStoreImpl deleteEntries:] in libGoogleAnalyticsServices.a(TAGDataLayerPersistentStoreImpl.o)
      ...
  "_sqlite3_open", referenced from:
      -[TAGDataLayerPersistentStoreImpl openDatabaseAndInitStatements] in libGoogleAnalyticsServices.a(TAGDataLayerPersistentStoreImpl.o)
  "_sqlite3_open_v2", referenced from:
      -[GAISqlStore openAndValidateDatabase] in libGoogleAnalyticsServices.a(GAISqlStore.o)
  "_sqlite3_prepare_v2", referenced from:
      -[GAISqlStore prepareSql:] in libGoogleAnalyticsServices.a(GAISqlStore.o)
      -[TAGDataLayerPersistentStoreImpl prepareSql:description:] in libGoogleAnalyticsServices.a(TAGDataLayerPersistentStoreImpl.o)
  "_sqlite3_reset", referenced from:
      -[GAISqlStore rowCountForTableWithName:] in libGoogleAnalyticsServices.a(GAISqlStore.o)
      -[GAISqlStore tableExists:] in libGoogleAnalyticsServices.a(GAISqlStore.o)
      -[GAISqlStore dropTableWithName:] in libGoogleAnalyticsServices.a(GAISqlStore.o)
      -[TAGDataLayerPersistentStoreImpl loadSerialized] in libGoogleAnalyticsServices.a(TAGDataLayerPersistentStoreImpl.o)
      -[TAGDataLayerPersistentStoreImpl writeEntriesToDatabase:expireTime:] in libGoogleAnalyticsServices.a(TAGDataLayerPersistentStoreImpl.o)
      -[TAGDataLayerPersistentStoreImpl peekEntryIds:] in libGoogleAnalyticsServices.a(TAGDataLayerPersistentStoreImpl.o)
      -[TAGDataLayerPersistentS
toreImpl numStoredEntries] in libGoogleAnalyticsServices.a(TAGDataLayerPersistentStoreImpl.o)
      ...
  "_sqlite3_step", referenced from:
      -[GAISqlStore rowCountForTableWithName:] in libGoogleAnalyticsServices.a(GAISqlStore.o)
      -[GAISqlStore openAndValidateDatabase] in libGoogleAnalyticsServices.a(GAISqlStore.o)
      -[GAISqlStore tableExists:] in libGoogleAnalyticsServices.a(GAISqlStore.o)
      -[GAISqlStore dropTableWithName:] in libGoogleAnalyticsServices.a(GAISqlStore.o)
      -[GAISqlStore executeSql:] in libGoogleAnalyticsServices.a(GAISqlStore.o)
      -[TAGDataLayerPersistentStoreImpl clearKeysWithPrefixSingleThreaded:] in libGoogleAnalyticsServices.a(TAGDataLayerPersistentStoreImpl.o)
      -[TAGDataLayerPersistentStoreImpl loadSerialized] in libGoogleAnalyticsServices.a(TAGDataLayerPersistentStoreImpl.o)
      ...
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)


** BUILD FAILED **


The following build commands failed:

        Ld build/emulator/Treys.app/Treys normal i386
(1 failure)

Error code 65 for command: xcodebuild with args: -xcconfig,/Users/Rylan/cisc/intoli/treys/phonegap/platforms/ios/cordova/build-debug.xcconfig,-project,Treys.xcodeproj,ARCHS=i386,-target,Treys,-configuration,Debug,-sdk,iphonesimulator,build,VALID_ARCHS=i386,CONFIGURATION_B
UILD_DIR=/Users/Rylan/cisc/intoli/treys/phonegap/platforms/ios/build/emulator,SHARED_PRECOMPS_DIR=/Users/Rylan/cisc/intoli/treys/phonegap/platforms/ios/build/sharedpch

ERROR building one of the platforms: Error: /Users/Rylan/cisc/intoli/treys/phonegap/platforms/ios/cordova/build: Command failed with exit code 2
You may not have the required environment or OS to build this project

Error: /Users/Rylan/cisc/intoli/treys/phonegap/platforms/ios/cordova/build: Command failed with exit code 2
    at ChildProcess.whenDone (/usr/local/lib/node_modules/phonegap/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:139:23)
    at ChildProcess.emit (events.js:110:17)
    at maybeClose (child_process.js:1008:16)
    at Process.ChildProcess._handle.onexit (child_process.js:1080:5)

我检查了XCode项目,libsqlite3.dylib在框架列表中,我明确地将-lsqlite3添加到构建设置中的链接标记列表中。当我尝试在XCode中构建它时,我得到了一长串几乎相同的错误。下面是输出的截断部分:

duplicate symbol _llvm.embedded.module in:
    /Users/Rylan/cisc/intoli/treys/phonegap/platforms/ios/Treys/Plugins/cordova-plugin-google-analytics/libGoogleAnalyticsServices.a(TAGHit.o)
    /Users/Rylan/cisc/intoli/treys/phonegap/platforms/ios/Treys/Plugins/cordova-plugin-google-analytics/libGoogleAnalyticsServices.a(TAGTrackingTag.o)
duplicate symbol _llvm.cmdline in:
    /Users/Rylan/cisc/intoli/treys/phonegap/platforms/ios/Treys/Plugins/cordova-plugin-google-analytics/libGoogleAnalyticsServices.a(TAGHit.o)
    /Users/Rylan/cisc/intoli/treys/phonegap/platforms/ios/Treys/Plugins/cordova-plugin-google-analytics/libGoogleAnalyticsServices.a(TAGUniversalAnalytics.o)
duplicate symbol _llvm.embedded.module in:
    /Users/Rylan/cisc/intoli/treys/phonegap/platforms/ios/Treys/Plugins/cordova-plugin-google-analytics/libGoogleAnalyticsServices.a(TAGHit.o)
    /Users/Rylan/cisc/intoli/treys/phonegap/platforms/ios/Treys/Plugins/cordova-plugin-google-analytics/libGoogleAnalyticsServices.a(TAGUniversalAnalytics.o)
duplicate symbol _llvm.cmdline in:
    /Users/Rylan/cisc/intoli/treys/phonegap/platforms/ios/Treys/Plugins/cordova-plugin-google-analytics/libGoogleAnalyticsServices.a(TAGHit.o)
    /Users/Rylan/cisc/intoli/treys/phonegap/platforms/ios/Treys/Plugins/cordova-plugin-google-analytics/libGoogleAnalyticsServices.a(TAGPValueHash.o)
duplicate symbol _llvm.embedded.module in:
    /Users/Rylan/cisc/intoli/treys/phonegap/platforms/ios/Treys/Plugins/cordova-plugin-google-analytics/libGoogleAnalyticsServices.a(TAGHit.o)
    /Users/Rylan/cisc/intoli/treys/phonegap/platforms/ios/Treys/Plugins/cordova-plugin-google-analytics/libGoogleAnalyticsServices.a(TAGPValueHash.o)
ld: 230 duplicate symbols for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

科尔多瓦:5.4.0

Phonegap:5.3.6

XCode:6.2

OSX:10.9.5

1 个答案:

答案 0 :(得分:0)

尝试删除插件,构建ios然后读取插件。之后重建ios可能会成功。

如果失败,请尝试删除插件和平台,然后再次添加以重建。

第二种选择对我有用。