Skip to content
This repository has been archived by the owner on Sep 4, 2020. It is now read-only.

Unable to build iOS app when using push plugin #1236

Closed
sawanmhjn opened this issue Sep 22, 2016 · 8 comments
Closed

Unable to build iOS app when using push plugin #1236

sawanmhjn opened this issue Sep 22, 2016 · 8 comments

Comments

@sawanmhjn
Copy link

Expected Behaviour

Build iOS app

Actual Behaviour

It shows below error when try to build


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/push_notification_sample.app/push_notification_sample normal i386
(1 failure)
ERROR building one of the platforms: Error code 65 for command: xcodebuild with args: -xcconfig,/Users/Admin/ionic_projects/samples/push_notification_sample/platforms/ios/cordova/build-debug.xcconfig,-project,push_notification_sample.xcodeproj,ARCHS=i386,-target,push_notification_sample,-configuration,Debug,-sdk,iphonesimulator,build,
VALID_ARCHS=i386,
CONFIGURATION_BUILD_DIR=/Users/Admin/ionic_projects/samples/push_notification_sample/platforms/ios/build/emulator,
SHARED_PRECOMPS_DIR=/Users/Admin/ionic_projects/samples/push_notification_sample/platforms/ios/build/sharedpch
You may not have the required environment or OS to build this project

Error: Error code 65 for command: xcodebuild with args: -xcconfig,/Users/Admin/ionic_projects/samples/push_notification_sample/platforms/ios/cordova/build-debug.xcconfig,-project,push_notification_sample.xcodeproj,
ARCHS=i386,-target,push_notification_sample,-configuration,Debug,-sdk,iphonesimulator,build,
VALID_ARCHS=i386,
CONFIGURATION_BUILD_DIR=/Users/Admin/ionic_projects/samples/push_notification_sample/platforms/ios/build/emulator,
SHARED_PRECOMPS_DIR=/Users/Admin/ionic_projects/samples/push_notification_sample/platforms/ios/build/sharedpch

Steps to Reproduce

Create a new project
Add [email protected] platform
Add plugin cordova plugin add https://github.com/phonegap/phonegap-plugin-push --variable SENDER_ID="xxxxxxxx"
build the app for iOS

Note : when uninstall the plugin i can build normally .

xCode version

XCODE : 7.3
OSX El CAPITAN Version 10.11

Cordova CLI version and cordova platform version

cordova --version                                   6.0.0
cordova platform version android                4.1.0

Plugin version

cordova plugin version | grep phonegap-plugin-push   1.8.2 

Complete Error Log


