2

早上好,

我正在 android studio 中开发一个聊天机器人,并将一个 python 脚本集成到我的机器人中。使用 chaquopy 工作正常,但是在我更改应用程序名称后,整个项目停止工作,它给了我这个错误:

Build failed (with 1 error)

:clean (ok)

:app:clean (ok)

:app:preBuild (ok)

:app:preDebugBuild (ok)

:app:compileDebugAidl (ok)

:app:compileDebugRenderscript (ok)

:app:generateDebugBuildConfig (ok)

:app:extractPythonBuildPackages (ok)

:app:generateDebugPythonRequirements
Process 'command 'C:/Users/ashlibek/AppData/Local/Programs/Python/Python38/python.exe'' 
finished with non-zero exit value 1

Logcat 真的很长,我无法弄清楚有什么问题:

2021-03-20 09:02:44.558 7052-32520/? E/memtrack: Couldn't load memtrack module
2021-03-20 09:02:51.529 14219-15679/? E/msgr.msys: E[N rtchannel]_rt_mqtt_publish_callback(356)=>Failed to publish the request over MQTT. token:624691b3-7763-4912-ac36-fcda5324bd31, category:mcd-sync-data-task-category, requestId:11634, error:Error Domain=mqtt Code=3008
2021-03-20 09:02:51.538 14219-15679/? E/msgr.msys: E[N rtchannel]_rt_mqtt_publish_callback(356)=>Failed to publish the request over MQTT. token:d99da418-336b-452c-a712-6767184383f1, category:mcd-sync-data-task-category, requestId:14139, error:Error Domain=mqtt Code=3008
2021-03-20 09:02:51.539 14219-15669/? E/msgr.msys: E[S sync]_createResponseError(166)=>Network Response 624691b3-7763-4912-ac36-fcda5324bd31 contains sync error Error Domain=mqtt Code=3008 - Underlying error (null): Error Domain=mqtt Code=3008
2021-03-20 09:02:51.546 14219-15669/? E/msgr.msys: E[S sync]_createResponseError(166)=>Network Response d99da418-336b-452c-a712-6767184383f1 contains sync error Error Domain=mqtt Code=3008 - Underlying error (null): Error Domain=mqtt Code=3008
2021-03-20 09:02:54.296 4289-4348/? E/Watchdog: !@Sync 5646 [2021-03-20 09:02:54.295] FD count : 586
2021-03-20 09:03:00.005 5119-5119/? E/libprocessgroup: set_timerslack_ns write failed: Operation not permitted
2021-03-20 09:03:00.040 5119-5119/? E/libprocessgroup: set_timerslack_ns write failed: Operation not permitted
2021-03-20 09:03:19.903 4289-7545/? E/WifiService: 10190 has no permission about LOCAL_MAC_ADDRESS
2021-03-20 09:03:19.905 4289-7545/? E/WifiService: Permission violation - getConfiguredNetworks not allowed for uid=10190, packageName=com.tencent.mm, reason=java.lang.SecurityException: Location mode is disabled for the device
2021-03-20 09:03:19.927 4289-7545/? E/WifiService: Permission violation - getConfiguredNetworks not allowed for uid=10190, packageName=com.tencent.mm, reason=java.lang.SecurityException: Location mode is disabled for the device
2021-03-20 09:03:19.930 4289-7545/? E/WifiService: 10190 has no permission about LOCAL_MAC_ADDRESS
2021-03-20 09:03:19.943 4289-4504/? E/WifiService: 10190 has no permission about LOCAL_MAC_ADDRESS
2021-03-20 09:03:19.946 4289-4504/? E/WifiService: Permission violation - getConfiguredNetworks not allowed for uid=10190, packageName=com.tencent.mm, reason=java.lang.SecurityException: Location mode is disabled for the device
2021-03-20 09:03:19.949 4289-4504/? E/WifiService: 10190 has no permission about LOCAL_MAC_ADDRESS
2021-03-20 09:03:19.955 4289-7545/? E/WifiService: 10190 has no permission about LOCAL_MAC_ADDRESS
2021-03-20 09:03:19.958 4289-7545/? E/WifiService: Permission violation - getConfiguredNetworks not allowed for uid=10190, packageName=com.tencent.mm, reason=java.lang.SecurityException: Location mode is disabled for the device
2021-03-20 09:03:19.972 4289-7545/? E/WifiService: Permission violation - getConfiguredNetworks not allowed for uid=10190, packageName=com.tencent.mm, reason=java.lang.SecurityException: Location mode is disabled for the device
2021-03-20 09:03:19.969 4289-7545/? E/WifiService: 10190 has no permission about LOCAL_MAC_ADDRESS
2021-03-20 09:03:19.974 19644-32531/? E/libc: Access denied finding property "net.dns1"
2021-03-20 09:03:19.974 19644-32531/? E/libc: Access denied finding property "net.dns2"
2021-03-20 09:03:19.975 4289-7545/? E/WifiService: 10190 has no permission about LOCAL_MAC_ADDRESS
2021-03-20 09:03:19.979 3802-4025/? E/Netd: getNetworkForDns: getNetId from enterpriseCtrl is netid 0
2021-03-20 09:03:19.988 4289-7545/? E/WifiService: 10190 has no permission about LOCAL_MAC_ADDRESS
2021-03-20 09:03:19.990 4289-7545/? E/WifiService: Permission violation - getConfiguredNetworks not allowed for uid=10190, packageName=com.tencent.mm, reason=java.lang.SecurityException: Location mode is disabled for the device
2021-03-20 09:03:20.004 4289-7545/? E/WifiService: Permission violation - getConfiguredNetworks not allowed for uid=10190, packageName=com.tencent.mm, reason=java.lang.SecurityException: Location mode is disabled for the device
2021-03-20 09:03:20.022 4289-7545/? E/WifiService: Permission violation - getConfiguredNetworks not allowed for uid=10190, packageName=com.tencent.mm, reason=java.lang.SecurityException: Location mode is disabled for the device
2021-03-20 09:03:20.026 4289-7545/? E/WifiService: 10190 has no permission about LOCAL_MAC_ADDRESS
2021-03-20 09:03:20.036 4289-4560/? E/NetdEventListenerService: handleMessage: { when=-1ms what=10001 obj=com.android.server.connectivity.NetdEventListenerService$DnsResultParams@968a043 target=com.android.server.connectivity.NetdEventListenerService$DnsEventHandler }
2021-03-20 09:03:20.048 4289-7545/? E/WifiService: 10190 has no permission about LOCAL_MAC_ADDRESS
2021-03-20 09:03:20.050 4289-7545/? E/WifiService: Permission violation - getConfiguredNetworks not allowed for uid=10190, packageName=com.tencent.mm, reason=java.lang.SecurityException: Location mode is disabled for the device
2021-03-20 09:03:20.066 4289-7545/? E/WifiService: Permission violation - getConfiguredNetworks not allowed for uid=10190, packageName=com.tencent.mm, reason=java.lang.SecurityException: Location mode is disabled for the device
2021-03-20 09:03:20.069 4289-7545/? E/WifiService: 10190 has no permission about LOCAL_MAC_ADDRESS
2021-03-20 09:03:20.590 4289-7545/? E/WifiService: 10190 has no permission about LOCAL_MAC_ADDRESS
2021-03-20 09:03:20.605 4289-4504/? E/WifiService: 10190 has no permission about LOCAL_MAC_ADDRESS
2021-03-20 09:03:20.608 4289-4504/? E/WifiService: Permission violation - getConfiguredNetworks not allowed for uid=10190, packageName=com.tencent.mm, reason=java.lang.SecurityException: Location mode is disabled for the device
2021-03-20 09:03:20.623 4289-4504/? E/WifiService: Permission violation - getConfiguredNetworks not allowed for uid=10190, packageName=com.tencent.mm, reason=java.lang.SecurityException: Location mode is disabled for the device
2021-03-20 09:03:20.680 4289-4504/? E/WifiService: Permission violation - getConfiguredNetworks not allowed for uid=10190, packageName=com.tencent.mm, reason=java.lang.SecurityException: Location mode is disabled for the device
2021-03-20 09:03:20.683 4289-4504/? E/WifiService: 10190 has no permission about LOCAL_MAC_ADDRESS
2021-03-20 09:03:20.691 4289-7545/? E/WifiService: 10190 has no permission about LOCAL_MAC_ADDRESS
2021-03-20 09:03:20.704 4289-7545/? E/WifiService: Permission violation - getConfiguredNetworks not allowed for uid=10190, packageName=com.tencent.mm, reason=java.lang.SecurityException: Location mode is disabled for the device
2021-03-20 09:03:20.720 4289-7545/? E/WifiService: 10190 has no permission about LOCAL_MAC_ADDRESS
2021-03-20 09:03:20.722 4289-4504/? E/WifiService: 10190 has no permission about LOCAL_MAC_ADDRESS
2021-03-20 09:03:20.722 4289-7545/? E/WifiService: Permission violation - getConfiguredNetworks not allowed for uid=10190, packageName=com.tencent.mm, reason=java.lang.SecurityException: Location mode is disabled for the device
2021-03-20 09:03:20.736 4289-4504/? E/WifiService: 10190 has no permission about LOCAL_MAC_ADDRESS
2021-03-20 09:03:21.563 14219-15679/? E/msgr.msys: E[N rtchannel]_rt_mqtt_publish_callback(356)=>Failed to publish the request over MQTT. token:fcc5503f-754c-4804-b5bc-1c002add4e7a, category:mcd-sync-data-task-category, requestId:21044, error:Error Domain=mqtt Code=3008
2021-03-20 09:03:21.570 14219-15669/? E/msgr.msys: E[S sync]_createResponseError(166)=>Network Response fcc5503f-754c-4804-b5bc-1c002add4e7a contains sync error Error Domain=mqtt Code=3008 - Underlying error (null): Error Domain=mqtt Code=3008
2021-03-20 09:03:21.570 14219-15679/? E/msgr.msys: E[N rtchannel]_rt_mqtt_publish_callback(356)=>Failed to publish the request over MQTT. token:58cbb60d-c846-4c76-a6e0-9b9c6c1c0a93, category:mcd-sync-data-task-category, requestId:8130, error:Error Domain=mqtt Code=3008
2021-03-20 09:03:21.578 14219-15669/? E/msgr.msys: E[S sync]_createResponseError(166)=>Network Response 58cbb60d-c846-4c76-a6e0-9b9c6c1c0a93 contains sync error Error Domain=mqtt Code=3008 - Underlying error (null): Error Domain=mqtt Code=3008
2021-03-20 09:03:24.309 4289-4348/? E/Watchdog: !@Sync 5647 [2021-03-20 09:03:24.309] FD count : 586 

