我想使用Proguard主要是出于混淆的原因.
我的问题是我有三个库,Twitter4J和两个路标库.当我尝试创建签名的APK时,这些库会导致错误.为了克服这个问题,我在proguard.config文件中添加了以下内容......
-dontwarn org.apache.commons.codec.binary.**
-dontwarn org.slf4j.**
-dontwarn com.sun.syndication.io.**
-dontwarn com.sun.syndication.feed.synd.*
Run Code Online (Sandbox Code Playgroud)
虽然这摆脱了控制台中的错误,当我将签名的APK加载到我的手机上时,它立即崩溃了.DDMS说这是由于Twitter4J中没有找到的课程.
摆脱"dontwarns"上述情况并没有帮助.也没有添加dontshrink dontoptimise.
我希望Proguard完全忽略这些库(因为它们无论如何都是开源的).这可能吗?
我正在尝试编写一个应用程序,需要知道何时没有可用的IP网络连接.我正在使用android.net.conn.CONNECTIVITY_CHANGE广播事件和ConnectivityManager来响应状态的变化来实现这一点,但是我在模拟器中测试我的设置时遇到了问题.
我已经尝试了两种飞行模式并按下F8以禁用"蜂窝网络",但即使这两种情况都参与其中,应用程序仍"看到"底层网络.
有没有人设法找到模拟完全缺乏网络访问的方法?
我正在开发一个MQTT处理程序,我想为每个有一个事件监听器的父目录发出一个事件.例如:
如果有以下MQTT路径可用,那么有下标 - 这些路径的事件侦听器 -
testreplyer/requesttest/replyer/request有人发表主题test/replyer/request/@issuer,应该有2个事件被发现:test,test/replyer/request.
鉴于任何路径都是可能的并且没有可用的有效事件列表,我们必须仅检查路径是否是另一个路径的父路径.我们可以用正则表达式做到这一点吗?如果是这样,它会是什么样子?有更简单/更有效的解决方案吗?
我为多个 URL 创建了一个代理通行证。
listen 80;
listen [::]:80;
server_name ~^(.*)redzilla\.11\.75\.65\.21\.xip\.io$;
location / {
set $instname $1;
proxy_pass http://${instname}redzilla.localhost:3000;
}
Run Code Online (Sandbox Code Playgroud)
当我使用 chrome 调用此服务时,触发了 502 错误。
http://test.redzilla.11.75.65.21.xip.io/
我通过硬编码 URL 将位置标记放在下面。
location /redzilla {
proxy_pass http://test.redzilla.localhost:3000;
}
Run Code Online (Sandbox Code Playgroud)
然后它仅适用于上述 URL。我想知道如何在单个位置标签中为多个 URL 创建代理传递。(请注意:URL 模式为 *.redzilla.localhost:3000 ,*(星号)代表任何单词)
我通过运行 npx create-react-app my-app 创建了一个 React 项目
我安装了 mqtt-react-hooks
import { Connector } from 'mqtt-react-hooks';
import Status from './Status';
function App() {
return (
<Connector
brokerUrl="mqtt://127.0.0.1:80/"
parserMethod={(msg) => msg} // msg is Buffer
>
<Status />
</Connector>
);
}
export default App;
Run Code Online (Sandbox Code Playgroud)
我在控制台中收到此错误

