I am developing an android app , I want to show banner ads in my app .My previous apps works correctly and the ads are shown . When I create my new app ads did not show even in the old apps
it shows ads failed to load ad:3
this what is shown in the logcat
11-29 18:52:54.831: D/ViewRootImpl(31298): ViewPostImeInputStage processPointer 0
11-29 18:52:54.921: D/ViewRootImpl(31298): ViewPostImeInputStage processPointer 1
11-29 18:52:54.921: I/Timeline(31298): Timeline: Activity_launch_request id:apps.s.r.sh time:126574535
11-29 18:52:54.951: W/ResourcesManager(31298): getTopLevelResources: /data/app/apps.s.r.sh-1/base.apk / 1.0 running in apps.s.r.sh rsrc of package null
11-29 18:52:54.951: W/ResourcesManager(31298): getTopLevelResources: /data/app/apps.s.r.sh-1/base.apk / 1.0 running in apps.s.r.sh rsrc of package null
11-29 18:52:55.241: D/SecWifiDisplayUtil(31298): Metadata value : none
11-29 18:52:55.251: D/ViewRootImpl(31298): #1 mView = com.android.internal.policy.PhoneWindow$DecorView{b1e1489 I.E...... R.....ID 0,0-0,0}
11-29 18:52:55.571: W/DisplayListCanvas(31298): DisplayListCanvas is started on unbinded RenderNode (without mOwningView)
11-29 18:52:55.591: D/ViewRootImpl(31298): MSG_RESIZED_REPORT: ci=Rect(0, 72 - 0, 0) vi=Rect(0, 72 - 0, 0) or=1
11-29 18:52:55.851: I/Timeline(31298): Timeline: Activity_idle id: android.os.BinderProxy#1308390 time:126575466
11-29 18:52:55.861: V/ActivityThread(31298): updateVisibility : ActivityRecord{c3eecaf token=android.os.BinderProxy#2057663 {apps.s.r.sh/apps.s.r.sh.MainActivity}} show : false
11-29 18:52:56.921: D/ViewRootImpl(31298): ViewPostImeInputStage processPointer 0
11-29 18:52:56.991: D/ViewRootImpl(31298): ViewPostImeInputStage processPointer 1
11-29 18:52:57.001: I/Timeline(31298): Timeline: Activity_launch_request id:apps.s.r.sh time:126576611
11-29 18:52:57.031: W/ResourcesManager(31298): getTopLevelResources: /data/app/apps.s.r.sh-1/base.apk / 1.0 running in apps.s.r.sh rsrc of package null
11-29 18:52:57.031: W/ResourcesManager(31298): getTopLevelResources: /data/app/apps.s.r.sh-1/base.apk / 1.0 running in apps.s.r.sh rsrc of package null
11-29 18:52:57.081: W/ResourcesManager(31298): getTopLevelResources: /data/app/com.google.android.gms-1/base.apk / 1.0 running in apps.s.r.sh rsrc of package null
11-29 18:52:57.261: W/DynamiteModule(31298): Failed to load module via V2: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.dynamite.DynamiteModule$DynamiteLoaderClassLoader" on path: DexPathList[[zip file "/data/app/apps.s.r.sh-1/base.apk"],nativeLibraryDirectories=[/data/app/apps.s.r.sh-1/lib/arm, /vendor/lib, /system/lib]]
11-29 18:52:57.271: I/DynamiteModule(31298): Considering local module com.google.android.gms.ads.dynamite:0 and remote module com.google.android.gms.ads.dynamite:10900
11-29 18:52:57.271: I/DynamiteModule(31298): Selected remote version of com.google.android.gms.ads.dynamite, version >= 10900
11-29 18:52:57.311: W/ResourcesManager(31298): getTopLevelResources: /data/app/com.google.android.gms-1/base.apk / 1.0 running in apps.s.r.sh rsrc of package null
11-29 18:52:57.371: W/System(31298): ClassLoader referenced unknown path: /data/data/com.google.android.gms/app_chimera/m/00000094/n/armeabi-v7a
11-29 18:52:57.371: W/System(31298): ClassLoader referenced unknown path: /data/data/com.google.android.gms/app_chimera/m/00000094/n/armeabi
11-29 18:52:57.381: W/ResourcesManager(31298): getTopLevelResources: /data/data/com.google.android.gms/app_chimera/m/00000094/AdsDynamite.apk / 1.0 running in apps.s.r.sh rsrc of package null
11-29 18:52:57.391: W/ResourcesManager(31298): getTopLevelResources: /data/data/com.google.android.gms/app_chimera/m/00000094/AdsDynamite.apk / 1.0 running in apps.s.r.sh rsrc of package null
11-29 18:52:57.391: D/DynamitePackage(31298): Instantiated singleton DynamitePackage.
11-29 18:52:57.391: D/DynamitePackage(31298): Instantiating com.google.android.gms.ads.ChimeraAdManagerCreatorImpl
11-29 18:52:57.531: I/Ads(31298): Updating ad debug logging enablement.
11-29 18:52:57.541: I/Ads(31298): Use AdRequest.Builder.addTestDevice("5165705B1A22CACD4E59EB67DC3FCE56") to get test ads on this device.
11-29 18:52:57.621: W/Ads(31298): Invoke Firebase method getInstance error.
11-29 18:52:57.621: W/Ads(31298): The Google Mobile Ads SDK will not integrate with Firebase. Admob/Firebase integration requires the latest Firebase SDK jar, but Firebase SDK is either missing or out of date
11-29 18:52:57.631: W/DynamiteModule(31298): Failed to load module via V2: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.dynamite.DynamiteModule$DynamiteLoaderClassLoader" on path: DexPathList[[zip file "/data/app/apps.s.r.sh-1/base.apk"],nativeLibraryDirectories=[/data/app/apps.s.r.sh-1/lib/arm, /vendor/lib, /system/lib]]
11-29 18:52:57.641: I/DynamiteModule(31298): Considering local module com.google.android.gms.ads.dynamite:0 and remote module com.google.android.gms.ads.dynamite:10900
11-29 18:52:57.641: I/DynamiteModule(31298): Selected remote version of com.google.android.gms.ads.dynamite, version >= 10900
11-29 18:52:57.641: I/WebViewFactory(31298): Loading com.google.android.webview version 70.0.3538.110 (code 353811000)
11-29 18:52:57.661: W/ResourcesManager(31298): getTopLevelResources: /data/data/com.google.android.gms/app_chimera/m/00000094/AdsDynamite.apk / 1.0 running in apps.s.r.sh rsrc of package null
11-29 18:52:57.661: D/SecWifiDisplayUtil(31298): Metadata value : none
11-29 18:52:57.661: D/ViewRootImpl(31298): #1 mView = com.android.internal.policy.PhoneWindow$DecorView{4488dba I.E...... R.....ID 0,0-0,0}
11-29 18:52:57.681: W/Ads(31298): Update ad debug logging enablement as false
11-29 18:52:57.751: W/ResourcesManager(31298): getTopLevelResources: /data/app/com.google.android.webview-2/base.apk / 1.0 running in apps.s.r.sh rsrc of package null
11-29 18:52:57.761: D/ViewRootImpl(31298): MSG_RESIZED_REPORT: ci=Rect(0, 72 - 0, 0) vi=Rect(0, 72 - 0, 0) or=1
11-29 18:52:57.771: W/DisplayListCanvas(31298): DisplayListCanvas is started on unbinded RenderNode (without mOwningView)
11-29 18:52:57.791: I/Timeline(31298): Timeline: Activity_idle id: android.os.BinderProxy#e9b4ee5 time:126577403
11-29 18:52:57.901: I/art(31298): Rejecting re-init on previously-failed class java.lang.Class<hs>
11-29 18:52:57.901: I/art(31298): Rejecting re-init on previously-failed class java.lang.Class<hs>
11-29 18:52:57.921: V/ActivityThread(31298): updateVisibility : ActivityRecord{47d0972 token=android.os.BinderProxy#1308390 {apps.s.r.sh/apps.s.r.sh.First}} show : false
11-29 18:52:57.921: I/cr_LibraryLoader(31298): Time to load native libraries: ? ms (timestamps ????-????)
11-29 18:52:57.991: I/chromium(31298): [INFO:library_loader_hooks.cc(36)] Chromium logging enabled: level = 0, default verbosity = 0
11-29 18:52:57.991: I/cr_LibraryLoader(31298): Expected native library version number "70.0.3538.110", actual native library version number "70.0.3538.110"
11-29 18:52:58.821: I/Ads(31298): Ad failed to load : 3
The app is workimg but the ads is not showing!
You just need to wait 3-5 days.
You can check this link
It simply says that your code is correct. The issue is that AdMob does
not always have an ad to return for every request. This may happen
particularly if you have just registered your AdMob publisher ID, as
it takes some time and multiple requests before the new ID starts
returning ads.
Wait for some time may be you have just created you ad id's, but if this is not the case
then try changing app package name i.e application ID
How to Change Android App Package Name?
To change Package name of an android app, go to the Project window,
right click on the app, then select Open Module Settings,
A new window will appear, select the Flavours tab in the window.
this is where we will change the app package name i.e application
id renaming it to anything just follow the syntax
Actually i couldnt understand the solution, if you change the package name in code, you should also change the app in play console because google wants all the releases might have same package name. Did you create new app in console? #Sh R S
If you are getting this error code 3, then your code is correct. The issue is that AdMob does not always have an ad to return for every request. ... Another reason your fill rate may be low is that you don't have AdSense backfill enabled, or you have filtered out some ads. Check your app settings to see if that is the case
My problem was solved by changing the package name by:
1- right click in the project
2- android tools
3- rename application package
check the manifest to make sure that the package name was changed
then :
project---> clean
Related
My application is showing very strange behavior for a tablet device, it crashes as it launches (Lollipop - 5.1.1 Tablet device, without any meaningful logs) though it runs fine on mobile devices even including Lollipop - 5.0 phone device with almost same log report
minSdkVersion 19
targetSdkVersion 28
Log report
E/com.samsung.app: [AccuTab_Magagine]>>> UIMK:1376 [0:0] time : 17:31
E/Watchdog: !#Sync 2614 [07-31 17:31:00.264]
? E/AffinityControl: AffinityControl: registerfunction enter
? E/AffinityControl: AffinityControl: registerfunction enter
E/WindowState: getStack: Window{2bd3ac2f u0 d0 com.project.debug/com.screens.account_login.AccountLoginActivity} couldn't find taskId=500 Callers=com.android.server.wm.WindowState.getDisplayContent:1059 com.android.server.wm.WindowState.isDefaultDisplay:1778 com.android.server.wm.WindowState.getMultiWindowStyleLw:2363 com.android.internal.policy.impl.multiwindow.MultiPhoneWindowManager.shouldEnableLayoutInsetsBySoftInput:1505
E/Zygote: MountEmulatedStorage()
E/Zygote: v2
E/SELinux: [DEBUG] get_category: variable seinfo: default sensitivity: NULL, cateogry: NULL
com.switchsolutions.agricultureapplication.mobilink.debug E/StudioProfiler: Studio Profilers encountered an unexpected error. Consider reporting a bug, including logcat output below.
See also: https://developer.android.com/studio/report-bugs.html#studio-bugs
Failed to capture application
E/WindowState: getStack: Window{2bd3ac2f u0 d0 com.project.debug/com.screens.account_login.AccountLoginActivity} couldn't find taskId=500 Callers=com.android.server.wm.WindowState.getDisplayContent:1059 com.android.server.wm.WindowState.isDefaultDisplay:1778 com.android.server.wm.WindowState.getMultiWindowStyleLw:2363 com.android.internal.policy.impl.multiwindow.MultiPhoneWindowManager.shouldEnableLayoutInsetsBySoftInput:1505
E/android.os.Debug: ro.product_ship = true
E/android.os.Debug: ro.debug_level = 0x4f4c
I have an android studio project where I am using a map view fragment. In my old project, it worked well and displayed a map, but in my new one, the map is just blank (grey). Even the google logo is missing on the map.
Here is my logcat error log:
2018-11-16 13:14:20.286 1627-5883/system_process I/ActivityManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=mls.client/.clientviews.MapActivity (has extras)} from uid 10020 on display 0
--------- beginning of main
2018-11-16 13:14:20.290 1372-1392/? W/audio_hw_generic: Not supplying enough data to HAL, expected position 4547748 , only wrote 4547520
2018-11-16 13:14:20.303 6528-6528/? I/art: Not late-enabling -Xcheck:jni (already on)
2018-11-16 13:14:20.303 6528-6528/? W/art: Unexpected CPU variant for X86 using defaults: x86
2018-11-16 13:14:20.310 1627-1639/system_process I/ActivityManager: Start proc 6528:mls.client/u0a83 for activity mls.client/.clientviews.MapActivity
2018-11-16 13:14:20.330 1307-1323/? D/gralloc_ranchu: gralloc_alloc: Creating ashmem region of size 1536000
2018-11-16 13:14:20.363 2148-2359/com.android.launcher3 D/EGL_emulation: eglMakeCurrent: 0x9fae0980: ver 3 0 (tinfo 0xa0d57ee0)
2018-11-16 13:14:20.500 6528-6528/mls.client W/System: ClassLoader referenced unknown path: /data/app/mls.client-1/lib/x86
2018-11-16 13:14:20.532 6528-6528/mls.client I/InstantRun: starting instant run server: is main process
2018-11-16 13:14:20.540 6528-6544/mls.client I/GMPM: App measurement is starting up
2018-11-16 13:14:20.545 6528-6544/mls.client E/GMPM: getGoogleAppId failed with status: 10
2018-11-16 13:14:20.546 6528-6544/mls.client E/GMPM: Uploading is not possible. App measurement disabled
2018-11-16 13:14:20.609 6528-6528/mls.client I/zzy: Making Creator dynamically
2018-11-16 13:14:20.614 6528-6528/mls.client W/System: ClassLoader referenced unknown path: /system/priv-app/PrebuiltGmsCore/lib/x86
2018-11-16 13:14:20.621 6528-6528/mls.client W/System: ClassLoader referenced unknown path:
2018-11-16 13:14:20.621 6528-6528/mls.client W/System: ClassLoader referenced unknown path: /system/priv-app/PrebuiltGmsCore/lib/x86
2018-11-16 13:14:20.664 6528-6528/mls.client I/Google Maps Android API: Google Play services client version: 8298000
2018-11-16 13:14:20.667 6528-6528/mls.client I/Google Maps Android API: Google Play services package version: 12874026
2018-11-16 13:14:20.706 6528-6528/mls.client E/art: The String#value field is not present on Android versions >= 6.0
2018-11-16 13:14:20.832 6528-6557/mls.client D/NetworkSecurityConfig: No Network Security Config specified, using platform default
2018-11-16 13:14:20.899 1627-1741/system_process I/ActivityManager: START u0 {act=android.content.pm.action.REQUEST_PERMISSIONS pkg=com.google.android.packageinstaller cmp=com.google.android.packageinstaller/com.android.packageinstaller.permission.ui.GrantPermissionsActivity (has extras)} from uid 10083 on display 0
2018-11-16 13:14:20.910 1307-1355/? E/SurfaceFlinger: ro.sf.lcd_density must be defined as a build property
2018-11-16 13:14:20.982 6528-6584/mls.client I/OpenGLRenderer: Initialized EGL, version 1.4
2018-11-16 13:14:20.982 6528-6584/mls.client D/OpenGLRenderer: Swap behavior 1
2018-11-16 13:14:20.982 6528-6584/mls.client W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
2018-11-16 13:14:20.982 6528-6584/mls.client D/OpenGLRenderer: Swap behavior 0
2018-11-16 13:14:20.986 6528-6584/mls.client D/EGL_emulation: eglCreateContext: 0xa3586320: maj 3 min 0 rcv 3
2018-11-16 13:14:20.989 6528-6584/mls.client D/EGL_emulation: eglMakeCurrent: 0xa3586320: ver 3 0 (tinfo 0xa3583ae0)
2018-11-16 13:14:20.990 6528-6584/mls.client E/eglCodecCommon: glUtilsParamSize: unknow param 0x00008cdf
2018-11-16 13:14:20.991 6528-6584/mls.client E/eglCodecCommon: glUtilsParamSize: unknow param 0x00008824
2018-11-16 13:14:21.015 6528-6528/mls.client W/art: Before Android 4.1, method int android.support.v7.internal.widget.ListViewCompat.lookForSelectablePosition(int, boolean) would have incorrectly overridden the package-private method in android.widget.ListView
2018-11-16 13:14:21.024 6528-6584/mls.client D/EGL_emulation: eglMakeCurrent: 0xa3586320: ver 3 0 (tinfo 0xa3583ae0)
2018-11-16 13:14:21.099 1627-1813/system_process I/WindowManager: Destroying surface Surface(name=com.android.launcher3/com.android.launcher3.Launcher) called by com.android.server.wm.WindowStateAnimator.destroySurface:2016 com.android.server.wm.WindowStateAnimator.destroySurfaceLocked:882 com.android.server.wm.WindowState.destroyOrSaveSurface:2100 com.android.server.wm.AppWindowToken.destroySurfaces:363 com.android.server.wm.AppWindowToken.notifyAppStopped:389 com.android.server.wm.WindowManagerService.notifyAppStopped:4463 com.android.server.am.ActivityStack.activityStoppedLocked:1252 com.android.server.am.ActivityManagerService.activityStopped:6903
2018-11-16 13:14:21.109 1627-5883/system_process I/GnssLocationProvider: WakeLock acquired by sendMessage(3, 0, com.android.server.location.GnssLocationProvider$GpsRequest#88ac655)
2018-11-16 13:14:21.109 1627-1640/system_process I/GnssLocationProvider: WakeLock released by handleMessage(3, 0, com.android.server.location.GnssLocationProvider$GpsRequest#88ac655)
2018-11-16 13:14:21.111 1715-1906/com.android.systemui D/EGL_emulation: eglMakeCurrent: 0xa3585780: ver 3 0 (tinfo 0xa3583730)
2018-11-16 13:14:21.297 1627-1648/system_process I/WindowManager: Destroying surface Surface(name=Starting mls.client) called by com.android.server.wm.WindowStateAnimator.destroySurface:2016 com.android.server.wm.WindowStateAnimator.destroySurfaceLocked:882 com.android.server.wm.WindowState.destroyOrSaveSurface:2100 com.android.server.wm.AppWindowToken.destroySurfaces:363 com.android.server.wm.WindowStateAnimator.finishExit:565 com.android.server.wm.WindowStateAnimator.stepAnimationLocked:491 com.android.server.wm.WindowAnimator.updateWindowsLocked:303 com.android.server.wm.WindowAnimator.animateLocked:704
2018-11-16 13:14:22.871 6528-6581/mls.client W/DynamiteModule: Local module descriptor class for com.google.android.gms.googlecertificates not found.
2018-11-16 13:14:22.871 6528-6581/mls.client W/DynamiteModule: Failed to load module via V2: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.dynamite.DynamiteModule$DynamiteLoaderClassLoader" on path: DexPathList[[zip file "/data/app/mls.client-1/base.apk", zip file "/data/app/mls.client-1/split_lib_dependencies_apk.apk", zip file "/data/app/mls.client-1/split_lib_slice_0_apk.apk", zip file "/data/app/mls.client-1/split_lib_slice_1_apk.apk", zip file "/data/app/mls.client-1/split_lib_slice_2_apk.apk", zip file "/data/app/mls.client-1/split_lib_slice_3_apk.apk", zip file "/data/app/mls.client-1/split_lib_slice_4_apk.apk", zip file "/data/app/mls.client-1/split_lib_slice_5_apk.apk", zip file "/data/app/mls.client-1/split_lib_slice_6_apk.apk", zip file "/data/app/mls.client-1/split_lib_slice_7_apk.apk", zip file "/data/app/mls.client-1/split_lib_slice_8_apk.apk", zip file "/data/app/mls.client-1/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/data/app/mls.client-1/lib/x86, /system/lib, /vendor/lib]]
2018-11-16 13:14:22.875 6528-6581/mls.client I/DynamiteModule: Considering local module com.google.android.gms.googlecertificates:0 and remote module com.google.android.gms.googlecertificates:4
2018-11-16 13:14:22.875 6528-6581/mls.client I/DynamiteModule: Selected remote version of com.google.android.gms.googlecertificates, version >= 4
2018-11-16 13:14:23.516 1372-1393/? W/audio_hw_generic: Not supplying enough data to HAL, expected position 4855373 , only wrote 4702320
Any idea what is going wrong with my MapView?
if you need more info or code, please write me.
Thanks.
You need to check if the Google Maps Android API is enabled in your Developer's Console. If it is, check if you put the Android API Key in the google_maps_api.xml
go to https://console.cloud.google.com/apis/credentials
update Application restrictions with used domains and API restrictions with used API.
the changes takes more than 5 mins to reflect
So a buddy of mine is helping me test my app out. However, after he gets the allow or deny screen, it doesn't let him to actually sign into the app even though we are getting an access code. The following errors show up in the run dialog when I ran the app on his Samsung Galaxy S6 Edge:
09/30 20:25:23: Launching MainActivity
$ adb push C:\Users\James Singleton\AndroidStudioProjects\ChffrAPI\app\build\outputs\apk\app-debug.apk /data/local/tmp/com.example.jamessingleton.chffrapi
$ adb shell pm install -r "/data/local/tmp/com.example.jamessingleton.chffrapi"
pkg: /data/local/tmp/com.example.jamessingleton.chffrapi
Success
$ adb shell am start -n "com.example.jamessingleton.chffrapi/com.example.jamessingleton.chffrapi.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Connected to process 1082 on device samsung-sm_g925t-1115fb9dddda2805
E/Zygote: v2
I/SELinux: Function: selinux_compare_spd_ram, index[1], SPD-policy is existed. and_ver=SEPF_SECMOBILE_6.0.1 ver=11
W/SELinux: Function: selinux_compare_spd_ram, index[1], priority [2], priority version is VE=SEPF_SECMOBILE_6.0.1_0013
E/Zygote: accessInfo : 0
I/libpersona: KNOX_SDCARD checking this for 10248
I/libpersona: KNOX_SDCARD not a persona
W/SELinux: SELinux: seapp_context_lookup: seinfo=default, level=s0:c512,c768, pkgname=com.example.jamessingleton.chffrapi
I/art: Late-enabling -Xcheck:jni
D/TimaKeyStoreProvider: TimaSignature is unavailable
D/ActivityThread: Added TimaKeyStore provider
I/InjectionManager: Inside getClassLibPath + mLibMap{0=, 1=}
W/ResourcesManager: getTopLevelResources: /data/app/com.example.jamessingleton.chffrapi-1/base.apk / 1.0 running in com.example.jamessingleton.chffrapi rsrc of package com.example.jamessingleton.chffrapi
D/ResourcesManager: For user 0 new overlays fetched Null
I/InjectionManager: Inside getClassLibPath caller
W/System: ClassLoader referenced unknown path: /data/app/com.example.jamessingleton.chffrapi-1/lib/arm64
I/FirebaseInitProvider: FirebaseApp initialization unsuccessful
D/InjectionManager: InjectionManager
D/InjectionManager: fillFeatureStoreMap com.example.jamessingleton.chffrapi
I/InjectionManager: Constructor com.example.jamessingleton.chffrapi, Feature store :{}
I/InjectionManager: featureStore :{}
W/ResourcesManager: getTopLevelResources: /data/app/com.example.jamessingleton.chffrapi-1/base.apk / 1.0 running in com.example.jamessingleton.chffrapi rsrc of package com.example.jamessingleton.chffrapi
W/ResourcesManager: getTopLevelResources: /data/app/com.example.jamessingleton.chffrapi-1/base.apk / 1.0 running in com.example.jamessingleton.chffrapi rsrc of package com.example.jamessingleton.chffrapi
W/art: Before Android 4.1, method android.graphics.PorterDuffColorFilter android.support.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable
W/ResourcesManager: getTopLevelResources: /data/app/com.google.android.gms-2/base.apk / 1.0 running in com.example.jamessingleton.chffrapi rsrc of package com.google.android.gms
D/ResourcesManager: For user 0 new overlays fetched Null
I/InjectionManager: Inside getClassLibPath caller
W/ResourcesManager: getTopLevelResources: /data/app/com.google.android.gms-2/base.apk / 1.0 running in com.example.jamessingleton.chffrapi rsrc of package com.google.android.gms
D/ResourcesManager: For user 0 new overlays fetched Null
I/InjectionManager: Inside getClassLibPath caller
W/System: ClassLoader referenced unknown path: /data/user/0/com.google.android.gms/app_chimera/m/0000000a/n/arm64-v8a
W/nAnnotationIntrospector: Unable to load JDK7 annotation types; will have to skip
I/System.out: Connection Preference: wifi
D/Activity: performCreate Call Injection manager
I/InjectionManager: dispatchOnViewCreated > Target : com.example.jamessingleton.chffrapi.MainActivity isFragment :false
D/SecWifiDisplayUtil: Metadata value : SecSettings2
D/ViewRootImpl: #1 mView = com.android.internal.policy.PhoneWindow$DecorView{b22bf4b I.E...... R.....ID 0,0-0,0}
D/OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true
D/libEGL: loaded /vendor/lib64/egl/libGLES_mali.so
D/libEGL: eglInitialize EGLDisplay = 0x7fa3b3f178
I/OpenGLRenderer: Initialized EGL, version 1.4
[ 09-30 20:25:36.141 1082: 1182 D/ ]
ro.exynos.dss isEnabled: 0
D/mali_winsys: new_window_surface returns 0x3000, [1440x2560]-format:1
I/InjectionManager: dispatchCreateOptionsMenu :com.example.jamessingleton.chffrapi.MainActivity
I/InjectionManager: dispatchPrepareOptionsMenu :com.example.jamessingleton.chffrapi.MainActivity
D/libGLESv1: DTS_GLAPI : DTS is not allowed for Package : com.example.jamessingleton.chffrapi
D/ViewRootImpl: MSG_RESIZED_REPORT: ci=Rect(0, 96 - 0, 0) vi=Rect(0, 96 - 0, 0) or=1
I/System.out: com.example.jamessingleton.chffrapi.AuthPreferences#2af7be6
E/AuthApp: ya29.Ci9vAy3YMsGUZcVJ28kRIh5lMQMYhbSUSelWfYABrGmSWkKXKgUhRC_A4KJJcnJtBQ
I/Timeline: Timeline: Activity_idle id: android.os.BinderProxy#6065402 time:27457508
D/ViewRootImpl: ViewPostImeInputStage processPointer 0
D/ViewRootImpl: ViewPostImeInputStage processPointer 1
V/ActivityThread: updateVisibility : ActivityRecord{23821be token=android.os.BinderProxy#6065402 {com.example.jamessingleton.chffrapi/com.example.jamessingleton.chffrapi.MainActivity}} show : true
I/Timeline: Timeline: Activity_idle id: android.os.BinderProxy#6065402 time:27522831
D/ViewRootImpl: ViewPostImeInputStage processPointer 0
D/ViewRootImpl: ViewPostImeInputStage processPointer 1
V/ActivityThread: updateVisibility : ActivityRecord{23821be token=android.os.BinderProxy#6065402 {com.example.jamessingleton.chffrapi/com.example.jamessingleton.chffrapi.MainActivity}} show : true
I am not sure what any of this means. If I take the access token that is given I can use oAuth 2.0 playground and proceed like normal.
So the user was not connected to his preferred connection. His preferred connection was I/System.out: Connection Preference: wifi and he was connected to 4G. I added the following to check for it:
else {
Toast.makeText(getApplicationContext(), "You are not connected to your preferred connection." + "\n" +
"Please connect to your preferred connection to continue."
, Toast.LENGTH_LONG).show();
}
I have an Xperia Z3C, Android 5.1.1 and I'm trying to connect it to a Nexus 4 Android 6.0.1 via Bluetooth. Pairing them is OK, but when I try to connect them, it says 'Connected' for less than a second and automatically disconnects.
Is this a known issue? I haven't found anything about this.
Here's what logcat says:
03-14 17:25:55.308: E/bt-btif(14245): bte_scan_filt_param_cfg_evt, 1
03-14 17:25:55.308: E/bt-btif(14245): bte_scan_filt_param_cfg_evt, 1
03-14 17:25:55.990: E/bt-btm(14245): new address: xx:xx:xx:xx:xx:xx
03-14 17:25:55.990: E/bt-btm(14245): new address: xx:xx:xx:xx:xx:xx
03-14 17:25:56.712: E/bt-btm(14245): new address: xx:xx:xx:xx:xx:xx
03-14 17:25:57.464: E/bt-btif(14245): bte_scan_filt_param_cfg_evt, 1
03-14 17:25:57.814: E/bt-btm(14245): Ignoring RNR as the state is not BTM_SEC_STATE_GETTING_NAME
03-14 17:25:57.933: E/NetlinkEvent(318): Unknown ifindex 41 in RTM_DELADDR
03-14 17:25:57.963: E/dhcpcd(15974): bt-pan: interface not found or invalid
03-14 17:25:57.986: E/BluetoothPanServiceJni(14245): ## ERROR : disconnectPanNative(L224): Failed disconnect pan channel, status: 1##
03-14 17:25:58.139: E/BluetoothTetheringNetworkFactory(14245): DHCP request error:DHCP result was failed
03-14 17:26:01.382: E/bt-btm(14245): btm_sec_disconnected - Clearing Pending flag
I had the same problem while trying to scan for Bluetooth devices from my Android application. The interesting thing is that it does not throw any exception (caught or uncaught) and fails silently! The problem occurs for devices with API Level >= 23 (Android 6.0). Here is an extract of my Logcat logs :
03-30 14:07:52.099 192-211/? I/BufferQueueProducer: [org.manios.testbt/org.manios.testbt.printing.BluetoothPrinterDiscovery](this:0x7fa16de400,id:1467,api:1,p:26262,c:192) queueBuffer: fps=0.19 dur=5154.29 max=5154.29 min=5154.29
03-30 14:07:52.114 192-192/? I/SurfaceFlinger: [Built-in Screen (type:0)] fps:1.091767,dur:1831.89,max:999.66,min:832.23
03-30 14:07:52.137 774-1001/? D/InputReader: AP_PROF:AppLaunch_dispatchPtr:Up:89556864, ID:0, Index:2056797440
03-30 14:07:52.137 774-1001/? I/PerfService: PerfServiceNative_boostEnableTimeoutMsAsync:3, 100
03-30 14:07:52.138 26262-26262/org.manios.testbt D/SettingsInterface: from settings cache , name = sound_effects_enabled , value = 0
03-30 14:07:52.138 26262-26262/org.manios.testbt D/BluetoothAdapter: isEnabled
03-30 14:07:52.140 26262-26262/org.manios.testbt D/BluetoothAdapter: getName
03-30 14:07:52.141 774-1636/? D/BluetoothManagerService: checkIfCallerIsForegroundUser: valid=true callingUser=0 parentUser=-10000 foregroundUser=0
03-30 14:07:52.142 21807-21818/? D/BluetoothAdapterProperties: getName: mName = Lenovo TAB3 8
03-30 14:07:52.144 26262-666/org.manios.testbt D/BluetoothAdapter: isEnabled
03-30 14:07:52.146 26262-666/org.manios.testbt D/BluetoothAdapter: isDiscovering
03-30 14:07:52.148 26262-666/org.manios.testbt D/BluetoothAdapter: 109507751: getState(). Returning 12
03-30 14:07:52.152 21807-21817/? D/BluetoothAdapterProperties: isDiscovering: mDiscovering = false
03-30 14:07:52.156 26262-666/org.manios.testbt D/BluetoothAdapter: startDiscovery
03-30 14:07:52.158 26262-666/org.manios.testbt D/BluetoothAdapter: 109507751: getState(). Returning 12
03-30 14:07:52.160 21807-21830/? W/bt_btif: bta_dm_check_av:0
03-30 14:07:52.172 21807-21830/? E/bt_btif: bte_scan_filt_param_cfg_evt, 1
03-30 14:07:52.181 21807-21823/? I/BluetoothAdapterProperties: Callback:discoveryStateChangeCallback with state:1
03-30 14:07:52.182 774-2924/? V/ActivityManager: Broadcast: Intent { act=android.bluetooth.adapter.action.DISCOVERY_STARTED flg=0x10 } ordered=false userid=0 callerApp=ProcessRecord{c376192 21807:com.android.bluetooth/1002}
03-30 14:07:52.184 1057-1265/? V/BluetoothEventManager: Received android.bluetooth.adapter.action.DISCOVERY_STARTED
03-30 14:07:52.185 1057-1265/? D/BluetoothEventManager: scanning state change to true
03-30 14:07:52.186 21983-21983/? D/ActivityThread: BDC-Calling onReceive: intent=Intent { act=android.bluetooth.adapter.action.DISCOVERY_STARTED flg=0x10 cmp=com.android.settings/.bluetooth.BluetoothDiscoveryReceiver }, receiver=com.android.settings.bluetooth.BluetoothDiscoveryReceiver#b02fe63
03-30 14:07:52.186 21983-21983/? V/BluetoothDiscoveryReceiver: Received: android.bluetooth.adapter.action.DISCOVERY_STARTED
03-30 14:07:52.187 21983-21983/? D/ActivityThread: BDC-RECEIVER handled : 0 / ReceiverData{intent=Intent { act=android.bluetooth.adapter.action.DISCOVERY_STARTED flg=0x10 cmp=com.android.settings/.bluetooth.BluetoothDiscoveryReceiver } packageName=com.android.settings resultCode=-1 resultData=null resultExtras=null}
03-30 14:07:52.218 774-1001/? D/InputReader: AP_PROF:AppLaunch_dispatchPtr:Down:89556946, ID:0, Index:2056794048
03-30 14:07:52.219 774-1001/? I/PerfService: PerfServiceNative_boostEnableAsync:3
I found after some searching using this issue, that in API Level >= 23 (Android 6.0) we have to add the following permission to AndroidManifext.xml
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
so that scanning and other Bluetooth actions function properly.
In Android documentation it states in BluetoothAdapter.startDiscovery() that it requires BLUETOOTH_ADMIN permission with no further details. But if we take a look into BluetoothLeScanner.startScan(),it states clearly that:
Requires BLUETOOTH_ADMIN permission. An app must hold ACCESS_COARSE_LOCATION or ACCESS_FINE_LOCATION permission in order to get results.
Hope this helps!
So two things can be going on here. Either the second device that you are trying to maintain a connection with is having an issue maintaining a connection or there is an interference being caused between the two just long enough to break the connection but not long enough to terminate it completely.
I'm going to get data with Restlet of this official OData page:
http://services.odata.org/OData/OData.svc/
I've started this tutorial:
http://weblogs.asp.net/uruit/archive/2011/09/13/accessing-odata-from-android-using-restlet.aspx
My problem is, that at the end, he can't get the metadata. But first:
When I'm trying to generate the Restleg-Files (Point 5), the console is showing this, where the lines with are date are red:
---------------------------
OData client code generator
---------------------------
step 1 - check parameters
step 2 - check the ouput directory
step 3 - get the metadata descriptor
Nov 28, 2011 3:12:46 PM org.restlet.engine.http.connector.HttpClientHelper start
Information: Starting the default HTTP client
Nov 28, 2011 3:12:48 PM org.restlet.ext.odata.Service getMetadata
Information: Get the metadata for http://services.odata.org/OData/OData.svc/ at http://services.odata.org/OData/OData.svc/$metadata
Nov 28, 2011 3:12:48 PM org.restlet.engine.http.connector.HttpClientHelper start
Information: Starting the default HTTP client
step 4 - generate source code
Nov 28, 2011 3:12:48 PM org.restlet.engine.http.connector.HttpClientHelper start
Information: Starting the default HTTP client
Nov 28, 2011 3:12:49 PM org.restlet.ext.odata.Service getMetadata
Information: Get the metadata for http://services.odata.org/OData/OData.svc/ at http://services.odata.org/OData/OData.svc/$metadata
Nov 28, 2011 3:12:49 PM org.restlet.engine.http.connector.HttpClientHelper start
Information: Starting the default HTTP client
Nov 28, 2011 3:12:49 PM org.restlet.engine.http.connector.HttpClientHelper stop
Information: Stopping the default HTTP client
Nov 28, 2011 3:12:50 PM org.restlet.engine.http.connector.HttpClientHelper stop
Information: Stopping the default HTTP client
The source code has been generated in directory: C:\Projects\MyProjects\Android App\main\app\Java\Workspace\TestOData2\src
So the files are generated, but when I'm going forward in the tutorial, copy the class into my Android project, import libraries and write the following code, then I get the error below.
public ArrayList<Product> getOdataSampleProduct(String zip) {
ODataDemoService proxy = new OdataDemoService();
try {
Query<Product> query = proxy.createProductQuery("Products(1)");
Product product = query.iterator().next(); //breaks here
Log.d("Test","id: "+product.getId()); //isn't logged
}
catch(Exception e) {
//is catched before query.iterator().next()
};
So, LogCat shows this error (line 3 is red):
...
11-29 09:01:01.039: INFO/org.restlet(700): Starting the default HTTP client
11-29 09:01:01.329: INFO/org.restlet(700): A recoverable error was detected (1001), attempting again in 2000 ms.
11-29 09:01:05.589: ERROR/org.restlet(700): Can't get the metadata for http://services.odata.org/OData/OData.svc/ (response's status: Communication Error (1001) - services.odata.org)
11-29 09:01:05.629: INFO/org.restlet(700): Get the metadata for http://services.odata.org/OData/OData.svc/ at http://services.odata.org/OData/OData.svc/$metadata
11-29 09:01:06.200: INFO/org.restlet(700): Starting the default HTTP client
11-29 09:01:06.329: INFO/org.restlet(700): A recoverable error was detected (1001), attempting again in 2000 ms.
11-29 09:01:06.359: DEBUG/dalvikvm(408): GC_EXPLICIT freed 3K, 5% free 6308K/6595K, paused 3ms+2ms
11-29 09:01:08.409: INFO/org.restlet(700): A recoverable error was detected (1001), attempting again in 2000 ms.
11-29 09:01:10.499: ERROR/org.restlet(700): Can't get the metadata for http://services.odata.org/OData/OData.svc/ (response's status: Communication Error (1001) - services.odata.org)
11-29 09:01:10.579: WARN/org.restlet(700): Can't parse the content of http://services.odata.org/OData/OData.svc/Products(1)
11-29 09:01:10.579: WARN/org.restlet(700): java.lang.Exception: Can't execute the query without the service's metadata.
11-29 09:01:10.579: WARN/org.restlet(700): at org.restlet.ext.odata.Query.execute(Query.java:347)
11-29 09:01:10.579: WARN/org.restlet(700): at org.restlet.ext.odata.Query.iterator(Query.java:642)
11-29 09:01:10.579: WARN/org.restlet(700): at my.folder.testApp.MapView.getData(MapView.java:77)
11-29 09:01:10.579: WARN/org.restlet(700): at my.folder.testApp.MapView.onCreate(MapView.java:141)
11-29 09:01:10.579: WARN/org.restlet(700): at android.app.Activity.performCreate(Activity.java:4397)
11-29 09:01:10.579: WARN/org.restlet(700): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1048)
11-29 09:01:10.579: WARN/org.restlet(700): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1779)
11-29 09:01:10.579: WARN/org.restlet(700): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1831)
11-29 09:01:10.579: WARN/org.restlet(700): at android.app.ActivityThread.access$500(ActivityThread.java:122)
11-29 09:01:10.579: WARN/org.restlet(700): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1024)
11-29 09:01:10.579: WARN/org.restlet(700): at android.os.Handler.dispatchMessage(Handler.java:99)
11-29 09:01:10.579: WARN/org.restlet(700): at android.os.Looper.loop(Looper.java:132)
11-29 09:01:10.579: WARN/org.restlet(700): at android.app.ActivityThread.main(ActivityThread.java:4123)
11-29 09:01:10.579: WARN/org.restlet(700): at java.lang.reflect.Method.invokeNative(Native Method)
11-29 09:01:10.579: WARN/org.restlet(700): at java.lang.reflect.Method.invoke(Method.java:491)
11-29 09:01:10.579: WARN/org.restlet(700): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:841)
11-29 09:01:10.579: WARN/org.restlet(700): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:599)
11-29 09:01:10.579: WARN/org.restlet(700): at dalvik.system.NativeStart.main(Native Method)
It seems that there is a problem with the metadata, but I can't figure out what.
Any idea?
Could you try registering the Restlet extension for Apache HTTP Client instead of the default internal connector?
See this page for details:
http://wiki.restlet.org/docs_2.1/13-restlet/275-restlet/266-restlet.html
At least, I've found a solution:
I had to put the query into an AsyncTask.
Before, in the UI thread, the query didn't have time to get an answer.
So I put it into the doInBackground.