最新消息:20210917 已从crifan.com换到crifan.org

【已解决】Mac中adb安装apk报错:adb failed to instal INSTALL_FAILED_CONFLICTING_PROVIDER Package couldn’t be installed because provider name is already used

apk crifan 969浏览 0评论
折腾:
【未解决】Mac中用adb install安装安卓apk卡死
调用adb去安装apk,结果报错:
adb: failed to install /var/folders/gt/5868sbcd1jq4rxvryqhy2_1sz8n0s3/T/tmptcrjozvs/20201202_fengyun_0185BingFengTianXia_gameApp_Android_0.apk: Failure [INSTALL_FAILED_CONFLICTING_PROVIDER: Package couldn't be installed in /data/app/com.gmwl.bftx.vivo-tKzI8oBjXWOSuG3Hbm5M_A==: Can't install because provider name com.game.moshenzj2.fileprovider (in package com.gmwl.bftx.vivo) is already used by com.cxhy.smz.vivo]
不用临时目录了,换回之前的正常目录:
            logging.info("start to install app in {}".format(os.path.basename(self.arg_options.task)))
            apkFilePath = item[3]
            # os.system("adb -s {0} install {1}".format(self.device, apkFilePath))
            adbInstallCmd = "adb -s {0} install -r {1}".format(self.device, apkFilePath)
            # length=243 command:
            # adb -s hmucaei75ptk7szs install -r /Users/xxx/dev/xxx/crawler/appAutoCrawler/AppCrawler/task/20201202_fengyun_0192LeiMoChuanShuo/20201202_fengyun_0192LeiMoChuanShuo_gameApp_Android/20201202_fengyun_0192LeiMoChuanShuo_gameApp_Android_0.apk
。。。
            logging.info("Run length=%d, command: %s", len(adbInstallCmd), adbInstallCmd)
            # Run length=153, command: adb -s hmucaei75ptk7szs install -r /var/folders/gt/5868sbcd1jq4rxvryqhy2_1sz8n0s3/T/tmpq3ypjfgd/20201202_fengyun_0192LeiMoChuanShuo_gameApp_Android_0.apk
            os.system(adbInstallCmd)
