java.lang.ClassNotFoundException: android.net.Network

≯℡__Kan透↙ 提交于 2020-01-06 04:15:07

问题


This is little related to Payubiz payment gateway sdk integration. However, the main problem is related to building a project.

Whenever we try to run the application on emulator. We get the following failure:

  • What went wrong: Execution failed for task ':app:transformClassesWithInstantRunForAppDebug'. java.lang.ClassNotFoundException: android.net.Network

However, the application builds and run smoothly on running on a device. We have already contacted the Payu Team for the issue. But as it is an android related problem, not the payment gateway. I feel like SO is the better place.

Emulator Details:

  • Name: Nexus_4_API_19 CPU/ABI: Google APIs Intel Atom (x86)
  • Target: google_apis [Google APIs] (API level 19)
  • runtime.network.speed: full

SOLUTION: Below, is a reply from PayU team. They have confirmed that they were not using any class, neither do i. But after some time/ may be some other dependency/cleaning the project. It works for the emulator as well.


回答1:


The class android.net.Network is added in API 21. You need to use an emulator with the same or higher API level to access it.



来源:https://stackoverflow.com/questions/39995922/java-lang-classnotfoundexception-android-net-network

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!