2017-08-28 51 views
0

在真實設備上運行用NativeScrip編寫的iOS應用程序是不可能的。我嘗試了一切。應用程序適用於iOS Symulator和Android模擬器,但是當我連接iOS設備和運行ins run ios一個得到一個錯誤NativeScript - 不能在帶有Firebase插件的iOS設備上運行

**匯出成功**

項目成功建立。

安裝...

無法在設備上應用更改:XXXXX。錯誤是:無法安裝

在標識符爲XXXXX的設備上 錯誤是:無法安裝應用程序。

我去platforms/ios和運行產生的Xcode項目。然後我建立它並嘗試運行。錯誤出現了:

在應用程序的代碼簽名 應享權利文件中指定的授權是無效的,不允許的,或者不符合你的供應配置文件中指定的 。 (0xE8008016)。

我已經設置適當的TeamProvision Profile

我不知道如何解決這個問題。我只有一個想法。我已經安裝了需要keychain_sharing的firebase插件,或許這是Entitlements的問題。

package.json

{ 
    "description": "NativeScript Application", 
    "license": "SEE LICENSE IN <your-license-filename>", 
    "readme": "NativeScript Application", 
    "repository": "<fill-your-repository-here>", 
    "nativescript": { 
    "id": "org.nativescrip.awsomename", 
    "tns-android": { 
     "version": "3.1.1" 
    }, 
    "tns-ios": { 
     "version": "3.2.0-2017-8-25-1" 
    } 
    }, 
    "dependencies": { 
    "@angular/animations": "~4.2.0", 
    "@angular/common": "~4.2.0", 
    "@angular/compiler": "~4.2.0", 
    "@angular/core": "~4.2.0", 
    "@angular/forms": "~4.2.0", 
    "@angular/http": "~4.2.0", 
    "@angular/platform-browser": "~4.2.0", 
    "@angular/router": "~4.2.0", 
    "nativescript-angular": "~4.2.0", 
    "nativescript-plugin-firebase": "^4.0.6", 
    "nativescript-theme-core": "~1.0.2", 
    "reflect-metadata": "~0.1.8", 
    "rxjs": "~5.4.2", 
    "tns-core-modules": "~3.1.0", 
    "zone.js": "~0.8.2" 
    }, 
    "devDependencies": { 
    "babel-traverse": "6.26.0", 
    "babel-types": "6.26.0", 
    "babylon": "6.18.0", 
    "lazy": "1.0.11", 
    "nativescript-dev-typescript": "~0.5.0", 
    "typescript": "~2.4.2" 
    } 
} 

build.cconfigAppResorces/iOS

// You can add custom settings here 
// for example you can uncomment the following line to force distribution code signing 
// CODE_SIGN_IDENTITY = iPhone Distribution 
// To build for device with Xcode 8 you need to specify your development team. More info: https://developer.apple.com/library/prerelease/content/releasenotes/DeveloperTools/RN-Xcode/Introduction.html 
// DEVELOPMENT_TEAM = YOUR_TEAM_ID; 
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 

DEVELOPMENT_TEAM = [HERE I HAVE SET MY DEV TEAM ID]; 
CODE_SIGN_ENTITLEMENTS = swapmobile/swapmobile.entitlements 

我使用Xcode應用程序開始工作8.3.2

編輯

tns plugin remove nativescript-plugin-firebase。問題在於Firebase插件。

回答

0

我發現自述文件see issue #420中給出的權利文件適用於模擬器,但除非這些權利被移除,否則設備構建會導致授權錯誤。下面* .entitlements文件同時適用於設備和模擬器建立:

<?xml version="1.0" encoding="UTF-8"?> 
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> 
<plist version="1.0"> 
<dict> 
    <key>keychain-access-groups</key> 
    <array> 
    <string>$(AppIdentifierPrefix)com.Company.Product</string> 
    </array> 
</dict> 
</plist> 

注 - 與你的包標識符替換「com.Company.Product」。

這是Xcode在啓用項目功能中的「鑰匙串共享」時放入的權利條目。其他細節可以在蘋果文檔Keychain Services Programming Guide - Access Groups其聲明中找到:

Xcode的自動代碼簽名中添加應用程序標識有權每一個應用程序。該字符串形成團隊標識符和包標識符。

設備在不指定權利的情況下構建工作,因爲它們總是被簽名並賦予上述權利。未簽名的模擬器構建需要明確給定此權利。

相關問題