任何帮助或建议都非常感谢..提前谢谢大家!

错误截图

4

1 回答 1

2

我解决了,这就是我所做的:

在 build.gradle(Module) 中,我有这个:

python { 
        buildPython "C:/Users/xxx/Python38/python.exe"
        
        pip {
            install "chatterbot==1.0.4"
            install "PyYAML==3.13"
            install "chatterbot_corpus==1.2.0"
            install "click-7.1.2"
            install "joblib-1.0.1"
            install "mathparse-0.1.2"
            install "nltk-3.5"
            install "packaging-20.9"
            install "pint-0.16.1"
            install "pymongo-3.11.3"
            install "pyparsing-2.4.7"
            install "python-dateutil-2.7.5"
            install "regex-2020.11.13"
            install "six-1.15.0"
            install "sqlalchemy-1.2.19"
            install "tqdm-4.59.0"
        }
    }

不知何故,在我将 python 从 3.7.8 更新到 3.8.6 之后,画中画块停止运行 smoothley,现在我取消了除 Chatterbot 之外的所有这些包的注释,我的应用程序再次正常工作(我还没有完成它的所有功能,但是至少现在它的建设很好)。

我不知道为什么会发生这种情况,我将对其进行更多调查以了解它,但我希望我的解决方案能够节省另一个人的时间。

谢谢。

于 2021-03-20T15:11:19.270 回答