发表文章

[Java] 在 compileSdkVersion 25 时不会在 android 系统工作 won't work in android when compileSdkVersion is 25[react-native-music-control]

ngrj 2017-10-9 26

我的反应本机项目需要最小 comileSdkversion 为 25, 当我更新生成. gradle 文件相应的包不工作, 它引发错误时, 我尝试 setNowPlaying

  1. 示例代码 (提供回购 url 或示例代码)
    我更改了生成. gradle 文件, 如下所:
    android { compileSdkVersion 25 buildToolsVersion "25.0.0" }

  2. 平台?

    • android
  3. 设备

  • 模拟
  • 实际设备
  1. 错误
    java.lang.NullPointerException: name is null at android.content.res.ResourcesImpl.getIdentifier(ResourcesImpl.java:214) at android.content.res.Resources.getIdentifier(Resources.java:1873) at com.tanguyantoine.react.MusicControlNotification.setCustomNotificationIcon(MusicControlNotification.java:46) at com.tanguyantoine.react.MusicControlModule.setNowPlaying(MusicControlModule.java:210) at java.lang.reflect.Method.invoke(Native Method) at com.facebook.react.bridge.BaseJavaModule$JavaMethod.invoke(BaseJavaModule.java:368) at com.facebook.react.cxxbridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:138) at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method) at android.os.Handler.handleCallback(Handler.java:751) at android.os.Handler.dispatchMessage(Handler.java:95) at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:31) at android.os.Looper.loop(Looper.java:154) at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:208) at java.lang.Thread.run(Thread.java:761)

我设置的值是有效的, 因为代码在 ios 中运行良好, 也感谢这个可怕的插件。
如果你能引导我, 我可以试着解决这个问题。
我在上问过相同的问题,所以没有响应
Ps: 对不起, 如果我的问题结构有什么不妥

原文:

My react native project requires minimum comileSdkversion to be 25, when I update the build.gradle file accordingly the package does not work and it raised error when I try setNowPlaying

  1. Sample code (provide repo url or sample code)
    I changed the build.gradle file like this:
    android { compileSdkVersion 25 buildToolsVersion "25.0.0" }

  2. Platform ?

    • Android
  3. Device

  • Simulator
  • Real device
  1. Error
    java.lang.NullPointerException: name is null at android.content.res.ResourcesImpl.getIdentifier(ResourcesImpl.java:214) at android.content.res.Resources.getIdentifier(Resources.java:1873) at com.tanguyantoine.react.MusicControlNotification.setCustomNotificationIcon(MusicControlNotification.java:46) at com.tanguyantoine.react.MusicControlModule.setNowPlaying(MusicControlModule.java:210) at java.lang.reflect.Method.invoke(Native Method) at com.facebook.react.bridge.BaseJavaModule$JavaMethod.invoke(BaseJavaModule.java:368) at com.facebook.react.cxxbridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:138) at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method) at android.os.Handler.handleCallback(Handler.java:751) at android.os.Handler.dispatchMessage(Handler.java:95) at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:31) at android.os.Looper.loop(Looper.java:154) at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:208) at java.lang.Thread.run(Thread.java:761)

The values I'm setting is valid, since the code works well in ios, also thanks for this awesome plugin.
If you can guide me I can try to fix this.
I've asked same question on SO with no response
Ps: sorry if there was something wrong with my Issue structure

相关推荐
最新评论 (9)
Guichaguri 2017-10-9
1

这是一个由@mzmiric5的公关引入的崩溃. 在761813a中修复

原文:

It was a crash introduced by @mzmiric5's PR. Fixed in 761813a

tanguyantoine 2017-10-9
2

版本凹凸?

原文:

Version bump ?

Guichaguri 2017-10-9
3

做.

原文:

Done.

tanguyantoine 2017-10-9
4

快于闪存

原文:

faster than flash

jdemangeon 2017-10-9
5

谢谢 =) 现在也许是适当的时机来引入单元测试以避免回归?

原文:

Thanks =) It's maybe the right moment to introduce unit tests to avoid regressions ?

ngrj 2017-10-9
6

嗨真的很感谢你的出色工作
我已经更新了包, 现在我收到这个错误:

Exception in native call E/unknown:React(16859): java.lang.RuntimeException: Could not invoke MusicControlManager.setNowPlaying E/unknown:React(16859): at com.facebook.react.bridge.BaseJavaModule$JavaMethod.invoke(BaseJavaModule.java:382) E/unknown:React(16859): at com.facebook.react.cxxbridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:138) E/unknown:React(16859): at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method) E/unknown:React(16859): at android.os.Handler.handleCallback(Handler.java:733) E/unknown:React(16859): at android.os.Handler.dispatchMessage(Handler.java:95) E/unknown:React(16859): at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:31) E/unknown:React(16859): at android.os.Looper.loop(Looper.java:136) E/unknown:React(16859): at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:208) E/unknown:React(16859): at java.lang.Thread.run(Thread.java:841) E/unknown:React(16859): Caused by: java.lang.reflect.InvocationTargetException E/unknown:React(16859): at java.lang.reflect.Method.invokeNative(Native Method) E/unknown:React(16859): at java.lang.reflect.Method.invoke(Method.java:515) E/unknown:React(16859): at com.facebook.react.bridge.BaseJavaModule$JavaMethod.invoke(BaseJavaModule.java:368) E/unknown:React(16859): ... 8 more E/unknown:React(16859): Caused by: java.lang.NoSuchMethodError: android.media.RemoteControlClient$MetadataEditor.putObject E/unknown:React(16859): at android.support.v4.media.session.MediaSessionCompatApi19.addNewMetadata(MediaSessionCompatApi19.java:80) E/unknown:React(16859): at android.support.v4.media.session.MediaSessionCompatApi19.setMetadata(MediaSessionCompatApi19.java:50) E/unknown:React(16859): at android.support.v4.media.session.MediaSessionCompat$MediaSessionImplBase.setMetadata(MediaSessionCompat.java:1729) E/unknown:React(16859): at android.support.v4.media.session.MediaSessionCompat$MediaSessionImplBase.setActive(MediaSessionCompat.java:1649) E/unknown:React(16859): at android.support.v4.media.session.MediaSessionCompat.setActive(MediaSessionCompat.java:408) E/unknown:React(16859): at com.tanguyantoine.react.MusicControlModule.setNowPlaying(MusicControlModule.java:250) E/unknown:React(16859): ... 11 more W/unknown:React(16859): Invoking JS callback after bridge has been destroyed.

这是相同的错误, 我收到之前, 我更新软件包从0.4。4

编辑: 我的手机 Android 版本是 4.4.4, 它在6.0.0 很好的工作

原文:

Hi really thanks for the awesome work,
I've updated the package now I'm receiving this error:

Exception in native call E/unknown:React(16859): java.lang.RuntimeException: Could not invoke MusicControlManager.setNowPlaying E/unknown:React(16859): at com.facebook.react.bridge.BaseJavaModule$JavaMethod.invoke(BaseJavaModule.java:382) E/unknown:React(16859): at com.facebook.react.cxxbridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:138) E/unknown:React(16859): at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method) E/unknown:React(16859): at android.os.Handler.handleCallback(Handler.java:733) E/unknown:React(16859): at android.os.Handler.dispatchMessage(Handler.java:95) E/unknown:React(16859): at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:31) E/unknown:React(16859): at android.os.Looper.loop(Looper.java:136) E/unknown:React(16859): at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:208) E/unknown:React(16859): at java.lang.Thread.run(Thread.java:841) E/unknown:React(16859): Caused by: java.lang.reflect.InvocationTargetException E/unknown:React(16859): at java.lang.reflect.Method.invokeNative(Native Method) E/unknown:React(16859): at java.lang.reflect.Method.invoke(Method.java:515) E/unknown:React(16859): at com.facebook.react.bridge.BaseJavaModule$JavaMethod.invoke(BaseJavaModule.java:368) E/unknown:React(16859): ... 8 more E/unknown:React(16859): Caused by: java.lang.NoSuchMethodError: android.media.RemoteControlClient$MetadataEditor.putObject E/unknown:React(16859): at android.support.v4.media.session.MediaSessionCompatApi19.addNewMetadata(MediaSessionCompatApi19.java:80) E/unknown:React(16859): at android.support.v4.media.session.MediaSessionCompatApi19.setMetadata(MediaSessionCompatApi19.java:50) E/unknown:React(16859): at android.support.v4.media.session.MediaSessionCompat$MediaSessionImplBase.setMetadata(MediaSessionCompat.java:1729) E/unknown:React(16859): at android.support.v4.media.session.MediaSessionCompat$MediaSessionImplBase.setActive(MediaSessionCompat.java:1649) E/unknown:React(16859): at android.support.v4.media.session.MediaSessionCompat.setActive(MediaSessionCompat.java:408) E/unknown:React(16859): at com.tanguyantoine.react.MusicControlModule.setNowPlaying(MusicControlModule.java:250) E/unknown:React(16859): ... 11 more W/unknown:React(16859): Invoking JS callback after bridge has been destroyed.

This is the same error I was receiving before I updated the package from 0.4.4

Edit: My Phone Android version is 4.4.4, it works well in 6.0.0

tanguyantoine 2017-10-9
7

@jdemangeon欢迎您的公关。

原文:

@jdemangeon your pr is welcome ;-)

Guichaguri 2017-10-9
8

@ngrj这看起来像是支持库的问题, 而不是这个模块。是否可以刷新依存关系并重试?

原文:

@ngrj This looks like an issue with the support library, not with this module. Can you refresh the dependencies and try again, please?

ngrj 2017-10-9
9

好吧, 谢谢

原文:

okay will do that, thanks

返回
发表文章
ngrj
文章数
1
评论数
2
注册排名
60725