我正在做一个基于物联网的项目.所以我需要连接cloudmqtt和nodejs服务器.
app.js
// Create a MQTT Client
var mqtt = require('mqtt');
// Create a client connection to CloudMQTT for live data
var client = mqtt.connect('xxxxxxxxxxx', {
username: 'xxxxx',
password: 'xxxxxxx'
});
client.on('connect', function() { // When connected
console.log("Connected to CloudMQTT");
// Subscribe to the temperature
client.subscribe('Motion', function() {
// When a message arrives, do something with it
client.on('message', function(topic, message, packet) {
// ** Need to pass message out **
});
});
});
Run Code Online (Sandbox Code Playgroud)
然后开始我的服务器.但没有任何事情发生(没有错误信息,没有警告).请帮我这个?
我正在使用 'org.eclipse.paho:org.eclipse.paho.client.mqttv3:1.2.5' 作为 mqtt 服务,并且该应用程序在 Android 12 设备上不断崩溃,并显示以下崩溃日志
java.lang.IllegalArgumentException: app id: Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent.
Strongly consider using FLAG_IMMUTABLE, only use FLAG_MUTABLE if some functionality depends on the PendingIntent being mutable, e.g. if it needs to be used with inline replies or bubbles.
at android.app.PendingIntent.checkFlags(PendingIntent.java:382)
at android.app.PendingIntent.getBroadcastAsUser(PendingIntent.java:673)
at android.app.PendingIntent.getBroadcast(PendingIntent.java:660)
at org.eclipse.paho.android.service.AlarmPingSender.start(AlarmPingSender.java:76)
at org.eclipse.paho.client.mqttv3.internal.ClientState.connected(ClientState.java:1214)
at org.eclipse.paho.client.mqttv3.internal.ClientState.notifyReceivedAck(ClientState.java:1050)
at org.eclipse.paho.client.mqttv3.internal.CommsReceiver.run(CommsReceiver.java:151)
Run Code Online (Sandbox Code Playgroud)
这是我正在使用的库:
implementation 'org.eclipse.paho:org.eclipse.paho.client.mqttv3:1.2.5'
implementation 'org.eclipse.paho:org.eclipse.paho.android.service:1.1.1'
Run Code Online (Sandbox Code Playgroud) 我收到以下错误,这似乎来自底层的事情与"_main".
Ld /Users/jianglin/Library/Developer/Xcode/DerivedData/TownHall_iPhone-bdlgipvgaapgjhglhromfvcubbxz/Build/Products/Debug-iphonesimulator/TownHall\ iPhone.app/TownHall\ iPhone normal i386
cd "/Users/jianglin/Desktop/TownHall iPhone"
export IPHONEOS_DEPLOYMENT_TARGET=8.1
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.1.sdk -L/Users/jianglin/Library/Developer/Xcode/DerivedData/TownHall_iPhone-bdlgipvgaapgjhglhromfvcubbxz/Build/Products/Debug-iphonesimulator -F/Users/jianglin/Library/Developer/Xcode/DerivedData/TownHall_iPhone-bdlgipvgaapgjhglhromfvcubbxz/Build/Products/Debug-iphonesimulator -filelist /Users/jianglin/Library/Developer/Xcode/DerivedData/TownHall_iPhone-bdlgipvgaapgjhglhromfvcubbxz/Build/Intermediates/TownHall\ iPhone.build/Debug-iphonesimulator/TownHall\ iPhone.build/Objects-normal/i386/TownHall\ iPhone.LinkFileList -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -objc_abi_version -Xlinker 2 -ObjC -lPods-AFNetworking -lPods-Masonry -lPods-SDWebImage -framework CoreGraphics -framework Foundation -framework ImageIO -framework MobileCoreServices -framework Security -framework SystemConfiguration -framework UIKit -fobjc-arc -fobjc-link-runtime -Xlinker -no_implicit_dylibs -mios-simulator-version-min=8.1 -lPods -Xlinker -dependency_info -Xlinker /Users/jianglin/Library/Developer/Xcode/DerivedData/TownHall_iPhone-bdlgipvgaapgjhglhromfvcubbxz/Build/Intermediates/TownHall\ iPhone.build/Debug-iphonesimulator/TownHall\ iPhone.build/Objects-normal/i386/TownHall\ iPhone_dependency_info.dat -o /Users/jianglin/Library/Developer/Xcode/DerivedData/TownHall_iPhone-bdlgipvgaapgjhglhromfvcubbxz/Build/Products/Debug-iphonesimulator/TownHall\ iPhone.app/TownHall\ iPhone
Undefined symbols for architecture i386:
"_main", referenced from:
implicit entry/start for …Run Code Online (Sandbox Code Playgroud) 我有一个应该是主机的虚拟机,它可以接收和发送数据。第一张图片是我在我的主机上遇到的错误(我试图从中发送数据)。第二张图是我虚拟机上的mosquitto登录。此外,我正在使用默认配置,据我所知,这不会导致这些问题,至少从我从其他示例中看到的情况来看。我对所有这些工作原理知之甚少,因此感谢您的帮助。
我在主机上尝试过的:



我正在使用本机反应.我正在使用错误INVALID_STATE_ERR来解决崩溃问题.我正在使用FireBase Crashlytics.我也使用MQTT客户端进行Web套接字连接.
我无法找出崩溃应用程序的原因.是由于MQTT WebSockets还是由于javascript线程上发生的错误?我也没有从堆栈跟踪中获得任何相关消息.我正在粘贴下面的Stack Trace.
Fatal Exception: com.facebook.react.common.JavascriptException: INVALID_STATE_ERR, stack:
value@79:1340
_socket_send@557:21101
_on_socket_open@557:16408
<unknown>@557:628
value@63:1501
<unknown>@79:4566
value@32:1363
value@18:3559
<unknown>@18:1044
value@18:2986
value@18:1016
at com.facebook.react.modules.core.ExceptionsManagerModule.showOrThrowError(ExceptionsManagerModule.java:54)
at com.facebook.react.modules.core.ExceptionsManagerModule.reportFatalException(ExceptionsManagerModule.java:38)
at java.lang.reflect.Method.invoke(Method.java)
at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:372)
at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:160)
at com.facebook.react.bridge.queue.NativeRunnable.run(NativeRunnable.java)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:29)
at android.os.Looper.loop(Looper.java:148)
at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:192)
at java.lang.Thread.run(Thread.java:818)
Run Code Online (Sandbox Code Playgroud)
我可以获得更多洞察力来解决这个问题吗?