【发布时间】:2016-05-16 18:27:38
【问题描述】:
NativeScript 2.0.0,Windows 10
当尝试在同一台安卓设备上运行多个 NativeScript 应用程序时,tns run android 命令会停止并显示以下消息:
Successfully deployed on device with identifier '192.168.99.100:5555'.
应用程序未安装。
经过一番调查,我尝试直接使用 adb 在 android 设备上安装应用程序:
adb "-s" "192.168.99.100:5555" "install" "-r" "<path to apk>.apk"
命令响应如下:
961 KB/s (15394490 bytes in 15.642s)
WARNING: linker: /system/lib/libhoudini.so has text relocations. This is wasting memory and prevents security hardening. Please fix.
pkg: /data/local/tmp/<app name>-debug.apk
Failure [INSTALL_FAILED_CONFLICTING_PROVIDER]
经过对INSTALL_FAILED_CONFLICTING_PROVIDER的一番调查,发现如下链接:
- https://issues.apache.org/jira/browse/CB-10014
- https://code.google.com/p/analytics-issues/issues/detail?id=784
- Install shows error in console: INSTALL FAILED CONFLICTING PROVIDER
我可以说这是一个丑陋的问题。
研究了一下,在NativeScript项目中,目录\platforms\android\build\intermediates\exploded-aar\com.google.android.gms\play-services-measurement\8.4.0目录下有一个manifest模板包含:
<provider
android:authorities="${applicationId}.google_measurement_service"
android:name="com.google.android.gms.measurement.AppMeasurementContentProvider"
android:exported="false"/>
但 applicationId 从未定义,因此当添加了多个具有此提供程序的应用时,第二个将无法安装。
【问题讨论】:
-
这是股票模拟器、精灵还是真机?哪个设备/版本?
标签: android nativescript