2017-08-28 120 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的自动代码签名中添加应用程序标识有权每一个应用程序。该字符串形成团队标识符和包标识符。

设备在不指定权利的情况下构建工作,因为它们总是被签名并赋予上述权利。未签名的模拟器构建需要明确给定此权利。

相关问题