I am doing Login with facebook in react native using the Authorization code grant type. Using the module React Native App Auth. When I click on Login with facebook it is opening a browser in my app and showing me the facebook login module after I logged in successfully I have placed code to redirect to app. But my app is closing on auto-redirection and if I try in normal chrome browser the app is opening fin with the same link. Will there be any difference for normal browser and browser opening in the app?
Android Logcat :
4-10 16:10:12.758 11363-11363/com.<app-name> D/ViewRootImpl#96cdd71[AuthorizationManagementActivity]: MSG_RESIZED_REPORT: ci=Rect(0, 96 - 0, 0) vi=Rect(0, 96 - 0, 0) or=1
04-10 16:10:12.942 11363-11363/com.<app-name> D/InputTransport: Input channel destroyed: fd=73
04-10 16:10:12.952 11363-11363/com.<app-name> D/ViewRootImpl#3b953f4[MainActivity]: mHardwareRenderer.destroy()#1
04-10 16:10:12.964 11363-11363/com.<app-name> D/ViewRootImpl#3b953f4[MainActivity]: Relayout returned: oldFrame=[0,0][1440,2560] newFrame=[0,0][1440,2560] result=0x5 surface={isValid=false 0} surfaceGenerationChanged=true
04-10 16:10:12.980 11363-11363/com.<app-name> D/ViewRootImpl#96cdd71[AuthorizationManagementActivity]: mHardwareRenderer.destroy()#1
04-10 16:10:12.989 11363-11363/com.<app-name> D/ViewRootImpl#96cdd71[AuthorizationManagementActivity]: Relayout returned: oldFrame=[0,0][1440,2560] newFrame=[0,0][1440,2560] result=0x5 surface={isValid=false 0} surfaceGenerationChanged=true
04-10 16:10:14.765 11363-11363/com.<app-name> D/ViewRootImpl#96cdd71[AuthorizationManagementActivity]: mHardwareRenderer.destroy()#4
dispatchDetachedFromWindow
04-10 16:10:14.767 11363-11363/com.<app-name> D/InputTransport: Input channel destroyed: fd=56
04-10 16:10:14.778 11363-11363/com.<app-name> D/ReactNative: ReactInstanceManager.detachViewFromInstance()
04-10 16:10:14.785 11363-11363/com.<app-name> D/ViewRootImpl#3b953f4[MainActivity]: mHardwareRenderer.destroy()#4
dispatchDetachedFromWindow
04-10 16:10:14.790 11363-11363/com.<app-name> D/InputTransport: Input channel destroyed: fd=52
Android Manifest:
<intent-filter android:label="#string/app_name">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<!-- Accepts URIs that begin with "example://gizmos” -->
<data android:scheme="app"
android:host="<app-name>"
android:pathPrefix="/oauth"
/>
</intent-filter>
Am i missing any setting in manifest file?
03-02 21:03:03.087 6253-6253/ D/FirebaseApp: com.google.firebase.auth.FirebaseAuth is not linked. Skipping initialization.
03-02 21:03:03.093 6253-6253/ D/FirebaseApp: com.google.firebase.crash.FirebaseCrash is not linked. Skipping initialization.
03-02 21:03:03.099 6253-6253/ I/FA: App measurement is starting up, version: 9256
03-02 21:03:03.099 6253-6253/ I/FA: To enable debug logging run: adb shell setprop log.tag.FA VERBOSE
03-02 21:03:03.120 6253-6253/ I/FA: Collection disabled with firebase_analytics_collection_enabled=0
03-02 21:03:03.129 6253-6253/ I/FirebaseInitProvider: FirebaseApp initialization successful
<receiver
android:name="com.google.android.gms.measurement.AppMeasurementReceiver"
android:enabled="true"
android:exported="false" />
<service
android:name="com.google.android.gms.measurement.AppMeasurementService"
android:enabled="true"
android:exported="false" />
<!--Task exception on worker thread: java.lang.IllegalStateException: FirebaseApp with name [DEFAULT] doesn't exist-->
<provider
android:name="com.google.firebase.provider.FirebaseInitProvider"
android:authorities="com.mi.android.globalpersonalassistant.firebaseinitprovider"
android:exported="false"
android:initOrder="100" />
<!--end-->
In my Application, not init it! why FirebaseApp is atuo-start! Can it disable it not start.
Firebase initializes automatically when integrated using the documented steps because it brings in a ContentProvider which is initialized automatically by Android when the app launches. The JavaDoc for FirebaseApp talks a little bit about this.
This blog goes into even more detail.
04-03 02:12:01.880 16450-16450/? E/SettingsReceiverActivity: PREF_DONT_ASK_AGAIN : true
04-03 02:12:13.832 17268-17268/? E/memtrack: Couldn't load memtrack module (No such file or directory)
04-03 02:12:13.832 17268-17268/? E/android.os.Debug: failed to load memtrack module: -2
04-03 02:12:14.232 591-708/? E/PackageManager: parse pkg : /data/app/vmdl388123438.tmp
04-03 02:12:14.232 591-17303/? E/PackageManager: dexopt start
04-03 02:12:15.864 591-17303/? E/PackageManager: dexopt end
04-03 02:12:19.097 4478-4478/? E/SamsungIME: mOCRHelper is null
04-03 02:12:19.107 4478-4478/? E/SamsungIME: mOCRHelper is null
04-03 02:12:20.819 157-397/? E/cutils: Failed to mkdirat(/storage/extSdCard/Android): Read-only file system
04-03 02:12:20.949 157-397/? E/cutils: Failed to mkdirat(/storage/extSdCard/Android): Read-only file system
04-03 02:12:21.049 157-397/? E/cutils: Failed to mkdirat(/storage/extSdCard/Android): Read-only file system
04-03 02:12:21.339 591-601/? A/ActivityManager: Service ServiceRecord{431b3d48 u0 com.google.android.apps.maps/com.google.android.apps.gmm.prefetch.PrefetcherService} in process ProcessRecord{43123078 16783:com.google.android.apps.maps/u0a60} not same as in map: null
04-03 02:12:21.659 17369-17369/? E/memtrack: Couldn't load memtrack module (No such file or directory)
04-03 02:12:21.659 17369-17369/? E/android.os.Debug: failed to load memtrack module: -2
04-03 02:12:22.620 4478-4478/? E/SamsungIME: isHWKeyboardConnected() = false --> false
04-03 02:12:22.811 591-591/? E/Tethering: No numeric data
04-03 02:12:23.341 17435-17435/? E/dalvikvm: Could not find class 'android.app.Notification$Action$Builder', referenced from method b.a
04-03 02:12:23.411 17435-17435/? E/dalvikvm: Could not find class 'android.graphics.drawable.RippleDrawable', referenced from method b.a
04-03 02:12:23.521 17435-17435/? E/dalvikvm: Could not find class 'android.app.Notification$Action$Builder', referenced from method b.a
04-03 02:12:23.571 17435-17435/? E/dalvikvm: Could not find class 'bg', referenced from method b.a
04-03 02:12:23.571 17435-17435/? E/dalvikvm: Could not find class 'bi', referenced from method b.a
04-03 02:12:23.601 17435-17435/? E/dalvikvm: Could not find class 'android.app.RemoteInput[]', referenced from method b.a
04-03 02:12:25.283 976-976/? E/NetworkScheduler.SchedulerReceiver: Invalid parameter app
04-03 02:12:25.283 976-976/? E/NetworkScheduler.SchedulerReceiver: Invalid package name : Perhaps you didn't include a PendingIntent in the extras?
04-03 02:12:28.806 17563-17621/? E/fb4a(:dash):AppStateReporter: Error acquiring lock: /data/data/com.facebook.katana/app_state_logs/55aad98f-9bd2-46e5-90eb-55f53313613f.txt
java.io.IOException: fcntl failed: EAGAIN (Try again)
at java.nio.FileChannelImpl.basicLock(FileChannelImpl.java:123)
at java.nio.FileChannelImpl.tryLock(FileChannelImpl.java:177)
at java.nio.channels.FileChannel.tryLock(FileChannel.java:587)
at com.facebook.analytics.reporters.AppStateReporter.a(AppStateReporter.java:141)
at com.facebook.analytics.reporters.AppStateReporter.c(AppStateReporter.java:94)
at com.facebook.analytics.reporters.AppStateReporter.a(AppStateReporter.java:55)
at com.facebook.common.noncriticalinit.NonCriticalInitializer.a(NonCriticalInitializer.java:103)
at com.facebook.common.noncriticalinit.NonCriticalInitializer$2.run(NonCriticalInitializer.java:116)
at com.facebook.common.appchoreographer.DefaultAppChoreographer$5.run(DefaultAppChoreographer.java:384)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:422)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:422)
at com.facebook.common.executors.WrappingExecutorService$1.run(WrappingExecutorService.java:77)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:422)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at com.facebook.common.executors.DefaultConstrainedListeningExecutorService$Worker.run(DefaultConstrainedListeningExecutorService.java:327)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at com.facebook.common.executors.NamedThreadFactory$1.run(NamedThreadFactory.java:42)
at java.lang.Thread.run(Thread.java:841)
Caused by: libcore.io.ErrnoException: fcntl failed: EAGAIN (Try again)
at libcore.io.Posix.fcntlFlock(Native Method)
at libcore.io.ForwardingOs.fcntlFlock(ForwardingOs.java:54)
at java.nio.FileChannelImpl.basicLock(FileChannelImpl.java:121)
at java.nio.FileChannelImpl.tryLock(FileChannelImpl.java:177)
at java.nio.channels.FileChannel.tryLock(FileChannel.java:587)
at com.facebook.analytics.reporters.AppStateReporter.a(AppStateReporter.java:141)
at com.facebook.analytics.reporters.AppStateReporter.c(AppStateReporter.java:94)
at com.facebook.analytics.reporters.AppStateReporter.a(AppStateReporter.java:55)
at com.facebook.common.noncriticalinit.NonCriticalInitializer.a(NonCriticalInitializer.java:103)
at com.facebook.common.noncriticalinit.NonCriticalInitializer$2.run(NonCriticalInitializer.java:116)
at com.facebook.common.appchoreographer.DefaultAppChoreographer$5.run(DefaultAppChoreographer.java:384)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:422)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:422)
at com.facebook.common.executors.WrappingExecutorService$1.run(WrappingExecutorService.java:77)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:422)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at com.facebook.common.executors.DefaultConstrainedListeningExecutorService$Worker.run(DefaultConstrainedListeningExecutorService.java:327)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at com.facebook.common.executors.NamedThreadFactory$1.run(NamedThreadFactory.java:42)
at java.lang.Thread.run(Thread.java:841)
04-03 02:12:29.057 157-397/? E/cutils: Failed to mkdirat(/storage/extSdCard/Android): Read-only file system
04-03 02:12:29.067 157-397/? E/cutils: Failed to mkdirat(/storage/extSdCard/Android): Read-only file system
04-03 02:12:31.329 591-856/? E/Watchdog: !#Sync 3567
04-03 02:12:34.502 157-397/? E/cutils: Failed to mkdirat(/storage/extSdCard/Android): Read-only file system
04-03 02:12:34.522 157-397/? E/cutils: Failed to mkdirat(/storage/extSdCard/Android): Read-only file system
04-03 02:12:34.532 157-397/? E/cutils: Failed to mkdirat(/storage/extSdCard/Android): Read-only file system
04-03 02:12:34.532 157-397/? E/cutils: Failed to mkdirat(/storage/extSdCard/Android): Read-only file system
04-03 02:12:35.383 976-976/? E/NetworkScheduler.SchedulerReceiver: Invalid parameter app
04-03 02:12:35.383 976-976/? E/NetworkScheduler.SchedulerReceiver: Invalid package name : Perhaps you didn't include a PendingIntent in the extras?
04-03 02:12:46.694 17421-17421/com.example.caneraydin.myapplication E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.caneraydin.myapplication, PID: 17421
java.util.ConcurrentModificationException
at java.util.HashMap$HashIterator.nextEntry(HashMap.java:806)
at java.util.HashMap$KeyIterator.next(HashMap.java:833)
at android.view.ViewGroup.dispatchDragEvent(ViewGroup.java:1191)
at android.view.ViewGroup.dispatchDragEvent(ViewGroup.java:1193)
at android.view.ViewGroup.dispatchDragEvent(ViewGroup.java:1193)
at android.view.ViewGroup.dispatchDragEvent(ViewGroup.java:1193)
at android.view.ViewRootImpl.handleDragEvent(ViewRootImpl.java:5250)
at android.view.ViewRootImpl.access$900(ViewRootImpl.java:115)
at android.view.ViewRootImpl$ViewRootHandler.handleMessage(ViewRootImpl.java:3462)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5584)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1268)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1084)
at dalvik.system.NativeStart.main(Native Method)
04-03 02:12:47.164 591-17912/? E/android.os.Debug: !#Dumpstate > sdumpstate -k -t -z -d -m 17421 -o /data/log/dumpstate_app_error
04-03 02:12:47.365 4478-4478/? E/SamsungIME: isHWKeyboardConnected() = false --> false
04-03 02:12:48.225 591-591/? E/Tethering: No numeric data
04-03 02:12:54.391 591-731/? E/ConnectivityService: net.tcp.usercfg.default not found in system default properties
04-03 02:12:54.391 591-731/? E/ConnectivityService: Can't set delayed ACK size:java.io.FileNotFoundException: /sys/kernel/ipv4/tcp_use_userconfig: open failed: ENOENT (No such file or directory)
04-03 02:12:54.391 591-731/? E/ConnectivityService: net.tcp.delack.default not found in system default properties
04-03 02:12:54.391 591-731/? E/ConnectivityService: Can't set delayed ACK size:java.io.FileNotFoundException: /sys/kernel/ipv4/tcp_delack_seg: open failed: ENOENT (No such file or directory)
04-03 02:12:54.472 591-731/? E/ConnectivityService: Exception trying to remove a route: java.lang.IllegalStateException: command '2337 interface route remove wlan0 default 192.168.0.0 24 0.0.0.0' failed with '400 2337 Failed to remove route from default table (No such process)'
04-03 02:12:54.492 591-731/? E/ConnectivityService: Exception trying to remove a route: java.lang.IllegalStateException: command '2338 interface route remove wlan0 default 192.168.0.1 32 0.0.0.0' failed with '400 2338 Failed to remove route from default table (No such process)'
04-03 02:12:54.502 591-731/? E/ConnectivityService: Exception trying to remove a route: java.lang.IllegalStateException: command '2339 interface route remove wlan0 default 0.0.0.0 0 192.168.0.1' failed with '400 2339 Failed to remove route from default table (No such process)'
04-03 02:12:55.152 591-700/? E/ActivityThread: Failed to find provider info for telephony
04-03 02:12:55.262 976-17261/? E/GCM: Wifi connection closed with errorCode 20
04-03 02:12:58.636 18032-18032/? E/dalvikvm: Could not find class 'android.speech.tts.Voice', referenced from method com.google.android.tts.service.GoogleTTSService.onGetVoices
04-03 02:13:01.328 591-856/? E/Watchdog: !#Sync 3568
04-03 02:13:22.219 591-699/? E/ViewRootImpl: sendUserActionEvent() mView == null
04-03 02:13:22.259 591-717/? E/InputDispatcher: channel ~ Channel is unrecoverably broken and will be disposed!
04-03 02:13:31.327 591-856/? E/Watchdog: !#Sync 3569
04-03 02:14:01.337 591-856/? E/Watchdog: !#Sync 3570
04-03 02:14:31.336 591-856/? E/Watchdog: !#Sync 3571
Those are errors
these are my codes
https://stackoverflow.com/questions/36373171/android-drag-drop-imaview-onto-other-imageview
I dropped image on to empty place but it gave errors. when i drop on to another image,again errors.
What is wrong? I cant solve for days.
Refering to this, you may try that:
case DragEvent.ACTION_DROP:
final View droppedView = (View) event.getLocalState();
ViewGroup owner = (ViewGroup) droppedView.getParent();
owner.post(new Runnable(){
#Override
public void run() {
owner.removeView(droppedView);
}
});
}
I have an app which takes the location and sends it to a server. I get the following errors which I have no idea from where they came from:
11-05 02:47:11.699 27839-27839/? E/Zygote: MountEmulatedStorage()
11-05 02:47:11.699 27839-27839/? E/Zygote: v2
11-05 02:47:11.719 27839-27839/? E/SELinux: [DEBUG] get_category: variable seinfo: default sensitivity: NULL, cateogry: NULL
11-05 02:47:12.009 27839-27896/name.company.newapp E/GMPM: getGoogleAppId failed with status: 10
11-05 02:47:12.009 27839-27896/name.company.newapp E/GMPM: Uploading is not possible. App measurement disabled
And here is the full logcat:
11-05 02:47:11.699 27839-27839/? E/Zygote: MountEmulatedStorage()
11-05 02:47:11.699 27839-27839/? E/Zygote: v2
11-05 02:47:11.699 27839-27839/? I/libpersona: KNOX_SDCARD checking this for 10799
11-05 02:47:11.699 27839-27839/? I/libpersona: KNOX_SDCARD not a persona
11-05 02:47:11.719 27839-27839/? I/SELinux: Function: selinux_compare_spd_ram, SPD-policy is existed. and_ver=SEPF_SM-N9005_5.0 ver=27
11-05 02:47:11.719 27839-27839/? I/SELinux: Function: selinux_compare_spd_ram , priority [1] , priority version is VE=SEPF_SM-N9005_5.0_0027
11-05 02:47:11.719 27839-27839/? E/SELinux: [DEBUG] get_category: variable seinfo: default sensitivity: NULL, cateogry: NULL
11-05 02:47:11.719 27839-27839/? I/art: Late-enabling -Xcheck:jni
11-05 02:47:11.759 27839-27839/? D/TimaKeyStoreProvider: TimaSignature is unavailable
11-05 02:47:11.759 27839-27839/? D/ActivityThread: Added TimaKeyStore provider
11-05 02:47:11.819 27839-27839/name.company.newapp D/ResourcesManager: creating new AssetManager and set to /data/app/name.company.newapp-2/base.apk
11-05 02:47:11.989 27839-27896/name.company.newapp I/GMPM: App measurement is starting up
11-05 02:47:12.009 27839-27896/name.company.newapp E/GMPM: getGoogleAppId failed with status: 10
11-05 02:47:12.009 27839-27896/name.company.newapp E/GMPM: Uploading is not possible. App measurement disabled
11-05 02:47:12.189 27839-27839/name.company.newapp V/Cursor Object: >>>>> Dumping cursor android.content.ContentResolver$CursorWrapperInner#c87f19b
11-05 02:47:12.189 27839-27839/name.company.newapp V/Cursor Object: 0 {
11-05 02:47:12.189 27839-27839/name.company.newapp V/Cursor Object: email=bb#gmail.com
11-05 02:47:12.189 27839-27839/name.company.newapp V/Cursor Object: }
11-05 02:47:12.189 27839-27839/name.company.newapp V/Cursor Object: <<<<<
11-05 02:47:12.189 27839-27839/name.company.newapp I/Timeline: Timeline: Activity_launch_request id:name.company.newapp time:726092745
11-05 02:47:12.209 27839-27839/name.company.newapp D/Activity: performCreate Call secproduct feature valuefalse
11-05 02:47:12.209 27839-27839/name.company.newapp D/Activity: performCreate Call debug elastic valuetrue
11-05 02:47:12.269 27839-27839/name.company.newapp V/Cursor Object: >>>>> Dumping cursor android.content.ContentResolver$CursorWrapperInner#a9eedf8
11-05 02:47:12.269 27839-27839/name.company.newapp V/Cursor Object: 0 {
11-05 02:47:12.269 27839-27839/name.company.newapp V/Cursor Object: fname=D-B
11-05 02:47:12.269 27839-27839/name.company.newapp V/Cursor Object: }
11-05 02:47:12.269 27839-27839/name.company.newapp V/Cursor Object: <<<<<
11-05 02:47:12.269 27839-27839/name.company.newapp D/Activity: performCreate Call secproduct feature valuefalse
11-05 02:47:12.269 27839-27839/name.company.newapp D/Activity: performCreate Call debug elastic valuetrue
11-05 02:47:12.289 27839-27901/name.company.newapp D/OpenGLRenderer: Render dirty regions requested: true
11-05 02:47:12.339 27839-27901/name.company.newapp I/Adreno-EGL: <qeglDrvAPI_eglInitialize:410>: EGL 1.4 QUALCOMM build: AU_LINUX_ANDROID_LA.BF.1.1_RB1.05.00.00.002.025_msm8974_LA.BF.1.1_RB1__release_AU ()
11-05 02:47:12.339 27839-27901/name.company.newapp I/Adreno-EGL: OpenGL ES Shader Compiler Version: E031.25.01.03
11-05 02:47:12.339 27839-27901/name.company.newapp I/Adreno-EGL: Build Date: 11/19/14 Wed
11-05 02:47:12.339 27839-27901/name.company.newapp I/Adreno-EGL: Local Branch: mybranch5813579
11-05 02:47:12.339 27839-27901/name.company.newapp I/Adreno-EGL: Remote Branch: quic/LA.BF.1.1_rb1.11
11-05 02:47:12.339 27839-27901/name.company.newapp I/Adreno-EGL: Local Patches: NONE
11-05 02:47:12.339 27839-27901/name.company.newapp I/Adreno-EGL: Reconstruct Branch: AU_LINUX_ANDROID_LA.BF.1.1_RB1.05.00.00.002.025 + 30e7589 + NOTHING
11-05 02:47:12.339 27839-27901/name.company.newapp I/OpenGLRenderer: Initialized EGL, version 1.4
11-05 02:47:12.369 27839-27901/name.company.newapp I/OpenGLRenderer: HWUI protection enabled for context , &this =0xaf022088 ,&mEglDisplay = 1 , &mEglConfig = 8
11-05 02:47:12.369 27839-27901/name.company.newapp D/OpenGLRenderer: Enabling debug mode 0
11-05 02:47:12.519 27839-27839/name.company.newapp I/Timeline: Timeline: Activity_idle id: android.os.BinderProxy#37fd12d1 time:726093077
I think I have all the necessary permissions.This is my manifest file:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="name.company.newapp" >
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<!--
The ACCESS_COARSE/FINE_LOCATION permissions are not required to use
Google Maps Android API v2, but are recommended.
-->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme" >
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="#string/google_maps_key" />
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
<provider
android:name=".InternetRelated.NightAssetContentProvider"
android:authorities="name.company.newapp.NightAssetContentProvider" >
</provider>
<activity
android:name=".MainActivity"
android:label="#string/app_name"
android:theme="#style/AppTheme.NoActionBar" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".UserActivities.Login"
android:label="#string/title_activity_login"
android:theme="#style/AppTheme.NoActionBar" >
</activity>
<activity
android:name=".UserActivities.AfterLogin"
android:label="#string/title_activity_after_login"
android:theme="#style/AppTheme.NoActionBar" >
</activity>
<activity
android:name=".UploadNewActivity"
android:label="#string/title_activity_upload_new"
android:theme="#style/AppTheme.NoActionBar" >
</activity>
</application>
</manifest>
I am developing an Android Application and was looking into Google Places for some functionality within the application. Google has recently released the PlacePicker feature which is what I am using. I have followed the Google guidelines and quick start guides to the "T". The functionality was working amazing as of three hours ago and now when I go to test it, it launches and then immediately closes with no errors thrown in the stack trace. Here is how I am using the code:
This is within a fragment.
// The Location Selection from Google Place Picker
where.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View v) {
try {
launchPlace();
} catch (GooglePlayServicesNotAvailableException | GooglePlayServicesRepairableException e) {
e.printStackTrace();
}
}
});
This is within the fragments onCreateView.
The method launchPlace() is defined as follows.
// Start Google Place Picker Code **************************************************************
public void launchPlace() throws GooglePlayServicesNotAvailableException,
GooglePlayServicesRepairableException {
PLACE_PICKER_REQUEST = 1;
PlacePicker.IntentBuilder builder = new PlacePicker.IntentBuilder();
Context context = getActivity().getApplicationContext();
startActivityForResult(builder.build(context), PLACE_PICKER_REQUEST);
}
public void onActivityResult(int requestCode, int resultCode, Intent data) {
String badLocation = "That location is not valid for this app, please select a valid location";
if (requestCode == PLACE_PICKER_REQUEST) {
if (resultCode == Activity.RESULT_OK) {
place = PlacePicker.getPlace(data, getActivity().getApplicationContext());
if (place.getPlaceTypes().contains(34)) {
if (place.getPlaceTypes().contains(9) || place.getPlaceTypes().contains(15) ||
place.getPlaceTypes().contains(38) ||
place.getPlaceTypes().contains(67) ||
place.getPlaceTypes().contains(79)) {
where.setText(place.getName());
loc = true;
} else {
Toast.makeText(getActivity().getApplicationContext(),
badLocation, Toast.LENGTH_LONG).show();
try {
launchPlace();
} catch (GooglePlayServicesNotAvailableException | GooglePlayServicesRepairableException e) {
e.printStackTrace();
}
}
}
}
}
}
This code worked previously (3 hours ago) and now does not. Here is what LogCat says: (Android Studio)
04-21 15:48:02.320 5045-5045/com.siliconmindtech.trofi D/ViewRootImpl﹕ ViewPostImeInputStage ACTION_DOWN
04-21 15:48:02.680 5045-5124/com.siliconmindtech.trofi D/OpenGLRenderer﹕ endAllStagingAnimators on 0xa1a55600 (InsetDrawable) with handle 0xa185dff0
04-21 15:48:05.000 5045-5121/com.siliconmindtech.trofi I/System.out﹕ (HTTPLog)-Static: isSBSettingEnabled false
04-21 15:48:05.060 5045-5045/com.siliconmindtech.trofi I/Timeline﹕ Timeline: Activity_idle id: android.os.BinderProxy#215c768a time:9757022
If anyone knows of a way to help with this that would be amazing, I know that Google PlacePicker is quite new but I am a novice Android Developer and feel like someone has a better understanding than I. Any and all help would be appreciated. If more information is required please let me know. We use GitHub so I have reverted all the way back to when it once worked, yet nothing changed, it still closes (the picker, not the app). I have enabled the Google Places API and Google Places API for Android in the developer console, no help there either. It gets to the "Updating your location" screen then stops.
EDIT: This is the entire LogCat, from launch (On a Samsung Galaxy S5) to the PlacePicker starting (One navigation prior to that action) then closing and returning to the app. Is this what you meant?
04-21 16:56:26.740 27318-27318/com.siliconmindtech.trofi D/ResourcesManager﹕ creating new AssetManager and set to /data/app/com.siliconmindtech.trofi-1/base.apk
04-21 16:56:26.910 27318-27318/com.siliconmindtech.trofi D/AbsListView﹕ Get MotionRecognitionManager
04-21 16:56:26.910 27318-27340/com.siliconmindtech.trofi I/System.out﹕ (HTTPLog)-Static: isSBSettingEnabled false
04-21 16:56:26.910 27318-27340/com.siliconmindtech.trofi I/System.out﹕ (HTTPLog)-Static: isShipBuild true
04-21 16:56:26.910 27318-27340/com.siliconmindtech.trofi I/System.out﹕ (HTTPLog)-Thread-13137-1066627414: SmartBonding Enabling is false, SHIP_BUILD is true, log to file is false, DBG is false
04-21 16:56:26.910 27318-27340/com.siliconmindtech.trofi I/System.out﹕ (HTTPLog)-Static: isSBSettingEnabled false
04-21 16:56:26.910 27318-27318/com.siliconmindtech.trofi D/AbsListView﹕ Get MotionRecognitionManager
04-21 16:56:26.940 27318-27318/com.siliconmindtech.trofi D/Activity﹕ performCreate Call secproduct feature valuefalse
04-21 16:56:26.940 27318-27318/com.siliconmindtech.trofi D/Activity﹕ performCreate Call debug elastic valuetrue
04-21 16:56:26.950 27318-27318/com.siliconmindtech.trofi D/AbsListView﹕ Get MotionRecognitionManager
04-21 16:56:26.970 27318-27350/com.siliconmindtech.trofi D/OpenGLRenderer﹕ Render dirty regions requested: true
04-21 16:56:27.030 27318-27350/com.siliconmindtech.trofi I/Adreno-EGL﹕ <qeglDrvAPI_eglInitialize:410>: EGL 1.4 QUALCOMM build: ()
OpenGL ES Shader Compiler Version: E031.25.01.03
Build Date: 10/28/14 Tue
Local Branch: LA.BF.1.1_RB1_20141028_021_patches2
Remote Branch:
Local Patches:
Reconstruct Branch:
04-21 16:56:27.030 27318-27350/com.siliconmindtech.trofi I/OpenGLRenderer﹕ Initialized EGL, version 1.4
04-21 16:56:27.050 27318-27350/com.siliconmindtech.trofi I/OpenGLRenderer﹕ HWUI protection enabled for context , &this =0xa23090d8 ,&mEglDisplay = 1 , &mEglConfig = 8
04-21 16:56:27.050 27318-27350/com.siliconmindtech.trofi D/OpenGLRenderer﹕ Enabling debug mode 0
04-21 16:56:27.050 27318-27340/com.siliconmindtech.trofi I/System.out﹕ KnoxVpnUidStorageknoxVpnSupported API value returned is false
04-21 16:56:27.240 27318-27350/com.siliconmindtech.trofi V/RenderScript﹕ Application requested CPU execution
04-21 16:56:27.260 27318-27350/com.siliconmindtech.trofi V/RenderScript﹕ 0xa2377a00 Launching thread(s), CPUs 4
04-21 16:56:27.310 27318-27318/com.siliconmindtech.trofi I/Timeline﹕ Timeline: Activity_idle id: android.os.BinderProxy#344b9848 time:13859270
04-21 16:56:29.700 27318-27318/com.siliconmindtech.trofi D/ViewRootImpl﹕ ViewPostImeInputStage ACTION_DOWN
04-21 16:56:31.850 27318-27318/com.siliconmindtech.trofi D/ViewRootImpl﹕ ViewPostImeInputStage ACTION_DOWN
04-21 16:56:31.970 27318-27318/com.siliconmindtech.trofi I/Places﹕ Got here!
04-21 16:56:32.300 27318-27350/com.siliconmindtech.trofi D/OpenGLRenderer﹕ endAllStagingAnimators on 0xa196d600 (InsetDrawable) with handle 0xaf7fc350
04-21 16:56:32.740 27318-27318/com.siliconmindtech.trofi I/Timeline﹕ Timeline: Activity_idle id: android.os.BinderProxy#344b9848 time:13864703
The above LogCat is Verbose.
Solution: Don't be a newbie like me, I had forgotten to add my Google API Key to my android_manifest.xml... I apologize.
Just enable Google Places API for Android in your Google Developer Console.
Don't forget to specify your API key at AndroidManifest:
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="ADD_YOUR_API_KEY_HERE" />
I believe that when Google made changes to their API's on 04/20/2015 they modified the places API that the PlacePicker inherently uses. The solution that worked for me is as follows:
Go to your Google Developer Console (https://console.developers.google.com/project)
Navigate to your project if you have made one. If not go here: https://developers.google.com/console/help/
Navigate to "APIs & auth" then to "Credentials" on the left side of the console. I don't have enough rep to post a picture for guidance...
Create a new Key, this appears under Public API access in your Credentials window. You will need your SHA1 Fingerprint to receive the key. Directions that I used are here: How to get the SHA-1 fingerprint certificate in Android Studio for debug mode?
The location that you input your SHA1 Fingerprint should be in this format:
(Your Key, 20 Hex values separated by ":");com.yourpackage.yourapp
Copy your API Key that is generated. You will need to add the fingerprint of each developer in the same format above for it to work for other developers.
Add your key to your AndroidManifest.xml
<application ...
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="#string/google_api_key" />
... </application>
Where the "#string/google_api_key" /> is the key that you just generated. Place it in your strings.xml file as such:
<string name="google_api_key">yourkeyhere</string>
Clean and Rebuild your project. Should be working now. I don't think I left any steps out... Please comment if I have.
I have the same issue. I add Google map key
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="#string/google_maps_key"/>` in manifest file.
The Place Picker closes immediately. Then, i also add
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="#string/google_api_key" />
The Place Picker shows, but when i open map, my app was force close, and log like below.
RuntimeException: The API key can only be specified once. It is recommended that you use the meta-data tag with the name: com.google.android.maps.v2.API_KEY in the <application> element of AndroidManifest.xml
at com.google.maps.api.android.lib6.d.fb.a(Unknown Source)
at com.google.maps.api.android.lib6.a.g.a(Unknown Source)
at com.google.android.gms.maps.internal.CreatorImpl.b(Unknown Source)
at com.google.android.gms.maps.internal.CreatorImpl.b(Unknown Source)
at com.google.android.gms.maps.internal.i.onTransact(SourceFile:62)
at android.os.Binder.transact(Binder.java:364)
at com.google.android.gms.maps.internal.zzc$zza$zza.zzj(Unknown Source)
at com.google.android.gms.maps.SupportMapFragment$zzb.zzqs(Unknown Source)
at com.google.android.gms.maps.SupportMapFragment$zzb.zza(Unknown Source)
at com.google.android.gms.dynamic.zza.zza(Unknown Source)
at com.google.android.gms.dynamic.zza.onCreate(Unknown Source)
at com.google.android.gms.maps.SupportMapFragment.onCreate(Unknown Source)
at android.support.v4.app.Fragment.performCreate(Fragment.java:1763)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:915)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1136)
at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:739)
at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1499)
at android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:456)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5103)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:790)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:606)
at dalvik.system.NativeStart.main(Native Method)
I try to remove
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="#string/google_maps_key"/>`
but keep
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="#string/google_api_key" />
And It's working well, now, and I don't know why.
replace your meta data tag in the mainfeast .. it works for me ..
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="YOUR ANDROID KEY" />
with
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="YOUR ANDROID KEY" />
good luck
I had the same problems using the Places API. At the end, I figured out that there are different Google Places APIs especially for Android. Consequently, the API-Key that I was using was simply for the non-Android version.
Generate your key using this link:
https://developers.google.com/places/android-api/signup
in my case GO to Google COnsole then Enabled API for Android Google Places, then Go to Manifest.xml and put this code under
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="#string/google_maps_key" />
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
and dont forget to put Google API key
How i fixed this error was when getting an API key (On Google Developers Page) , the location where you enter your package name enter your complete package name. This is available in your android manifest!