I have compiled an system from AOSP and fastboot it into Nexus 7. I am now trying to write a very simple app to test the location updates through Network provider.
I have a sim card installed and enabled all the settings but I always get the errors shown below. It seems like there is no network provider. But How can I enabled it?? I have been stuck in this for ages and have no clues.(GPS is working fine)
D/PbdTrial( 4527): Network provider NOT enabled
D/AndroidRuntime( 4527): Shutting down VM
E/AndroidRuntime( 4527): FATAL EXCEPTION: main
E/AndroidRuntime( 4527): Process: com.example.jack.pbdtrial, PID: 4527
E/AndroidRuntime( 4527): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.jack.pbdtrial/com.example.jack.pbdtrial.MainActivity}: java.lang.IllegalArgumentException: provider doesn't exist: network
E/AndroidRuntime( 4527): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2298)
E/AndroidRuntime( 4527): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2360)
E/AndroidRuntime( 4527): at android.app.ActivityThread.access$800(ActivityThread.java:144)
E/AndroidRuntime( 4527): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278)
E/AndroidRuntime( 4527): at android.os.Handler.dispatchMessage(Handler.java:102)
E/AndroidRuntime( 4527): at android.os.Looper.loop(Looper.java:135)
E/AndroidRuntime( 4527): at android.app.ActivityThread.main(ActivityThread.java:5221)
E/AndroidRuntime( 4527): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime( 4527): at java.lang.reflect.Method.invoke(Method.java:372)
E/AndroidRuntime( 4527): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
E/AndroidRuntime( 4527): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
E/AndroidRuntime( 4527): Caused by: java.lang.IllegalArgumentException: provider doesn't exist: network
E/AndroidRuntime( 4527): at android.os.Parcel.readException(Parcel.java:1544)
E/AndroidRuntime( 4527): at android.os.Parcel.readException(Parcel.java:1493)
E/AndroidRuntime( 4527): at android.location.ILocationManager$Stub$Proxy.requestLocationUpdates(ILocationManager.java:584)
E/AndroidRuntime( 4527): at android.location.LocationManager.requestLocationUpdates(LocationManager.java:867)
E/AndroidRuntime( 4527): at android.location.LocationManager.requestLocationUpdates(LocationManager.java:459)
E/AndroidRuntime( 4527): at com.example.jack.pbdtrial.MainActivity.onCreate(MainActivity.java:73)
E/AndroidRuntime( 4527): at android.app.Activity.performCreate(Activity.java:5933)
E/AndroidRuntime( 4527): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105)
E/AndroidRuntime( 4527): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2251)
Have you added this to your manifest?
<manifest ... >
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
...
</manifest>
Also, to be sure you have enable the location update in your phone setting, you can prompt the user to enable it using this method
Related
Description
I have created a project with react-native-cli
When I launch the app using the command "react-native run-android" on Devices and Emulators with Android API level 21+ App is launching.
But for devices less than API 21, the app crashing on launch.
I have specified in android Gradle minSdk version to 16.
I viewed the stack trace using "adb logcat" the crash was due to OkHttp3 that is used internally in Facebook Flipper, which is expecting API 21+.
I haven't used any OkHttp3 Dependency explicitly in my app
React Native version:
6.14.4
Steps To Reproduce
Create a project using react-native CLI not Expo CLI
Navigate to the project folder
Connect a device or an emulator with API less than 21
run command "react-native run-android" to run the app on the connected device
Expected Results
The app should launch without any crash.
Android Logs
E/AndroidRuntime( 3745): java.lang.RuntimeException: Unable to create application com.infifive.MainApplication: java.lang.RuntimeException: Requested enabled DevSupportManager, but DevSupportManagerImpl class was not found or could not be created
E/AndroidRuntime( 3745): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4347)
E/AndroidRuntime( 3745): at android.app.ActivityThread.access$1500(ActivityThread.java:135)
E/AndroidRuntime( 3745): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
E/AndroidRuntime( 3745): at android.os.Handler.dispatchMessage(Handler.java:102)
E/AndroidRuntime( 3745): at android.os.Looper.loop(Looper.java:136)
E/AndroidRuntime( 3745): at android.app.ActivityThread.main(ActivityThread.java:5017)
E/AndroidRuntime( 3745): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 3745): at java.lang.reflect.Method.invoke(Method.java:515)
E/AndroidRuntime( 3745): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
E/AndroidRuntime( 3745): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
E/AndroidRuntime( 3745): at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime( 3745): Caused by: java.lang.RuntimeException: Requested enabled DevSupportManager, but DevSupportManagerImpl class was not found or could not be created
E/AndroidRuntime( 3745): at com.facebook.react.devsupport.DevSupportManagerFactory.create(DevSupportManagerFactory.java:90)
E/AndroidRuntime( 3745): at com.facebook.react.ReactInstanceManager.<init>(ReactInstanceManager.java:238)
E/AndroidRuntime( 3745): at com.facebook.react.ReactInstanceManagerBuilder.build(ReactInstanceManagerBuilder.java:281)
E/AndroidRuntime( 3745): at com.facebook.react.ReactNativeHost.createReactInstanceManager(ReactNativeHost.java:87)
E/AndroidRuntime( 3745): at com.facebook.react.ReactNativeHost.getReactInstanceManager(ReactNativeHost.java:39)
E/AndroidRuntime( 3745): at com.infifive.MainApplication.onCreate(MainApplication.java:47)
E/AndroidRuntime( 3745): at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1007)
E/AndroidRuntime( 3745): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4344)
E/AndroidRuntime( 3745): ... 10 more
E/AndroidRuntime( 3745): Caused by: java.lang.reflect.InvocationTargetException
E/AndroidRuntime( 3745): at java.lang.reflect.Constructor.constructNative(Native Method)
E/AndroidRuntime( 3745): at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
E/AndroidRuntime( 3745): at com.facebook.react.devsupport.DevSupportManagerFactory.create(DevSupportManagerFactory.java:80)
E/AndroidRuntime( 3745): ... 17 more
E/AndroidRuntime( 3745): Caused by: java.lang.ExceptionInInitializerError
E/AndroidRuntime( 3745): at okhttp3.OkHttpClient.newSslSocketFactory(OkHttpClient.java:263)
E/AndroidRuntime( 3745): at okhttp3.OkHttpClient.<init>(OkHttpClient.java:229)
E/AndroidRuntime( 3745): at okhttp3.OkHttpClient$Builder.build(OkHttpClient.java:1015)
E/AndroidRuntime( 3745): at com.facebook.react.devsupport.DevServerHelper.<init>(DevServerHelper.java:132)
E/AndroidRuntime( 3745): at com.facebook.react.devsupport.DevSupportManagerImpl.<init>(DevSupportManagerImpl.java:183)
E/AndroidRuntime( 3745): ... 20 more
E/AndroidRuntime( 3745): Caused by: java.lang.IllegalStateException: Expected Android API level 21+ but was 19
E/AndroidRuntime( 3745): at okhttp3.internal.platform.AndroidPlatform.buildIfSupported(AndroidPlatform.java:238)
E/AndroidRuntime( 3745): at okhttp3.internal.platform.Platform.findPlatform(Platform.java:202)
E/AndroidRuntime( 3745): at okhttp3.internal.platform.Platform.<clinit>(Platform.java:79)`
The only way I found to fix it is by commenting out all the code associated with flipper
GH thread here
This happens because of an internal check in the library called "okhttp" where the newer versions are supporting only API 21 and above. If possible, reduce the okhttp version, or anything related to it such as Glide or Retrofit etc. That will solve your problem.
App crashing with
java.lang.RuntimeException: Error receiving broadcast Intent { act=com.espn.score_center/com.framework.chromecast.CastNotificationActivity flg=0x10 bnds=[0,633][1080,971] (has extras) } in afj#439752a8
E/AndroidRuntime( 4624): at android.app.LoadedApk$ReceiverDispatcher$Args.run(LoadedApk.java:773)
E/AndroidRuntime( 4624): at android.os.Handler.handleCallback(Handler.java:733)
E/AndroidRuntime( 4624): at android.os.Handler.dispatchMessage(Handler.java:95)
E/AndroidRuntime( 4624): at android.os.Looper.loop(Looper.java:146)
E/AndroidRuntime( 4624): at android.app.ActivityThread.main(ActivityThread.java:5727)
E/AndroidRuntime( 4624): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 4624): at java.lang.reflect.Method.invoke(Method.java:515)
E/AndroidRuntime( 4624): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1291)
E/AndroidRuntime( 4624): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1107)
E/AndroidRuntime( 4624): at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime( 4624): Caused by: java.lang.SecurityException: Permission Denial: getTasks() from pid=4624, uid=10257 requires android.permission.GET_TASKS
E/AndroidRuntime( 4624): at android.os.Parcel.readException(Parcel.java:1465)
E/AndroidRuntime( 4624): at android.os.Parcel.readException(Parcel.java:1419)
E/AndroidRuntime( 4624): at android.app.ActivityManagerProxy.getTasks(ActivityManagerNative.java:2860)
E/AndroidRuntime( 4624): at android.app.ActivityManager.getRunningTasks(ActivityManager.java:851)
E/AndroidRuntime( 4624): at android.app.ActivityManager.getRunningTasks(ActivityManager.java:887)
E/AndroidRuntime( 4624): at afj.onReceive(:com.google.android.gms.DynamiteModulesC:89)
E/AndroidRuntime( 4624): at android.app.LoadedApk$ReceiverDispatcher$Args.run(LoadedApk.java:763)
I have layout
R.layout.alarm_clock_setting_view
And i want to Inject him into LayoutInflater.
Now i do next :
#InjectView(R.layout.alarm_clock_setting_view)
private RelativeLayout alarmClockSettingView;
...
//in OnCreate
mSettingAlarmClockView = alarmClockSettingView;
...
But that's not worked. What i need to do to inject layout into LayoutInflater?
Error :
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.samsung.clock/com.samsung.clock.views.ClockFragmentActivity}: java.lang.IllegalStateException: Unable to use annotation database(s)
E/AndroidRuntime( 3754): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2658)
E/AndroidRuntime( 3754): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2725)
E/AndroidRuntime( 3754): at android.app.ActivityThread.access$900(ActivityThread.java:172)
E/AndroidRuntime( 3754): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1422)
E/AndroidRuntime( 3754): at android.os.Handler.dispatchMessage(Handler.java:102)
E/AndroidRuntime( 3754): at android.os.Looper.loop(Looper.java:145)
E/AndroidRuntime( 3754): at android.app.ActivityThread.main(ActivityThread.java:5834)
E/AndroidRuntime( 3754): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime( 3754): at java.lang.reflect.Method.invoke(Method.java:372)
E/AndroidRuntime( 3754): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1388)
E/AndroidRuntime( 3754): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1183)
E/AndroidRuntime( 3754): Caused by: java.lang.IllegalStateException: Unable to use annotation database(s)
E/AndroidRuntime( 3754): at roboguice.RoboGuice.initializeAnnotationDatabaseFinderAndHierarchyTraversalFilterFactory(RoboGuice.java:292)
E/AndroidRuntime( 3754): at roboguice.RoboGuice.getOrCreateBaseApplicationInjector(RoboGuice.java:149)
E/AndroidRuntime( 3754): at roboguice.RoboGuice.getOrCreateBaseApplicationInjector(RoboGuice.java:90)
E/AndroidRuntime( 3754): at roboguice.RoboGuice.getInjector(RoboGuice.java:197)
E/AndroidRuntime( 3754): at roboguice.activity.RoboFragmentActivity.onCreate(RoboFragmentActivity.java:60)
E/AndroidRuntime( 3754): at MainActivity.onCreate(MainActivity.java:95)
E/AndroidRuntime( 3754): at android.app.Activity.performCreate(Activity.java:6221)
E/AndroidRuntime( 3754): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1119)
E/AndroidRuntime( 3754): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2611)
E/AndroidRuntime( 3754): ... 10 more
I'm using Robotium to automate my app testing. My app has 1 activity (ActionBarActivity) and 2 fragments (using support.v4.app.Fragment). The app works fine but when I attempt to run a Robotium test, I get an error when attempting to create a new Solo instance.
solo = new Solo(getInstrumentation(), getActivity());
Logcat output:
java.lang.NoSuchMethodError: No static method setOnApplyWindowInsetsListener(Landroid/view/View;Landroid/support/v4/view/OnApplyWindowInsetsListener;)V in class Landroid/support/v4/view/ViewCompat; or its super classes (declaration of 'android.support.v4.view.ViewCompat' appears in /data/app/com.mycompany.mytrip.test-1/base.apk)
E/AndroidRuntime( 5220): at android.support.v7.app.ActionBarActivityDelegateBase.ensureSubDecor(ActionBarActivityDelegateBase.java:304)
E/AndroidRuntime( 5220): at android.support.v7.app.ActionBarActivityDelegateBase.setContentView(ActionBarActivityDelegateBase.java:225)
E/AndroidRuntime( 5220): at android.support.v7.app.ActionBarActivity.setContentView(ActionBarActivity.java:102)
E/AndroidRuntime( 5220): at com.mycompany.mytrip.activities.MainActivity.onCreate(MainActivity.java:38)
E/AndroidRuntime( 5220): at android.app.Activity.performCreate(Activity.java:5933)
E/AndroidRuntime( 5220): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105)
E/AndroidRuntime( 5220): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2251)
E/AndroidRuntime( 5220): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2360)
E/AndroidRuntime( 5220): at android.app.ActivityThread.access$800(ActivityThread.java:144)
E/AndroidRuntime( 5220): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278)
E/AndroidRuntime( 5220): at android.os.Handler.dispatchMessage(Handler.java:102)
E/AndroidRuntime( 5220): at android.os.Looper.loop(Looper.java:135)
E/AndroidRuntime( 5220): at android.app.ActivityThread.main(ActivityThread.java:5221)
E/AndroidRuntime( 5220): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime( 5220): at java.lang.reflect.Method.invoke(Method.java:372)
E/AndroidRuntime( 5220): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
E/AndroidRuntime( 5220): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
W/ActivityManager( 1229): Error in app com.mycompany.mytrip running instrumentation ComponentInfo{com.mycompany.mytrip.test/android.test.InstrumentationTestRunner}:
W/ActivityManager( 1229): java.lang.NoSuchMethodError
W/ActivityManager( 1229): java.lang.NoSuchMethodError: No static method setOnApplyWindowInsetsListener(Landroid/view/View;Landroid/support/v4/view/OnApplyWindowInsetsListener;)V in class Landroid/support/v4/view/ViewCompat; or its super classes (declaration of 'android.support.v4.view.ViewCompat' appears in /data/app/com.mycompany.mytrip.test-1/base.apk)
D/AndroidRuntime( 5209): Shutting down VM
Any suggestion much appreciated!
I'm trying to port the Contacts APK from the galaxy S5 to the Galaxy S4.
I got a FC when I tried to launch the application. I would like to get some help fixing this issue.
E/AndroidRuntime( 3085): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.android.contacts/com.android.contacts.activities.PeopleActivity}: android.view.InflateException: Binary XML file line #71: Error inflating class <unknown>
E/AndroidRuntime( 3085): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2305)
E/AndroidRuntime( 3085): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2363)
E/AndroidRuntime( 3085): at android.app.ActivityThread.access$900(ActivityThread.java:161)
E/AndroidRuntime( 3085): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1265)
E/AndroidRuntime( 3085): at android.os.Handler.dispatchMessage(Handler.java:102)
E/AndroidRuntime( 3085): at android.os.Looper.loop(Looper.java:157)
E/AndroidRuntime( 3085): at android.app.ActivityThread.main(ActivityThread.java:5356)
E/AndroidRuntime( 3085): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 3085): at java.lang.reflect.Method.invoke(Method.java:515)
E/AndroidRuntime( 3085): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1265)
E/AndroidRuntime( 3085): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1081)
E/AndroidRuntime( 3085): at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:132)
E/AndroidRuntime( 3085): at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime( 3085): Caused by: android.view.InflateException: Binary XML file line #71: Error inflating class <unknown>
E/AndroidRuntime( 3085): at android.view.LayoutInflater.createView(LayoutInflater.java:626)
E/AndroidRuntime( 3085): at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
E/AndroidRuntime( 3085): at android.view.LayoutInflater.onCreateView(LayoutInflater.java:675)
E/AndroidRuntime( 3085): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:700)
E/AndroidRuntime( 3085): at android.view.LayoutInflater.rInflate(LayoutInflater.java:761)
E/AndroidRuntime( 3085): at android.view.LayoutInflater.inflate(LayoutInflater.java:498)
E/AndroidRuntime( 3085): at de.robv.android.xposed.XposedBridge.invokeOriginalMethodNative(Native Method)
E/AndroidRuntime( 3085): at de.robv.android.xposed.XposedBridge.handleHookedMethod(XposedBridge.java:627)
E/AndroidRuntime( 3085): at android.view.LayoutInflater.inflate(Native Method)
E/AndroidRuntime( 3085): at android.view.LayoutInflater.inflate(LayoutInflater.java:398)
E/AndroidRuntime( 3085): at com.android.dialer.dialpad.DialpadFragment.onCreateView(DialpadFragment.java:672)
E/AndroidRuntime( 3085): at android.app.Fragment.performCreateView(Fragment.java:1700)
E/AndroidRuntime( 3085): at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:890)
E/AndroidRuntime( 3085): at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1062)
E/AndroidRuntime( 3085): at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1044)
E/AndroidRuntime( 3085): at android.app.FragmentManagerImpl.dispatchActivityCreated(FragmentManager.java:1853)
E/AndroidRuntime( 3085): at android.app.Activity.performCreate(Activity.java:5429)
E/AndroidRuntime( 3085): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105)
E/AndroidRuntime( 3085): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2269)
E/AndroidRuntime( 3085): ... 12 more
E/AndroidRuntime( 3085): Caused by: java.lang.reflect.InvocationTargetException
E/AndroidRuntime( 3085): at java.lang.reflect.Constructor.constructNative(Native Method)
E/AndroidRuntime( 3085): at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
E/AndroidRuntime( 3085): at android.view.LayoutInflater.createView(LayoutInflater.java:600)
E/AndroidRuntime( 3085): ... 30 more
E/AndroidRuntime( 3085): Caused by: android.content.res.Resources$NotFoundException: File res/drawable/dialpad_background.xml from drawable resource ID #0x7f0200e2
E/AndroidRuntime( 3085): at android.content.res.Resources.loadDrawable(Resources.java:3010)
E/AndroidRuntime( 3085): at android.content.res.TypedArray.getDrawable(TypedArray.java:602)
E/AndroidRuntime( 3085): at android.content.res.XResources$XTypedArray.getDrawable(XResources.java:797)
E/AndroidRuntime( 3085): at android.view.View.<init>(View.java:3694)
E/AndroidRuntime( 3085): at android.view.View.<init>(View.java:3624)
E/AndroidRuntime( 3085): ... 33 more
E/AndroidRuntime( 3085): Caused by: org.xmlpull.v1.XmlPullParserException: Binary XML file line #17: <bitmap> requires a valid src attribute
E/AndroidRuntime( 3085): at android.graphics.drawable.BitmapDrawable.inflate(BitmapDrawable.java:577)
E/AndroidRuntime( 3085): at android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:973)
E/AndroidRuntime( 3085): at android.graphics.drawable.Drawable.createFromXml(Drawable.java:913)
E/AndroidRuntime( 3085): at android.content.res.Resources.loadDrawable(Resources.java:3006)
E/AndroidRuntime( 3085): ... 37 more
W/ActivityManager( 1126): Force finishing activity com.android.contacts/.activities.PeopleActivity
Here is the zip containing the files from the app from apktool.
SecContacts