Undefined symbols for architecture i386:
  "_deflate", referenced from:
      +[NSData(GTMZlibAdditionsPrivate) gtm_dataByCompressingBytes:length:compressionLevel:mode:] in libGTM_NSData+zlib.a(GTMNSData+zlib.o)
  "_deflateEnd", referenced from:
      +[NSData(GTMZlibAdditionsPrivate) gtm_dataByCompressingBytes:length:compressionLevel:mode:] in libGTM_NSData+zlib.a(GTMNSData+zlib.o)
  "_deflateInit2_", referenced from:
      +[NSData(GTMZlibAdditionsPrivate) gtm_dataByCompressingBytes:length:compressionLevel:mode:] in libGTM_NSData+zlib.a(GTMNSData+zlib.o)
  "_inflate", referenced from:
      +[NSData(GTMZlibAdditionsPrivate) gtm_dataByInflatingBytes:length:isRawData:] in libGTM_NSData+zlib.a(GTMNSData+zlib.o)
  "_inflateEnd", referenced from:
      +[NSData(GTMZlibAdditionsPrivate) gtm_dataByInflatingBytes:length:isRawData:] in libGTM_NSData+zlib.a(GTMNSData+zlib.o)
  "_inflateInit2_", referenced from:
      +[NSData(GTMZlibAdditionsPrivate) gtm_dataByInflatingBytes:length:isRawData:] in libGTM_NSData+zlib.a(GTMNSData+zlib.o)
  "_sqlite3_bind_blob", referenced from:
      ___59-[GMRSqliteStore upsertStatementForRecord:inTableWithName:]_block_invoke350 in libGGLCore.a(GMRSqliteStore.o)
      -[GCMRmq2PersistentStore saveMessageWithRmqId:tag:data:error:] in libGcmLib.a(GCMRmq2PersistentStore.o)
  "_sqlite3_bind_double", referenced from:
      ___59-[GMRSqliteStore upsertStatementForRecord:inTableWithName:]_block_invoke350 in libGGLCore.a(GMRSqliteStore.o)
  "_sqlite3_bind_int", referenced from:
      -[GCMRmq2PersistentStore saveMessageWithRmqId:tag:data:error:] in libGcmLib.a(GCMRmq2PersistentStore.o)
      -[GCMRmq2PersistentStore updateLastOutgoingRmqId:] in libGcmLib.a(GCMRmq2PersistentStore.o)
      -[GCMRmq2PersistentStore saveSyncMessageWithRmqID:expirationTime:apnsReceived:mcsReceived:error:] in libGcmLib.a(GCMRmq2PersistentStore.o)
  "_sqlite3_bind_int64", referenced from:
      ___59-[GMRSqliteStore upsertStatementForRecord:inTableWithName:]_block_invoke350 in libGGLCore.a(GMRSqliteStore.o)
      -[GCMRmq2PersistentStore saveMessageWithRmqId:tag:data:error:] in libGcmLib.a(GCMRmq2PersistentStore.o)
      -[GCMRmq2PersistentStore deleteMessagesFromTable:withRmqIds:] in libGcmLib.a(GCMRmq2PersistentStore.o)
      -[GCMRmq2PersistentStore updateLastOutgoingRmqId:] in libGcmLib.a(GCMRmq2PersistentStore.o)
      -[GCMRmq2PersistentStore saveSyncMessageWithRmqID:expirationTime:apnsReceived:mcsReceived:error:] in libGcmLib.a(GCMRmq2PersistentStore.o)
  "_sqlite3_bind_null", referenced from:
      ___59-[GMRSqliteStore upsertStatementForRecord:inTableWithName:]_block_invoke350 in libGGLCore.a(GMRSqliteStore.o)
  "_sqlite3_bind_text", referenced from:
      -[GMRSqliteStore bindToStatement:text:atIndex:] in libGGLCore.a(GMRSqliteStore.o)
      -[GCMRmq2PersistentStore saveUnackedS2dMessageWithRmqId:] in libGcmLib.a(GCMRmq2PersistentStore.o)
      -[GCMRmq2PersistentStore deleteMessagesFromTable:withRmqIds:] in libGcmLib.a(GCMRmq2PersistentStore.o)
      -[GCMRmq2PersistentStore saveSyncMessageWithRmqID:expirationTime:apnsReceived:mcsReceived:error:] in libGcmLib.a(GCMRmq2PersistentStore.o)
      -[GCMRmq2PersistentStore updateSyncMessageWithRmqID:column:value:error:] in libGcmLib.a(GCMRmq2PersistentStore.o)
  "_sqlite3_changes", referenced from:
      -[GCMRmq2PersistentStore deleteMessagesFromTable:withRmqIds:] in libGcmLib.a(GCMRmq2PersistentStore.o)
      -[GCMRmq2PersistentStore deleteExpiredOrFinishedSyncMessages:] in libGcmLib.a(GCMRmq2PersistentStore.o)
  "_sqlite3_clear_bindings", referenced from:
      -[GMRSqliteStore tableExists:] in libGGLCore.a(GMRSqliteStore.o)
      -[GMRSqliteStore rowCountForTableWithName:columnName:columnValue:] in libGGLCore.a(GMRSqliteStore.o)
      -[GMRSqliteStore recordsForQuery:] in libGGLCore.a(GMRSqliteStore.o)
  "_sqlite3_close", referenced from:
      -[GMRSqliteStore closeDatabase] in libGGLCore.a(GMRSqliteStore.o)
      -[GCMRmq2PersistentStore dealloc] in libGcmLib.a(GCMRmq2PersistentStore.o)
  "_sqlite3_column_blob", referenced from:
      -[GMRSqliteStore valueAtColumn:forStatement:] in libGGLCore.a(GMRSqliteStore.o)
      -[GCMRmq2PersistentStore scanOutgoingRmqMessagesWithHandler:] in libGcmLib.a(GCMRmq2PersistentStore.o)
  "_sqlite3_column_bytes", referenced from:
      -[GMRSqliteStore valueAtColumn:forStatement:] in libGGLCore.a(GMRSqliteStore.o)
      -[GCMRmq2PersistentStore scanOutgoingRmqMessagesWithHandler:] in libGcmLib.a(GCMRmq2PersistentStore.o)
  "_sqlite3_column_count", referenced from:
      -[GMRSqliteStore recordsForQuery:] in libGGLCore.a(GMRSqliteStore.o)
      -[GMRSqliteStore validateDatabase] in libGGLCore.a(GMRSqliteStore.o)
  "_sqlite3_column_double", referenced from:
      -[GMRSqliteStore valueAtColumn:forStatement:] in libGGLCore.a(GMRSqliteStore.o)
  "_sqlite3_column_int", referenced from:
      -[GMRSqliteStore rowCountForTableWithName:columnName:columnValue:] in libGGLCore.a(GMRSqliteStore.o)
      -[GCMRmq2PersistentStore scanOutgoingRmqMessagesWithHandler:] in libGcmLib.a(GCMRmq2PersistentStore.o)
      -[GCMRmq2PersistentStore querySyncMessageWithRmqID:] in libGcmLib.a(GCMRmq2PersistentStore.o)
  "_sqlite3_column_int64", referenced from:
      -[GMRSqliteStore valueAtColumn:forStatement:] in libGGLCore.a(GMRSqliteStore.o)
      -[GCMRmq2PersistentStore queryHighestRmqId] in libGcmLib.a(GCMRmq2PersistentStore.o)
      -[GCMRmq2PersistentStore queryLastRmqId] in libGcmLib.a(GCMRmq2PersistentStore.o)
      -[GCMRmq2PersistentStore scanOutgoingRmqMessagesWithHandler:] in libGcmLib.a(GCMRmq2PersistentStore.o)
      -[GCMRmq2PersistentStore querySyncMessageWithRmqID:] in libGcmLib.a(GCMRmq2PersistentStore.o)
  "_sqlite3_column_name", referenced from:
      -[GMRSqliteStore recordsForQuery:] in libGGLCore.a(GMRSqliteStore.o)
  "_sqlite3_column_text", referenced from:
      -[GMRSqliteStore columnsForTableWithName:] in libGGLCore.a(GMRSqliteStore.o)
      -[GMRSqliteStore validateDatabase] in libGGLCore.a(GMRSqliteStore.o)
      -[GMRSqliteStore valueAtColumn:forStatement:] in libGGLCore.a(GMRSqliteStore.o)
      -[GCMRmq2PersistentStore unackedS2dRmqIds] in libGcmLib.a(GCMRmq2PersistentStore.o)
      -[GCMRmq2PersistentStore querySyncMessageWithRmqID:] in libGcmLib.a(GCMRmq2PersistentStore.o)
  "_sqlite3_column_type", referenced from:
      -[GMRSqliteStore valueAtColumn:forStatement:] in libGGLCore.a(GMRSqliteStore.o)
  "_sqlite3_errcode", referenced from:
      -[GCMRmq2PersistentStore saveMessageWithRmqId:tag:data:error:] in libGcmLib.a(GCMRmq2PersistentStore.o)
      -[GCMRmq2PersistentStore deleteExpiredOrFinishedSyncMessages:] in libGcmLib.a(GCMRmq2PersistentStore.o)
      -[GCMRmq2PersistentStore saveSyncMessageWithRmqID:expirationTime:apnsReceived:mcsReceived:error:] in libGcmLib.a(GCMRmq2PersistentStore.o)
      -[GCMRmq2PersistentStore updateSyncMessageWithRmqID:column:value:error:] in libGcmLib.a(GCMRmq2PersistentStore.o)
      -[GCMRmq2PersistentStore lastErrorCode] in libGcmLib.a(GCMRmq2PersistentStore.o)
  "_sqlite3_errmsg", referenced from:
      -[GMRSqliteStore lastErrorMessage] in libGGLCore.a(GMRSqliteStore.o)
      -[GCMRmq2PersistentStore saveMessageWithRmqId:tag:data:error:] in libGcmLib.a(GCMRmq2PersistentStore.o)
      -[GCMRmq2PersistentStore lastErrorMessage] in libGcmLib.a(GCMRmq2PersistentStore.o)
  "_sqlite3_exec", referenced from:
      -[GMRSqliteStore beginTransaction] in libGGLCore.a(GMRSqliteStore.o)
      -[GMRSqliteStore endTransaction] in libGGLCore.a(GMRSqliteStore.o)
      -[GMRSqliteStore rollbackTransaction] in libGGLCore.a(GMRSqliteStore.o)
      -[GCMRmq2PersistentStore createTableWithName:command:] in libGcmLib.a(GCMRmq2PersistentStore.o)
      -[GCMRmq2PersistentStore dropTableWithName:] in libGcmLib.a(GCMRmq2PersistentStore.o)
  "_sqlite3_finalize", referenced from:
      -[GMRSqliteStore columnsForTableWithName:] in libGGLCore.a(GMRSqliteStore.o)
      -[GMRSqliteStore deleteRecordFromTableWithName:columnName:columnValue:] in libGGLCore.a(GMRSqliteStore.o)
      -[GMRSqliteStore deleteRecordsFromTableWithName:condition:] in libGGLCore.a(GMRSqliteStore.o)
      -[GMRSqliteStore recordsForQuery:] in libGGLCore.a(GMRSqliteStore.o)
      -[GMRSqliteStore removeStatementForQuery:] in libGGLCore.a(GMRSqliteStore.o)
      -[GMRSqliteStore prepareSQL:] in libGGLCore.a(GMRSqliteStore.o)
      -[GMRSqliteStore executeSQLStatement:] in libGGLCore.a(GMRSqliteStore.o)
      ...
  "_sqlite3_open", referenced from:
      -[GCMRmq2PersistentStore openDatabase:] in libGcmLib.a(GCMRmq2PersistentStore.o)
  "_sqlite3_open_v2", referenced from:
      -[GMRSqliteStore openAndValidateDatabase] in libGGLCore.a(GMRSqliteStore.o)
  "_sqlite3_prepare_v2", referenced from:
      -[GMRSqliteStore prepareSQL:] in libGGLCore.a(GMRSqliteStore.o)
      -[GCMRmq2PersistentStore saveUnackedS2dMessageWithRmqId:] in libGcmLib.a(GCMRmq2PersistentStore.o)
      -[GCMRmq2PersistentStore saveMessageWithRmqId:tag:data:error:] in libGcmLib.a(GCMRmq2PersistentStore.o)
      -[GCMRmq2PersistentStore deleteMessagesFromTable:withRmqIds:] in libGcmLib.a(GCMRmq2PersistentStore.o)
      -[GCMRmq2PersistentStore queryHighestRmqId] in libGcmLib.a(GCMRmq2PersistentStore.o)
      -[GCMRmq2PersistentStore queryLastRmqId] in libGcmLib.a(GCMRmq2PersistentStore.o)
      -[GCMRmq2PersistentStore updateLastOutgoingRmqId:] in libGcmLib.a(GCMRmq2PersistentStore.o)
      ...
  "_sqlite3_reset", referenced from:
      -[GMRSqliteStore tableExists:] in libGGLCore.a(GMRSqliteStore.o)
      -[GMRSqliteStore dropTableWithName:] in libGGLCore.a(GMRSqliteStore.o)
      -[GMRSqliteStore rowCountForTableWithName:columnName:columnValue:] in libGGLCore.a(GMRSqliteStore.o)
      -[GMRSqliteStore deleteAllRecordsFromTableWithName:] in libGGLCore.a(GMRSqliteStore.o)
      -[GMRSqliteStore recordsForQuery:] in libGGLCore.a(GMRSqliteStore.o)
  "_sqlite3_step", referenced from:
      -[GMRSqliteStore tableExists:] in libGGLCore.a(GMRSqliteStore.o)
      -[GMRSqliteStore dropTableWithName:] in libGGLCore.a(GMRSqliteStore.o)
      -[GMRSqliteStore rowCountForTableWithName:columnName:columnValue:] in libGGLCore.a(GMRSqliteStore.o)
      -[GMRSqliteStore columnsForTableWithName:] in libGGLCore.a(GMRSqliteStore.o)
      -[GMRSqliteStore deleteRecordFromTableWithName:columnName:columnValue:] in libGGLCore.a(GMRSqliteStore.o)
      -[GMRSqliteStore deleteRecordsFromTableWithName:condition:] in libGGLCore.a(GMRSqliteStore.o)
      -[GMRSqliteStore deleteAllRecordsFromTableWithName:] in libGGLCore.a(GMRSqliteStore.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/push_notification_sample.app/push_notification_sample normal i386
(1 failure)
ERROR building one of the platforms: Error code 65 for command: xcodebuild with args: -xcconfig,/Users/Admin/ionic_projects/samples/push_notification_sample/platforms/ios/cordova/build-debug.xcconfig,-project,push_notification_sample.xcodeproj,ARCHS=i386,-target,push_notification_sample,-configuration,Debug,-sdk,iphonesimulator,build,VALID_ARCHS=i386,CONFIGURATION_BUILD_DIR=/Users/Admin/ionic_projects/samples/push_notification_sample/platforms/ios/build/emulator,SHARED_PRECOMPS_DIR=/Users/Admin/ionic_projects/samples/push_notification_sample/platforms/ios/build/sharedpch
You may not have the required environment or OS to build this project
Error: Error code 65 for command: xcodebuild with args: -xcconfig,/Users/Admin/ionic_projects/samples/push_notification_sample/platforms/ios/cordova/build-debug.xcconfig,-project,push_notification_sample.xcodeproj,ARCHS=i386,-target,push_notification_sample,-configuration,Debug,-sdk,iphonesimulator,build,VALID_ARCHS=i386,CONFIGURATION_BUILD_DIR=/Users/Admin/ionic_projects/samples/push_notification_sample/platforms/ios/build/emulator,SHARED_PRECOMPS_DIR=/Users/Admin/ionic_projects/samples/push_notification_sample/platforms/ios/build/sharedpch
@macdonst
Copy link
Member

@sawanmhjn did you read #981 #458 #486 #570?

Probably is usually caused by not being up to date with Xcode or the platforms/ios directory is not clean. Try doing:

cordova platform rm ios
cordova platform add ios

to reset stuff.

@sawanmhjn
Copy link
Author

@macdonst I read #981 #458 #486 #570 documents..

cordova platform rm ios
cordova platform add ios

I tried many times with different different scenarios but its not working...

@macdonst
Copy link
Member

@sawanmhjn well all of the errors you posted are for code that is not included by the push plugin.

@omhybrid
Copy link

yes i have same error when ionic package build ios

@macdonst
Copy link
Member

Closing, inactivity. Please comment/re-open if you have more details.

@aqibmapari
Copy link

aqibmapari commented Nov 8, 2017

I am getting this error while building

The following build commands failed:
CompileC /var/root/Library/Developer/Xcode/DerivedData/HRAttendance-ejmaxctjtwbgyrbgntbjbpdkpont/Build/Intermediates.noindex/HRAttendance.build/Debug-iphonesimulator/HRAttendance.build/Objects-normal/x86_64/PushPlugin.o HRAttendance/Plugins/com.phonegap.plugins.PushPlugin/PushPlugin.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
Error: Error code 65 for command: xcodebuild with args: -xcconfig,/Users/aqibmapari/CordovaWorkSpace/HRNew/HRAttendance/platforms/ios/cordova/build-debug.xcconfig,-workspace,HRAttendance.xcworkspace,-scheme,HRAttendance,-configuration,Debug,-sdk,iphonesimulator,-destination,platform=iOS Simulator,name=iPhone X,build,CONFIGURATION_BUILD_DIR=/Users/aqibmapari/CordovaWorkSpace/HRNew/HRAttendance/platforms/ios/build/emulator,SHARED_PRECOMPS_DIR=/Users/aqibmapari/CordovaWorkSpace/HRNew/HRAttendance/platforms/ios/build/sharedpch

@macdonst

@balaji503
Copy link

balaji503 commented May 14, 2018

Hi, I have the same issue
with cordova 8.0, cordova-ios 4.5.4 and cocoapods 1.1.1

deleted and added ios platform, no success. Do i need to update xcode ? my xcode version is 8.3.3

Please help..

@lock
Copy link

lock bot commented Jun 13, 2018

This thread has been automatically locked.

@lock lock bot locked as resolved and limited conversation to collaborators Jun 13, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

5 participants