Comments (7)
上图是Facebook
登录成功后的回调到MethodCallHandlerImpl
中的断点调试。由于代码中使用了Objects.requireNonNull
方法,所以这里必然会出现空指针异常。建议改动如下(二选一)
- 仅处理自己请求码的回调
public boolean onActivityResult(int requestCode, int resultCode, Intent data) {
// add code here
if (requestCode != REQUEST_CREATE_PURCHASE_INTENT && requestCode != REQUEST_IS_ENVIRONMENT_READY) {
return false;
}
final Result result = Objects.requireNonNull(mResultsForRequests.get(requestCode)).first;
...
- 非空处理(推荐)
public boolean onActivityResult(int requestCode, int resultCode, Intent data) {
// use following code instead
Pair<Result, Integer> pair = mResultsForRequests.get(requestCode);
if (pair == null) {
return false;
}
final Result result = pair.first;
final int requestType = pair.second;
...
from hms-flutter-plugin.
你好 @nullptrx , 哪个工具包 ?
from hms-flutter-plugin.
你好,日志中有包名。com.huawei.hms.flutter.iap.MethodCallHandlerImpl.onActivityResult
flutter-hms-iap: ^5.0.0+300
from hms-flutter-plugin.
因为Flutter应用基本都是共用一个Activity,所有实现了onActivityResult
回调的插件都会走一遍。
from hms-flutter-plugin.
@nullptrx 你有什么建议 ? 你能给我们更多关于这个的信息吗 ?
from hms-flutter-plugin.
综上,即是处理不了的数据不能抛异常出去,return false
就好。
from hms-flutter-plugin.
谢谢@nullptrx,我们将在 10 月底的下一个版本中解决此问题, 多谢 👍
from hms-flutter-plugin.
Related Issues (20)
- [Location] Package named 6.11.0+301 but use sdk 6.4.0.300 HOT 1
- Error 11203(3002): Service Unavailable when Starting Speech Recognition
- [huawei_push] Can't get the token: 907135003: client api invalid HOT 1
- NullPointerException in FlutterBackgroundRunner
- huawei_modeling3d 1.8.0+300 只支持Android平台, 近期有计划增加支持iOS等其他平台吗
- Location Kit throws AGC_CHECK_FAIL - 10808 (AppGallery Connect identity verification failed) HOT 2
- flutter ios AGConnectCrashPlugin init failed HOT 1
- AGP8 upgrade
- CRITICAL : the future initFusedLocationService() never end HOT 9
- huawei_push GetToken returned null HOT 5
- [Huawei_push][Bug] cancelNotificationsWithId is not await or return any result
- Flutter Huawei FIDO: unable to decode FIDO registration response
- 集成huawei_location 提示FusedLocationService is not initialized HOT 2
- Huawei analytics does not work on Flutter HOT 1
- Unexpected CFBundleExecutable Key
- Installed Build Tools revision 31.0.0 is corrupted. Remove and install again using the SDK Manager.
- UserHandle data is missing in Flutter FIDO Authentication result HOT 5
- Geocoding Service Error
- [huawei_map] Clicking on Marker Causes setZIndex:Failure win parameter HOT 1
- 有无支持基于鸿蒙的Flutter适配的计划
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hms-flutter-plugin.