I successfully completed the Paypal sandbox account testing. But when I came into production environment it always shows the error:'TRANSACTION REFUSED'. Can anyone please tell me why its happening?
What is App redirect URLs and return URL? Is it necessary to give both while creating an app in developer.paypal.com?
here is what my Logcat shows:
07-02 14:34:37.382: E/n(274): com.paypal.android.p2pmobile not found.
07-02 14:34:37.732: D/dalvikvm(274): GC_EXTERNAL_ALLOC freed 9617 objects / 730512 bytes in 117ms
07-02 14:34:40.493: W/KeyCharacterMap(274): No keyboard for id 0
07-02 14:34:40.493: W/KeyCharacterMap(274): Using default keymap: /system/usr/keychars/qwerty.kcm.bin
07-02 14:34:42.132: D/NativeCrypto(274): Freeing OpenSSL session
07-02 14:34:45.221: D/NativeCrypto(274): Freeing OpenSSL session
07-02 14:34:45.221: D/NativeCrypto(274): Freeing OpenSSL session
07-02 14:34:45.231: D/dalvikvm(274): GC_FOR_MALLOC freed 9678 objects / 719704 bytes in 212ms
07-02 14:35:01.942: W/paypal.sdk(274): W SN:16 PayPal Debug-ID: c071e094f8f48 [live, 2.2.2;release]
07-02 14:35:05.161: W/paypal.sdk(274): Y SN:19 PayPal Debug-ID: 70dc1489f9faa [live, 2.2.2;release]
07-02 14:35:05.171: E/paypal.sdk(274): request failure with http statusCode:400,exception:org.apache.http.client.HttpResponseException: Bad Request
07-02 14:35:05.171: E/paypal.sdk(274): request failed with server response:{"name":"TRANSACTION_REFUSED","message":"The request was refused.{0}","information_link":"https://developer.paypal.com/webapps/developer/docs/api/#TRANSACTION_REFUSED","debug_id":"70dc1489f9faa"}
07-02 14:35:05.171: E/PayPalService(274): TRANSACTION_REFUSED
I looked into the PayPal Debug-ID that you provided - the error indicates that the payer account may not be associated with a usable funding source. Can you check the payer account you are using?
Related
I'm trying to get my app to auto-backup and restore its shared preferences as per the official docs. Both backup and restore work fine on an Android 6.0 device. However, although the backup works on pre-Android 6 devices, the restore fails. The precise error messages I see in logcat depend on the device being tested. Examples:
Samsung Galaxy S3 Mini, Android 4.1.2
07-02 11:05:00.240 2013-24968/? V/BackupManagerService: beginRestoreSession: pkg=com.my.app transport=null
07-02 11:05:00.260 2013-2024/? V/RestoreSession: restorePackage pkg=com.my.app obs=android.app.backup.IRestoreObserver$Stub$Proxy#42364000
07-02 11:05:00.260 2013-2119/? D/BackupManagerService: MSG_RUN_RESTORE observer=android.app.backup.IRestoreObserver$Stub$Proxy#42364000
07-02 11:05:01.340 2013-2119/? D/BackupManagerService: initiateOneRestore packageName=#pm#
07-02 11:05:01.420 2013-2119/? V/BackupServiceBinder: doRestore() invoked
07-02 11:05:01.500 2013-2119/? V/BackupManagerService: Package com.my.app restore version [24] is compatible with installed version [24]
07-02 11:05:01.530 2013-2119/? D/BackupManagerService: awaiting agent for ApplicationInfo{4240d338 com.my.app}
07-02 11:05:01.651 2013-2022/? D/BackupManagerService: agentConnected pkg=com.my.app agent=android.os.BinderProxy#424b9d48
07-02 11:05:01.651 2013-2119/? I/BackupManagerService: got agent android.app.IBackupAgent$Stub$Proxy#4274be90
07-02 11:05:01.651 2013-2119/? D/BackupManagerService: initiateOneRestore packageName=com.my.app
07-02 11:05:01.661 14846-14857/? V/BackupServiceBinder: doRestore() invoked
07-02 11:05:01.661 14846-14857/? W/BackupHelperDispatcher: Couldn't find helper for: 'prefs:VirtualSavingsPrefs'
07-02 11:05:01.661 14846-14857/? D/backup_data: Chunk header at 40 has invalid type: 0x6144bcbc
07-02 11:05:01.661 14846-14857/? D/BackupServiceBinder: onRestore (com.my.app.PreferencesBackupAgent) threw
java.io.IOException: failed: 0xffffffff
at android.app.backup.BackupDataInput.readNextHeader(BackupDataInput.java:112)
at android.app.backup.BackupHelperDispatcher.performRestore(BackupHelperDispatcher.java:111)
at android.app.backup.BackupAgentHelper.onRestore(BackupAgentHelper.java:75)
at android.app.backup.BackupAgent$BackupServiceBinder.doRestore(BackupAgent.java:527)
at android.app.IBackupAgent$Stub.onTransact(IBackupAgent.java:106)
at android.os.Binder.execTransact(Binder.java:367)
at dalvik.system.NativeStart.run(Native Method)
07-02 11:05:01.751 2013-2119/? V/BackupManagerService: No next package, finishing restore
Samsung Galaxy A3, Android 5.0.2
07-02 14:44:21.159 1002-1355/? V/BackupManagerService: beginRestoreSession: pkg=com.my.app transport=null
07-02 14:44:21.159 1002-4292/? V/RestoreSession: restorePackage pkg=com.my.app obs=android.app.backup.IRestoreObserver$Stub$Proxy#345efd33
07-02 14:44:21.159 1002-1128/? D/BackupManagerService: MSG_RUN_RESTORE observer=android.app.backup.IRestoreObserver$Stub$Proxy#345efd33
07-02 14:44:21.589 1529-1538/? I/GmsBackupTransport: Http Response Code : 200
07-02 14:44:21.619 1529-1872/? I/GmsBackupTransport: Current restore package : PackageInfo{207b91f #pm#}
07-02 14:44:21.619 1002-1128/? D/BackupManagerService: initiateOneRestore packageName=#pm#
07-02 14:44:21.649 1002-1128/? V/BackupServiceBinder: doRestore() invoked
07-02 14:44:21.659 1529-1871/? I/GmsBackupTransport: Current restore package : PackageInfo{4ab746c com.my.app}
07-02 14:44:21.659 1002-1128/? I/BackupManagerService: Next restore package: RestoreDescription{com.my.app : KEY_VALUE}
07-02 14:44:21.659 1002-1128/? V/BackupManagerService: Package com.my.app restore version [24] is compatible with installed version [24]
07-02 14:44:21.659 1002-1128/? D/BackupManagerService: awaiting agent for ApplicationInfo{2638d65b com.my.app}
07-02 14:44:21.659 1002-1014/? D/BackupManagerService: agentConnected pkg=com.my.app agent=android.os.BinderProxy#1551c6dd
07-02 14:44:21.659 1002-1128/? I/BackupManagerService: got agent android.app.IBackupAgent$Stub$Proxy#2a573252
07-02 14:44:21.659 1002-1128/? D/BackupManagerService: initiateOneRestore packageName=com.my.app
07-02 14:44:21.669 1002-1128/? E/BackupManagerService: SElinux restorecon failed for /cache/com.my.app.stage
07-02 14:44:21.669 17200-17214/? V/BackupServiceBinder: doRestore() invoked
07-02 14:44:21.669 17200-17214/? D/backup_data: SKIP_PADDING FAILED at line 334
07-02 14:44:21.669 1002-1128/? V/BackupManagerService: No more packages; finishing restore
07-02 14:44:21.699 1002-1128/? I/BackupRestoreController: restoreFinished for 0
07-02 14:44:21.699 1002-1128/? I/BackupManagerService: Restore complete.
07-02 14:44:21.699 1002-1128/? E/RestoreSession: Error in finishRestore
java.lang.NullPointerException: Attempt to read from field 'java.util.Set evs.d' on a null object reference
at android.os.Parcel.readException(Parcel.java:1546)
at android.os.Parcel.readException(Parcel.java:1493)
at com.android.internal.backup.IBackupTransport$Stub$Proxy.finishRestore(IBackupTransport.java:819)
at com.android.server.backup.BackupManagerService$ActiveRestoreSession$EndRestoreRunnable.run(BackupManagerService.java:9477)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:145)
at android.os.HandlerThread.run(HandlerThread.java:61)
07-02 14:44:21.699 1002-1128/? V/BackupManagerService: Clearing restore session and halting timeout
The log messages tagged with backup_data suggest some error occurs when trying to read in the backup data. Has anyone seen and know how to fix errors like this? I haven't been able to debug into the backup code to see what's going wrong.
I know the backup works because I can see a correctly timestamped backup entry for my app under each tested device under the Android section of https://www.google.com/settings/dashboard.
To support pre-Android 6 devices I extended BackupAgentHelper and added a SharedPreferencesBackupHelper in its onCreate() method as described here. The one thing different from the docs is that I had to precede the name of my backup agent helper class with a '.' in my manifest to avoid a class-not-found exception when loading the app. i.e.,:
android:backupAgent=".PreferencesBackupAgent"
I am unable to run android's device ready function (not getting fired). How do I fix it? I have target sdk 22 and cordova 5.1.1 and android studio 1.0.1.
My index.html:
<!DOCTYPE html>
<html>
<head>
<title>Device Ready Example</title>
<script type="text/javascript" charset="utf-8" src="cordova.js"></script>
</head>
<body onload="onLoad()">
</body>
</html>
index.js:
function onLoad() {
document.addEventListener("deviceready", onDeviceReady, false);
}
// device APIs are available
//
function onDeviceReady() {
window.addEventListener("batterystatus", onBatteryStatus, false);
}
// Handle the batterystatus event
//
function onBatteryStatus(info) {
console.log("Level: " + info.level + " isPlugged: " + info.isPlugged);
}
And where will this get logged : console.log("Level: " + info.level + " isPlugged: " + info.isPlugged);
If I run on command propmpt: cordova build:
Total time: 7.545 secs
C:\Users\salangar\hello\platforms\android\cordova\node_modules\q\q.js:126
throw e;
^
Error code 1 for command: cmd with args: /s /c "C:\Users\salangar\hello\platform
s\android\gradlew cdvBuildDebug -b C:\Users\salangar\hello\platforms\android\build.gradle -Dorg.gradle.daemon=true"
ERROR building one of the platforms: Error: cmd: Command failed with exit code 1
You may not have the required environment or OS to build this project
Error: cmd: Command failed with exit code 1
at ChildProcess.whenDone (C:\Users\salangar\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\cordova\superspawn.js:134:23)
at ChildProcess.emit (events.js:110:17)
at maybeClose (child_process.js:1015:16)
at Process.ChildProcess._handle.onexit (child_process.js:1087:5)
Logcat display:
I/WebViewFactory﹕ Loading com.android.webview version 39 (1737576-arm) (code 300001)
07-02 11:10:44.806 HelloWorld I/LibraryLoader﹕ Time to load native libraries: 726 ms (timestamps 7130-7856)
07-02 11:10:44.824 HelloWorld I/LibraryLoader﹕ Expected native library version number "",actual native library version number ""
07-02 11:10:44.979 HelloWorld V/WebViewChromiumFactoryProvider﹕ Binding Chromium to main looper Looper (main, tid 1) {951e68}
07-02 11:10:44.990 HelloWorld I/LibraryLoader﹕ Expected native library version number "",actual native library version number ""
07-02 11:10:45.113 HelloWorld I/BrowserStartupController﹕ Initializing chromium process, singleProcess=true
07-02 11:10:45.021 HelloWorld I/chromium﹕ [INFO:library_loader_hooks.cc(104)] Chromium logging enabled: level = 0, default verbosity = 0
07-02 11:10:45.140 HelloWorld W/art﹕ Attempt to remove local handle scope entry from IRT, ignoring
07-02 11:10:45.448 HelloWorld W/AudioManagerAndroid﹕ Requires BLUETOOTH permission
07-02 11:10:45.575 HelloWorld W/chromium﹕ [WARNING:resource_bundle.cc(304)] locale_file_path.empty()
07-02 11:10:45.590 HelloWorld I/chromium﹕ [INFO:aw_browser_main_parts.cc(65)] Load from apk succesful, fd=31 off=46184 len=3037
07-02 11:10:45.614 HelloWorld I/chromium﹕ [INFO:aw_browser_main_parts.cc(78)] Loading webviewchromium.pak from, fd:32 off:229484 len:1089587
07-02 11:10:45.828 HelloWorld E/chromium﹕ [ERROR:gl_surface_egl.cc(165)] No suitable EGL configs found.
07-02 11:10:45.829 HelloWorld E/chromium﹕ [ERROR:gl_surface_android.cc(23)] GLSurfaceEGL::InitializeOneOff failed.
07-02 11:10:45.835 HelloWorld E/chromium﹕ [ERROR:browser_main_loop.cc(988)] GLSurface::InitializeOneOff failed
07-02 11:10:46.790 HelloWorld W/chromium﹕ [WARNING:data_reduction_proxy_settings.cc(331)] SPDY proxy OFF at startup
07-02 11:10:47.032 HelloWorld W/art﹕ Attempt to remove local handle scope entry from IRT, ignoring
07-02 11:10:47.115 HelloWorld W/AwContents﹕ onDetachedFromWindow called when already detached. Ignoring
07-02 11:10:47.328 HelloWorld D/SystemWebViewEngine﹕ CordovaWebView is running on device made by: unknown
07-02 11:10:47.408 HelloWorld W/art﹕ Attempt to remove local handle scope entry from IRT, ignoring
07-02 11:10:47.408 HelloWorld W/art﹕ Attempt to remove local handle scope entry from IRT, ignoring
07-02 11:10:47.712 HelloWorld I/art﹕ Background sticky concurrent mark sweep GC freed 3517(255KB) AllocSpace objects, 2(32KB) LOS objects, 31% free, 764KB/1117KB, paused 2.313ms total 499.804ms
07-02 11:10:48.445 HelloWorld D/gralloc_goldfish﹕ Emulator without GPU emulation detected.
07-02 11:10:55.758 HelloWorld D/JsMessageQueue﹕ Set native->JS mode to OnlineEventsBridgeMode
07-02 11:10:56.152 HelloWorld I/art﹕ Background partial concurrent mark sweep GC freed 3730(208KB) AllocSpace objects, 1(16KB) LOS objects, 53% free, 887KB/1911KB, paused 1.825ms total 326.232ms
07-02 11:10:57.749 HelloWorld I/Choreographer﹕ Skipped 45 frames! The application may be doing too much work on its main thread.
07-02 11:11:00.752 HelloWorld I/Choreographer﹕ Skipped 54 frames! The application may be doing too much work on its main thread.
07-02 11:11:01.075 HelloWorld I/Choreographer﹕ Skipped 31 frames! The application may be doing too much work on its main thread.
07-02 11:11:01.545 HelloWorld I/chromium﹕ [INFO:CONSOLE(1188)] "deviceready has not fired after 5 seconds.", source: file:///android_asset/www/cordova.js (1188)
07-02 11:11:01.750 HelloWorld I/chromium﹕ [INFO:CONSOLE(1181)] "Channel not fired: onPluginsReady", source: file:///android_asset/www/cordova.js (1181)
07-02 11:11:01.752 HelloWorld I/chromium﹕ [INFO:CONSOLE(1181)] "Channel not fired: onCordovaReady", source: file:///android_asset/www/cordova.js (1181)
07-02 11:11:03.655 HelloWorld W/PluginManager﹕ THREAD WARNING: exec() call to CoreAndroid.show blocked the main thread for 161ms. Plugin should use CordovaInterface.getThreadPool().
07-02 11:11:04.699 HelloWorld I/chromium﹕ [INFO:CONSOLE(47)] "Received Event: deviceready", source: file:///android_asset/www/js/index.js (47)
07-02 11:11:27.708 HelloWorld I/Choreographer﹕ Skipped 33 frames! The application may be doing too much work on its main thread.
07-02 11:11:28.112 HelloWorld I/Choreographer﹕ Skipped 34 frames! The application may be doing too much work on its main thread.
07-02 11:11:58.646 HelloWorld I/Choreographer﹕ Skipped 33 frames! The application may be doing too much work on its main thread.
device ready function (not getting fired). How do I fix it?
You don't need to use onLoad() function to call deviceready event.
instead of this :-
function onLoad() {
document.addEventListener("deviceready", onDeviceReady, false);
}
just write :-
document.addEventListener("deviceready", onDeviceReady, false);
and another thing is you need to write the script cordova.js part inside the body tag and add the index.js file like the cordova.js.
where will this get logged : console.log("Level: " + info.level + " isPlugged: " + info.isPlugged);
This log is print in logcat.
Hope this help :) if you have any difficulties please let me know.
I added google API with some markers on it to my android application. when I run the application it runs perfectly as usual. i.e. it runs like before adding the map. but it opens the LogCat with some errors. I search to solve the errors but I didn't reach a solution.
Note: these errors sometimes appear (Not Always).
here are the errors that appear on the LogCat
03-08 11:51:40.247: I/Icing(950): Storage manager: low false usage 9.34KB avail 99.15MB capacity 167.55MB
03-08 11:51:40.437: E/Icing(950): Error initializing, resetting corpora: Could not create native index
03-08 11:51:40.567: E/Icing(950): Internal init failed
03-08 11:51:40.567: E/Icing(950): Couldn't handle android.intent.action.PACKAGE_REMOVED intent due to initialization failure.
03-08 11:51:41.147: D/PackageBroadcastService(950): Received broadcast action=android.intent.action.PACKAGE_ADDED and uri=com.project.sbms
03-08 11:51:41.387: E/Icing(950): Couldn't handle android.intent.action.PACKAGE_ADDED intent due to initialization failure.
03-08 11:51:41.747: D/dalvikvm(950): GC_FOR_ALLOC freed 282K, 25% free 3135K/4164K, paused 37ms, total 40ms
03-08 11:51:41.787: I/PeopleContactsSync(950): CP2 sync disabled
03-08 11:51:42.937: D/PackageBroadcastService(950): Received broadcast action=android.intent.action.PACKAGE_REPLACED and uri=com.project.sbms
03-08 11:51:43.017: I/PeopleContactsSync(950): CP2 sync disabled
03-08 11:51:43.027: E/Icing(950): Couldn't handle android.intent.action.PACKAGE_REPLACED intent due to initialization failure.
Could anyone please help me find a solution..
Thanks..
I've done some research on the above error and it would seem that to solve there are two ways most people do:
Re import R
Close and restart eclipse
However I have done both and yet I still get the same error. Does anyone know of any other ways to defeat this error?
I'm thinking though that it may be my code. I'm trying to compile the bluetooth le sample found here
I've brought over everything yet I'm still stuck with 36 errors with most of them being this cannot be resolved as field or type error.
Here is how they call the toast line:
Toast.makeText(this, R.string.error_bluetooth_not_supported, Toast.LENGTH_SHORT).show();
And there strings.xml found in the values folder:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">BLE Sample</string>
<string name="ble_not_supported">BLE is not supported</string>
<string name="label_data">Data:</string>
<string name="label_device_address">Device address:</string>
<string name="label_state">State:</string>
<string name="no_data">No data</string>
<string name="connected">Connected</string>
<string name="disconnected">Disconnected</string>
<string name="title_devices">BLE Device Scan</string>
<string name="error_bluetooth_not_supported">Bluetooth not supported.</string>
<string name="unknown_device">Unknown device</string>
<string name="unknown_characteristic">Unknown characteristic</string>
<string name="unknown_service">Unknown service</string>
<!-- Menu items -->
<string name="menu_connect">Connect</string>
<string name="menu_disconnect">Disconnect</string>
<string name="menu_scan">Scan</string>
<string name="menu_stop">Stop</string>
</resources>
I'm literally a day into my first android development and this is all new to me. I thought using the sample code they would provide would help me get a good over view of how the bluetooth system works.
Can anyone help me beat this error?
I should add that every item on this list has an error. Any time I call anything with R.string. it get the same error.
Logcat since 1:25pm:
09-06 13:25:20.901: E/(526): W/virtual loc_api_adapter_err LocApiAdapter::enableData(int): default implementation invoked
09-06 13:25:20.901: E/(526): W/virtual loc_api_adapter_err LocApiAdapter::setAPN(char*, int): default implementation invoked
09-06 13:25:20.911: D/PicasaUploaderSyncManager(25851): active network: NetworkInfo: type: WIFI[], state: CONNECTED/CONNECTED, reason: (unspecified), extra: "SOL2", roaming: false, failover: false, isAvailable: true
09-06 13:25:20.921: D/GCM(2565): GcmService start Intent { act=android.net.conn.CONNECTIVITY_CHANGE flg=0x8000010 cmp=com.google.android.gms/.gcm.GcmService (has extras) } android.net.conn.CONNECTIVITY_CHANGE
09-06 13:25:21.051: D/ConnectivityService(526): handleInetConditionHoldEnd: net=1, condition=100, published condition=0
09-06 13:25:21.542: D/Tethering(526): MasterInitialState.processMessage what=3
09-06 13:25:21.642: E/(526): W/virtual loc_api_adapter_err LocApiAdapter::enableData(int): default implementation invoked
09-06 13:25:21.642: E/(526): W/virtual loc_api_adapter_err LocApiAdapter::setAPN(char*, int): default implementation invoked
09-06 13:25:21.662: D/GCM(2565): GcmService start Intent { act=android.net.conn.CONNECTIVITY_CHANGE flg=0x8000010 cmp=com.google.android.gms/.gcm.GcmService (has extras) } android.net.conn.CONNECTIVITY_CHANGE
09-06 13:25:22.102: D/ConnectivityService(526): handleInetConditionHoldEnd: net=1, condition=100, published condition=100
09-06 13:30:01.245: V/DigitalWidgetViewsFactory(6453): DigitalWidget sets next alarm string to null
09-06 13:36:19.083: I/ActivityManager(526): No longer want com.google.android.talk (pid 26303): empty for 1801s
09-06 13:36:31.455: V/BackupManagerService(526): Running a backup pass
09-06 13:36:31.455: V/BackupManagerService(526): clearing pending backups
09-06 13:36:31.455: V/PerformBackupTask(526): Beginning backup of 1 targets
09-06 13:36:31.485: V/BackupServiceBinder(526): doBackup() invoked
09-06 13:36:31.485: D/PerformBackupTask(526): invokeAgentForBackup on #pm#
09-06 13:36:31.495: I/PerformBackupTask(526): no backup data written; not calling transport
09-06 13:36:31.506: D/PerformBackupTask(526): starting agent for backup of BackupRequest{pkg=com.android.providers.settings}
09-06 13:36:31.506: D/BackupManagerService(526): awaiting agent for ApplicationInfo{4202bfe0 com.android.providers.settings}
09-06 13:36:31.506: D/BackupManagerService(526): agentConnected pkg=com.android.providers.settings agent=android.app.backup.BackupAgent$BackupServiceBinder#42081138
09-06 13:36:31.506: I/BackupManagerService(526): got agent android.app.backup.BackupAgent$BackupServiceBinder#42081138
09-06 13:36:31.506: D/PerformBackupTask(526): invokeAgentForBackup on com.android.providers.settings
09-06 13:36:31.516: V/BackupServiceBinder(526): doBackup() invoked
09-06 13:36:31.526: W/SettingsBackupAgent(526): Couldn't backup /data/misc/wifi/ipconfig.txt
09-06 13:36:31.526: I/PerformBackupTask(526): no backup data written; not calling transport
09-06 13:36:31.526: I/PerformBackupTask(526): Backup pass finished.
09-06 13:39:59.999: I/ActivityManager(526): No longer want com.google.android.music:main (pid 26385): empty for 1849s
09-06 13:40:00.099: W/ActivityManager(526): Scheduling restart of crashed service com.google.android.music/.playback.MusicPlaybackService in 5000ms
09-06 13:40:05.134: I/ActivityManager(526): Start proc com.google.android.music:main for service com.google.android.music/.playback.MusicPlaybackService: pid=27303 uid=10041 gids={50041, 3003, 1015, 1028}
09-06 13:40:05.214: I/MusicStore(27303): Database version: 70
09-06 13:40:05.274: D/dalvikvm(27303): GC_CONCURRENT freed 315K, 4% free 9097K/9448K, paused 3ms+9ms, total 39ms
09-06 13:40:05.274: D/dalvikvm(27303): WAIT_FOR_CONCURRENT_GC blocked 2ms
09-06 13:40:05.284: D/dalvikvm(27303): WAIT_FOR_CONCURRENT_GC blocked 5ms
09-06 13:40:05.364: D/SystemUtils(27303): getSystemProperty: lpa.decode=null
09-06 13:40:05.364: D/CacheService(27303): onCreate
09-06 13:40:05.374: D/CacheService(27303): onBind
09-06 13:40:05.384: I/LocalDevicePlayback(27303): Streaming client created.
09-06 13:40:06.445: D/dalvikvm(27303): GC_CONCURRENT freed 181K, 3% free 9337K/9580K, paused 4ms+4ms, total 30ms
09-06 13:40:06.535: I/MediaStoreImporter(27303): Update: incremental Added music: 0 Updated music: 0 Deleted music: 0 Created playlists: 0 Updated playlists: 0 Deleted playlists: 0 Inserted playlist items: 0 Deleted playlist items: 0 Removed orphaned playlist items: 0
09-06 13:40:10.459: I/MusicLeanback(27303): Conditions not met for autocaching.
09-06 13:40:10.459: I/MusicLeanback(27303): Stop autocaching.
09-06 13:40:20.549: D/GCM(2565): Ignoring attempt to send heartbeat on dead connection.
09-06 13:40:59.997: I/ActivityManager(526): No longer want android.process.acore (pid 26550): empty for 1807s
09-06 13:45:01.283: V/DigitalWidgetViewsFactory(6453): DigitalWidget sets next alarm string to null
09-06 13:48:16.403: I/EventLogService(2565): Aggregate from 1378470317827 (log), 1378469896229 (data)
09-06 13:48:16.533: I/ServiceDumpSys(2565): dumping service [account]
09-06 13:50:23.497: I/jdwp(24586): Ignoring second debugger -- accepting and dropping
09-06 13:50:23.507: I/jdwp(20948): Ignoring second debugger -- accepting and dropping
09-06 13:50:34.378: D/dalvikvm(526): GC_CONCURRENT freed 3407K, 27% free 23292K/31488K, paused 11ms+8ms, total 146ms
09-06 13:52:43.224: D/ChildProcessLauncher(5790): Setting up connection to process: slot=2
09-06 13:52:43.224: I/ActivityManager(526): Start proc com.android.chrome:sandboxed_process2 for service com.android.chrome/org.chromium.content.app.SandboxedProcessService2: pid=27469 uid=99002 gids={}
09-06 13:52:43.244: I/ChildProcessService(27469): Creating new ChildProcessService pid=27469
09-06 13:52:43.254: D/ChildProcessLauncher(5790): on connect callback, pid=27469 context=2105709408
09-06 13:52:43.254: I/LibraryLoader(27469): loading: chromeview
09-06 13:52:43.304: I/LibraryLoader(27469): loaded: chromeview
09-06 13:52:43.304: I/chromium(27469): [INFO:library_loader_hooks.cc(72)] Chromium logging enabled: level = 0, default verbosity = 0
09-06 13:52:43.314: D/TraceEvent(27469): View tag enabled: false
09-06 13:52:43.334: I/chromium(27469): [INFO:child_process_service.cc(132)] ChildProcessService: Exiting child process.
09-06 13:52:43.344: W/ChildProcessConnection(5790): onServiceDisconnected (crash?): pid=27469
09-06 13:52:43.344: D/ChildProcessLauncher(5790): stopping child connection: pid=27469
09-06 13:52:43.344: I/ActivityManager(526): Process com.android.chrome:sandboxed_process2 (pid 27469) has died.
09-06 13:52:43.344: W/ActivityManager(526): Scheduling restart of crashed service com.android.chrome/org.chromium.content.app.SandboxedProcessService2 in 5000ms
Try to show Toast like this:
Toast.makeText(context, context.getString(R.string.error_bluetooth_not_supported),Toast.LENGTH_LONG).show();
Here context refers to context of current Activity where you showing the Toast.
See these as well: Toast.makeText from resource string
Android: Java: using a string resource in a Toast
1) Typically, all R.string.stuff cease to be errors after you build the project because the file R.java is generated during the build. If you have not yet built the project, they are shown as errors and this is normal. By the way, in Eclipse, you can manually delete the error messages in the error message window (you can select and delete one or several errors, but cannot delete the root node that reads "Errors (N items)"). One more "magic" pass is pressing F5 ("Refresh") when the project is selected in the "Package Explorer" (the left-hand) pane.
2) Make sure that the generated R class belongs to the same package as the class where it's used. In Eclipse you must see in the "Package Explorer" pane: YourProject--gen--your.package--R.java.
(If that file does not exist, is the folder read/write?)
3) It may be easier to create an empty project and move the google sources to it than try to compile the project from git. At least some google app projects use a directory structure that is different from what you normally get with Eclipse (because they are built with a special script).
Generally when there are any errors in the resource folder , the R.Java file doesnt get created properly and as a result you will get this sort of error . Please check whether you have any errors in the layout folder or drawable folder.
Use:
Toast.makeText(this, getResources().getText(R.string.error_bluetooth_not_supported).toString(), Toast.LENGTH_SHORT).show();
U can use:
String str = getResources().getText(R.string.error_bluetooth_not_supported).toString();
I am trying to run the TrivialDrive on a phone to test it. I have taken all the precautions i.e. Not running it on my own phone. I have checked the versions are the same. I have waited enough time for GP servers to update, etc....
Does anyone know why this is happening? Thanks.
04-20 22:26:54.860: D/dalvikvm(3960): GC_EXTERNAL_ALLOC freed 47K, 50% free 2727K/5379K, external 0K/0K, paused 22ms
04-20 22:26:54.885: D/TrivialDrive(3960): Loaded data: tank = 2
04-20 22:26:54.885: D/TrivialDrive(3960): Creating IAB helper.
04-20 22:26:54.885: D/TrivialDrive(3960): Starting setup.
04-20 22:26:54.885: D/IabHelper(3960): Starting in-app billing setup.
04-20 22:26:54.885: I/ApplicationPackageManager(3960): cscCountry is not German : XEU
04-20 22:26:54.910: D/IabHelper(3960): Billing service connected.
04-20 22:26:54.910: D/IabHelper(3960): Checking for in-app billing 3 support.
04-20 22:26:54.915: D/IabHelper(3960): In-app billing version 3 supported for com.trivialdrivesample.free
04-20 22:26:54.925: D/IabHelper(3960): Subscriptions AVAILABLE.
04-20 22:26:54.925: D/TrivialDrive(3960): Setup finished.
04-20 22:26:54.925: D/TrivialDrive(3960): Setup successful. Querying inventory.
04-20 22:26:54.925: D/IabHelper(3960): Starting async operation: refresh inventory
04-20 22:26:54.935: D/IabHelper(3960): Querying owned items, item type: inapp
04-20 22:26:54.935: D/IabHelper(3960): Package name: com.trivialdrivesample.free
04-20 22:26:54.935: D/IabHelper(3960): Calling getPurchases with continuation token: null
04-20 22:26:54.955: D/CLIPBOARD(3960): Hide Clipboard dialog at Starting input: finished by someone else... !
04-20 22:26:54.965: D/IabHelper(3960): Owned items response: 0
04-20 22:26:54.965: D/IabHelper(3960): Continuation token: null
04-20 22:26:54.965: D/IabHelper(3960): Querying SKU details.
04-20 22:26:54.965: D/IabHelper(3960): queryPrices: nothing to do because there are no SKUs.
04-20 22:26:54.965: D/IabHelper(3960): Querying owned items, item type: subs
04-20 22:26:54.965: D/IabHelper(3960): Package name: com.trivialdrivesample.free
04-20 22:26:54.965: D/IabHelper(3960): Calling getPurchases with continuation token: null
04-20 22:26:54.975: D/IabHelper(3960): Owned items response: 0
04-20 22:26:54.975: D/IabHelper(3960): Continuation token: null
04-20 22:26:54.975: D/IabHelper(3960): Querying SKU details.
04-20 22:26:54.975: D/IabHelper(3960): queryPrices: nothing to do because there are no SKUs.
04-20 22:26:54.975: D/IabHelper(3960): Ending async operation: refresh inventory
04-20 22:26:54.975: D/TrivialDrive(3960): Query inventory finished.
04-20 22:26:54.975: D/TrivialDrive(3960): Query inventory was successful.
04-20 22:26:54.975: D/TrivialDrive(3960): User is NOT PREMIUM
04-20 22:26:54.975: D/TrivialDrive(3960): User DOES NOT HAVE infinite gas subscription.
04-20 22:26:55.000: D/dalvikvm(3960): GC_EXTERNAL_ALLOC freed 29K, 49% free 2762K/5379K, external 467K/513K, paused 23ms
04-20 22:26:55.005: D/TrivialDrive(3960): Initial inventory query finished; enabling main UI.
04-20 22:27:03.490: D/TrivialDrive(3960): Buy gas button clicked.
04-20 22:27:03.495: D/TrivialDrive(3960): Launching purchase flow for gas.
04-20 22:27:03.495: D/IabHelper(3960): Starting async operation: launchPurchaseFlow
04-20 22:27:03.495: D/IabHelper(3960): Constructing buy intent for gas, item type: inapp
04-20 22:27:03.550: D/IabHelper(3960): Launching buy intent for gas. Request code: 10001
04-20 22:27:03.620: D/CLIPBOARD(3960): Hide Clipboard dialog at Starting input: finished by someone else... !
04-20 22:27:16.580: D/TrivialDrive(3960): onActivityResult(10001,0,Intent { (has extras) }
04-20 22:27:16.580: D/IabHelper(3960): Ending async operation: launchPurchaseFlow
04-20 22:27:16.580: D/IabHelper(3960): Purchase canceled - Response: 5:Developer Error
04-20 22:27:16.580: D/TrivialDrive(3960): Purchase finished: IabResult: User canceled. (response: -1005:User cancelled), purchase: null
04-20 22:27:16.580: E/TrivialDrive(3960): ** TrivialDrive Error: Error purchasing: IabResult: User canceled. (response: -1005:User cancelled)
04-20 22:27:16.580: D/TrivialDrive(3960): Showing alert dialog: Error: Error purchasing: IabResult: User canceled. (response: -1005:User cancelled)
04-20 22:27:16.710: D/dalvikvm(3960): GC_EXTERNAL_ALLOC freed 61K, 48% free 2840K/5379K, external 917K/920K, paused 21ms
04-20 22:27:16.715: D/TrivialDrive(3960): onActivityResult handled by IABUtil.
Based on your comments above, the problem now seems clear:
When you download the app to your device from Eclipse, Eclipse automatically signs your APK with your debug key (which is typically automatically generated by Eclipse), whereas the APK that you uploaded would have to be signed with your own (non-debug) signing key (because otherwise Google Play would not accept it). So, the signature of the file with which you are testing (from Eclipse) and that of the uploaded APK, do not match. That is what is causing the error that indicates that your app is not configured for billing.
You do not have to receive the APK directly from Google Play for testing; you can just load the same signed APK as you uploaded to Google Play from your PC, via a USB cable. In fact, so long as your local APK has the same signature and the same VersionCode as the APK that you uploaded, you can send it to your device over USB using ADB and it should run. This is important because when you are testing you will want to make various minor fixes without having to re-upload and wait several hours each time before testing.
Thank you Carl for you points. I read over and over again and seemed to do everything right, except I was uploading the APK direct from Eclipse to the phone via a cable. The documentation is not clear enough. It should say that the app must only be downloaded from GP, and not from any development environment. The minute I did that, it worked. Thanks again. I'm off to working on my real app now for IAB. ;-)