结果:
[201202 14:38:49][AppCrawler.py 77 ] start to crawl app 0 bftx_冰封天下 com.gmwl.bftx.vivo, remain 1
[201202 14:38:49][DevicesMethods.py 4064] start to install app in 20201202_fengyun_0185BingFengTianXia_gameApp_Android.txt
[201202 14:38:49][DevicesMethods.py 4092] Run length=246, command: adb -s hmucaei75ptk7szs install -r /Users/xxx/dev/xxx/crawler/appAutoCrawler/AppCrawler/task/20201202_fengyun_0185BingFengTianXia/20201202_fengyun_0185BingFengTianXia_gameApp_Android/20201202_fengyun_0185BingFengTianXia_gameApp_Android_0.apk
Performing Streamed Install
真的会卡死??
换回短路径,结果:
的确可以继续安装,只不过安装会由于其他原因而报错而已
看起来像是:
此处的安卓app的包名冲突了?
之前的com.cxhy.smz.vivo好像是 神魔传
com.game.moshenzj2.fileprovider 
和现在的 
冰封天下 com.gmwl.bftx.vivo
冲突了?
->那可以去卸载之前的 神魔传
不过卸载之前,先去搜搜
adb install INSTALL_FAILED_CONFLICTING_PROVIDER Can’t install because provider name
android – Install shows error in console: INSTALL FAILED CONFLICTING PROVIDER – Stack Overflow
android:authorities必须唯一
此处看来是 一样 导致的?
估计是 同一家公司开发的 留了同一个值导致的
此处apk是别人的 我没发改
INSTALL_FAILED_CONFLICTING_PROVIDER Can’t install because provider name com.defold.adtest.firebaseinitprovider is already used · Issue #5 · Lerg/extension-admob
人家建议:
The hardcoded com.defold.adtest.firebaseinitprovider in admob/manifests/android/AndroidManifest.xml could perhaps use {{android.package}} instead?
解决安装 apk 时出现的 INSTALL_FAILED_CONFLICTING_PROVIDER 错误_willwaywang6-CSDN博客
该如何规避这个问题?
当命名 authorities 的时候,在前面加上自己的 applicationId,这是一种有效的方法,也是一种最佳实践。
我没源码,没法规避。
所以只能去:
删除之前的app
然后再去试试
此错误没了,但是试了2次都是报错:
Performing Streamed Install
adb: failed to install /var/folders/gt/5868sbcd1jq4rxvryqhy2_1sz8n0s3/T/tmpp2kz641b/20201202_fengyun_0185BingFengTianXia_gameApp_Android_0.apk: [I 201202 16:12:20 __init__:257] USB disconnected, fallback to WiFi, ATX_AGENT_URL=http://192.168.31.177:7912
Exception in thread watcher:
Traceback (most recent call last):
  File "/Users/xxx/dev/xxx/crawler/appAutoCrawler/AppCrawler/venv/lib/python3.8/site-packages/urllib3/connectionpool.py", line 665, in urlopen
    httplib_response = self._make_request(
  File "/Users/xxx/dev/xxx/crawler/appAutoCrawler/AppCrawler/venv/lib/python3.8/site-packages/urllib3/connectionpool.py", line 421, in _make_request
    six.raise_from(e, None)
  File "<string>", line 3, in raise_from
  File "/Users/xxx/dev/xxx/crawler/appAutoCrawler/AppCrawler/venv/lib/python3.8/site-packages/urllib3/connectionpool.py", line 416, in _make_request
    httplib_response = conn.getresponse()
  File "/Users/xxx/.pyenv/versions/3.8.0/Python.framework/Versions/3.8/lib/python3.8/http/client.py", line 1322, in getresponse
    response.begin()
  File "/Users/xxx/.pyenv/versions/3.8.0/Python.framework/Versions/3.8/lib/python3.8/http/client.py", line 303, in begin
    version, status, reason = self._read_status()
  File "/Users/xxx/.pyenv/versions/3.8.0/Python.framework/Versions/3.8/lib/python3.8/http/client.py", line 272, in _read_status
    raise RemoteDisconnected("Remote end closed connection without"
http.client.RemoteDisconnected: Remote end closed connection without response

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/xxx/dev/xxx/crawler/appAutoCrawler/AppCrawler/venv/lib/python3.8/site-packages/requests/adapters.py", line 439, in send
    resp = conn.urlopen(
  File "/Users/xxx/dev/xxx/crawler/appAutoCrawler/AppCrawler/venv/lib/python3.8/site-packages/urllib3/connectionpool.py", line 719, in urlopen
    retries = retries.increment(
  File "/Users/xxx/dev/xxx/crawler/appAutoCrawler/AppCrawler/venv/lib/python3.8/site-packages/urllib3/util/retry.py", line 400, in increment
    raise six.reraise(type(error), error, _stacktrace)
  File "/Users/xxx/dev/xxx/crawler/appAutoCrawler/AppCrawler/venv/lib/python3.8/site-packages/urllib3/packages/six.py", line 734, in reraise
    raise value.with_traceback(tb)
  File "/Users/xxx/dev/xxx/crawler/appAutoCrawler/AppCrawler/venv/lib/python3.8/site-packages/urllib3/connectionpool.py", line 665, in urlopen
    httplib_response = self._make_request(
  File "/Users/xxx/dev/xxx/crawler/appAutoCrawler/AppCrawler/venv/lib/python3.8/site-packages/urllib3/connectionpool.py", line 421, in _make_request
    six.raise_from(e, None)
  File "<string>", line 3, in raise_from
  File "/Users/xxx/dev/xxx/crawler/appAutoCrawler/AppCrawler/venv/lib/python3.8/site-packages/urllib3/connectionpool.py", line 416, in _make_request
    httplib_response = conn.getresponse()
  File "/Users/xxx/.pyenv/versions/3.8.0/Python.framework/Versions/3.8/lib/python3.8/http/client.py", line 1322, in getresponse
    response.begin()
  File "/Users/xxx/.pyenv/versions/3.8.0/Python.framework/Versions/3.8/lib/python3.8/http/client.py", line 303, in begin
    version, status, reason = self._read_status()
  File "/Users/xxx/.pyenv/versions/3.8.0/Python.framework/Versions/3.8/lib/python3.8/http/client.py", line 272, in _read_status
    raise RemoteDisconnected("Remote end closed connection without"
urllib3.exceptions.ProtocolError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/xxx/.pyenv/versions/3.8.0/Python.framework/Versions/3.8/lib/python3.8/threading.py", line 932, in _bootstrap_inner
    self.run()
  File "/Users/xxx/.pyenv/versions/3.8.0/Python.framework/Versions/3.8/lib/python3.8/threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "/Users/xxx/dev/xxx/crawler/appAutoCrawler/AppCrawler/venv/lib/python3.8/site-packages/uiautomator2/watcher.py", line 225, in _watch_forever
    triggered = self.run()
  File "/Users/xxx/dev/xxx/crawler/appAutoCrawler/AppCrawler/venv/lib/python3.8/site-packages/uiautomator2/watcher.py", line 237, in run
    return self._run_watchers(source=source)
  File "/Users/xxx/dev/xxx/crawler/appAutoCrawler/AppCrawler/venv/lib/python3.8/site-packages/uiautomator2/watcher.py", line 244, in _run_watchers
    source = source or self._dump_hierarchy()
  File "/Users/xxx/dev/xxx/crawler/appAutoCrawler/AppCrawler/venv/lib/python3.8/site-packages/uiautomator2/watcher.py", line 173, in _dump_hierarchy
    return self._d.dump_hierarchy()
  File "</Users/xxx/dev/xxx/crawler/appAutoCrawler/AppCrawler/venv/lib/python3.8/site-packages/decorator.py:decorator-gen-12>", line 2, in dump_hierarchy
  File "/Users/xxx/dev/xxx/crawler/appAutoCrawler/AppCrawler/venv/lib/python3.8/site-packages/retry/api.py", line 73, in retry_decorator
    return __retry_internal(partial(f, *args, **kwargs), exceptions, tries, delay, max_delay, backoff, jitter,
  File "/Users/xxx/dev/xxx/crawler/appAutoCrawler/AppCrawler/venv/lib/python3.8/site-packages/retry/api.py", line 33, in __retry_internal
    return f()
  File "/Users/xxx/dev/xxx/crawler/appAutoCrawler/AppCrawler/venv/lib/python3.8/site-packages/uiautomator2/__init__.py", line 891, in dump_hierarchy
    content = self.jsonrpc.dumpWindowHierarchy(compressed, None)
  File "/Users/xxx/dev/xxx/crawler/appAutoCrawler/AppCrawler/venv/lib/python3.8/site-packages/uiautomator2/__init__.py", line 434, in __call__
    return self.server._jsonrpc_retry_call(self.method, params,
  File "/Users/xxx/dev/xxx/crawler/appAutoCrawler/AppCrawler/venv/lib/python3.8/site-packages/uiautomator2/__init__.py", line 441, in _jsonrpc_retry_call
    return self._jsonrpc_call(*args, **kwargs)
  File "/Users/xxx/dev/xxx/crawler/appAutoCrawler/AppCrawler/venv/lib/python3.8/site-packages/uiautomator2/__init__.py", line 470, in _jsonrpc_call
    res = self.http.post("/jsonrpc/0",
  File "/Users/xxx/dev/xxx/crawler/appAutoCrawler/AppCrawler/venv/lib/python3.8/site-packages/requests/sessions.py", line 581, in post
    return self.request('POST', url, data=data, json=json, **kwargs)
  File "/Users/xxx/dev/xxx/crawler/appAutoCrawler/AppCrawler/venv/lib/python3.8/site-packages/uiautomator2/__init__.py", line 188, in request
    return super().request(method, url, **kwargs)
  File "/Users/xxx/dev/xxx/crawler/appAutoCrawler/AppCrawler/venv/lib/python3.8/site-packages/uiautomator2/__init__.py", line 108, in request
    resp = super(TimeoutRequestsSession,
  File "/Users/xxx/dev/xxx/crawler/appAutoCrawler/AppCrawler/venv/lib/python3.8/site-packages/requests/sessions.py", line 533, in request
    resp = self.send(prep, **send_kwargs)
  File "/Users/xxx/dev/xxx/crawler/appAutoCrawler/AppCrawler/venv/lib/python3.8/site-packages/requests/sessions.py", line 646, in send
    r = adapter.send(request, **kwargs)
  File "/Users/xxx/dev/xxx/crawler/appAutoCrawler/AppCrawler/venv/lib/python3.8/site-packages/requests/adapters.py", line 498, in send
    raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))
[201202 16:12:21][AppCrawler.py 109] crawl bftx/冰封天下 start
[W 201202 16:12:21 watcher:181] already started
[201202 16:12:21][DevicesMethods.py 151] start com.gmwl.bftx.vivo
[I 201202 16:12:21 __init__:257] USB disconnected, fallback to WiFi, ATX_AGENT_URL=http://192.168.31.177:7912
很是奇怪。
此处USB连接没问题啊
重启安卓手机,且去看看,如果已安装 冰封天下 则删除掉
没有安装啊
再试试,即可
201202 16:16:32][DevicesMethods.py 4092] Run length=154, command: adb -s hmucaei75ptk7szs install -r /var/folders/gt/5868sbcd1jq4rxvryqhy2_1sz8n0s3/T/tmp0gh0og8s/20201202_fengyun_0185BingFengTianXia_gameApp_Android_0.apk
Performing Streamed Install
[D 201202 16:16:34 __init__:598] kill process(ps): uiautomator
[D 201202 16:16:35 __init__:616] uiautomator-v2 is starting ... left: 40.0s
[D 201202 16:16:36 __init__:616] uiautomator-v2 is starting ... left: 38.9s
[I 201202 16:16:36 __init__:581] uiautomator back to normal
[I 201202 16:16:38 watcher:255] XPath(hook:继续安装): ['继续安装']
Success
[201202 16:16:41][AppCrawler.py 109] crawl bftx/冰封天下 start
[W 201202 16:16:41 watcher:181] already started
[201202 16:16:41][DevicesMethods.py 151] start com.gmwl.bftx.vivo
即可。
【后记20201203】
折腾:
【未解决】批量测试安卓游戏:ViVo的Game的搜魔幻且是即时战斗类的游戏20201203
期间,之前,昨天,故意,下载过:海之梦Online
去安装,结果报错:
其中的:
失败原因:与已安装应用内容提供者冲突
处理意见:写在当前已安装版本,再重新安装
估计是和之前的:INSTALL_FAILED_CONFLICTING_PROVIDER,是一个意思。
但是此处尴尬的是:看不到和哪个已有app冲突,所以无法确定卸载哪个。
那就都卸载吧。
继续调试,即可
启动游戏,发现和之前:
  • 天魔录
  • 神魔传
  • 奇迹之剑
  • 魔神战纪2
  • 冰封天下
  • 泰坦之王
是同一个游戏。
难怪前面会报错,无法安装,安装报错冲突呢。

转载请注明:在路上 » 【已解决】Mac中adb安装apk报错:adb failed to instal INSTALL_FAILED_CONFLICTING_PROVIDER Package couldn’t be installed because provider name is already used

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
90 queries in 0.196 seconds, using 23.39MB memory