Cocos2d-x installed application can't be launched on android - android

I am developing game using cocos2d-x I am succesfully playing it on iOS, MacOS and win32 but at the moment I am having issue trying to launch it on android. Compilation and installation are completed I just can't launch it because of the problem I can't understand/see. Could someone help or hint me about the problem?
Info: testing on real device, Android version 4.4.4., cocos2d-x-3.13.1, c++, target 4.4.2, eclipse Neon.1a Release (4.6.1), mac os.
If additional information is required I can provide it.
AndroidManifest.xml:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.companyName.gameName"
android:versionCode="1"
android:versionName="1.0"
android:installLocation="auto">
<uses-sdk android:minSdkVersion="19"/>
<uses-feature android:glEsVersion="0x00020000" />
<application android:label="#string/app_name"
android:icon="#drawable/icon">
<!-- Tell Cocos2dxActivity the name of our .so -->
<meta-data android:name="android.app.lib_name"
android:value="MyGame" />
<activity android:name="org.cocos2dx.cpp.AppActivity"
android:label="#string/app_name"
android:screenOrientation="landscape"
android:theme="#android:style/Theme.NoTitleBar.Fullscreen"
android:configChanges="orientation|keyboardHidden|screenSize">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
<supports-screens android:anyDensity="true"
android:smallScreens="true"
android:normalScreens="true"
android:largeScreens="true"
android:xlargeScreens="true"/>
<uses-permission android:name="android.permission.INTERNET"/>
<permission android:name="android.permission.INTERACT_ACROSS_USERS_FULL" android:protectionLevel="signature"/>
LogCat (warn, error, assert):
04-21 09:49:49.917: E/Watchdog(596): !#Sync 1245
04-21 09:49:52.780: W/AlarmManager(596): Set alarm: type= 3 triggerAtTime= 143810266 , called by : com.google.android.gms, intent:Intent { cmp=com.google.android.gms/.lockbox.LockboxAlarmReceiver }
04-21 09:49:59.997: W/AlarmManager(596): Set alarm: type= 3 triggerAtTime= 143817481 , called by : android, intent:Intent { act=android.intent.action.TIME_TICK flg=0x50000000 }
04-21 09:50:00.157: W/ResourceType(2304): Failure getting entry for 0x010400da (t=3 e=218) in package 0 (error -75)
04-21 09:50:00.157: E/accuweather(2304): [AccuTab_Magagine]>>> UIMK:1463 [0:0] time : 08:50
04-21 09:50:00.177: W/ResourceType(2304): Failure getting entry for 0x010400da (t=3 e=218) in package 0 (error -75)
04-21 09:50:19.917: E/Watchdog(596): !#Sync 1246
04-21 09:50:36.803: W/ContextImpl(25935): Calling a method in the system process without a qualified user: android.app.ContextImpl.startActivity:1255 android.content.ContextWrapper.startActivity:330 android.content.ContextWrapper.startActivity:330 com.samsung.android.MtpApplication.MtpReceiver$3.handleMessage:786 android.os.Handler.dispatchMessage:102
04-21 09:50:36.813: W/ContextImpl(25935): Calling a method in the system process without a qualified user: android.app.ContextImpl.startActivity:1267 android.app.ContextImpl.startActivity:1256 android.content.ContextWrapper.startActivity:330 android.content.ContextWrapper.startActivity:330 com.samsung.android.MtpApplication.MtpReceiver$3.handleMessage:786
04-21 09:50:37.033: W/ActivityManager(596): mDVFSHelper.acquire()
04-21 09:50:37.043: E/MTPRx(25935): started activity for popup
04-21 09:50:37.154: W/ApplicationPackageManager(25935): getCSCPackageItemText()
04-21 09:50:37.204: E/SettingsReceiverActivity(25935): PREF_DONT_ASK_AGAIN : true
04-21 09:50:37.214: W/InputMethodManagerService(596): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy#42ef9528 attribute=null, token = android.os.BinderProxy#42a655d8
04-21 09:50:38.084: W/ApplicationPackageManager(596): getCSCPackageItemText()
04-21 09:50:40.036: W/ActivityManager(596): mDVFSHelper.release()
04-21 09:50:49.916: E/Watchdog(596): !#Sync 1247
04-21 09:50:52.789: W/AlarmManager(596): Set alarm: type= 3 triggerAtTime= 144530276 , called by : android, intent:Intent { act=android.net.ConnectivityService.action.PKT_CNT_SAMPLE_INTERVAL_ELAPSED flg=0x4000000 }
04-21 09:50:52.849: W/AlarmManager(596): Set alarm: type= 3 triggerAtTime= 143870336 , called by : com.google.android.gms, intent:Intent { cmp=com.google.android.gms/.lockbox.LockboxAlarmReceiver }
04-21 09:50:59.996: W/AlarmManager(596): Set alarm: type= 3 triggerAtTime= 143877482 , called by : android, intent:Intent { act=android.intent.action.TIME_TICK flg=0x50000000 }
04-21 09:51:00.076: W/ResourceType(2304): Failure getting entry for 0x010400da (t=3 e=218) in package 0 (error -75)
04-21 09:51:00.076: E/accuweather(2304): [AccuTab_Magagine]>>> UIMK:1463 [0:0] time : 08:51
04-21 09:51:00.096: W/ResourceType(2304): Failure getting entry for 0x010400da (t=3 e=218) in package 0 (error -75)
04-21 09:51:03.719: E/memtrack(26128): Couldn't load memtrack module (No such file or directory)
04-21 09:51:03.719: E/android.os.Debug(26128): failed to load memtrack module: -2
04-21 09:51:03.900: W/ActivityManager(596): No content provider found for permission revoke: file:///data/local/tmp/MyGame.apk
04-21 09:51:19.915: E/Watchdog(596): !#Sync 1248
04-21 09:51:30.275: W/ApplicationPackageManager(25304): getCSCPackageItemText()
04-21 09:51:42.527: W/ActivityManager(596): No content provider found for permission revoke: file:///data/local/tmp/MyGame.apk
04-21 09:51:43.588: E/PackageManager(596): parse pkg : /data/app/vmdl276537072.tmp
04-21 09:51:43.618: E/PackageManager(596): dexopt start
04-21 09:51:44.980: E/PackageManager(596): dexopt end
04-21 09:51:49.915: E/Watchdog(596): !#Sync 1249
04-21 09:51:53.068: W/AlarmManager(596): Set alarm: type= 3 triggerAtTime= 143930557 , called by : com.google.android.gms, intent:Intent { cmp=com.google.android.gms/.lockbox.LockboxAlarmReceiver }
04-21 09:51:56.111: W/PackageManager(596): verifying app can be installed or not
04-21 09:51:56.331: W/PackageManager(596): Not granting permission android.permission.INSTALL_LOCATION_PROVIDER to package com.companyName.GameName (protectionLevel=18 flags=0x8be46)
04-21 09:51:56.511: W/ApplicationPackageManager(596): getCSCPackageItemText()
04-21 09:51:56.561: W/ApplicationPackageManager(596): getCSCPackageItemText()
04-21 09:51:56.771: W/ApplicationPackageManager(596): getCSCPackageItemText()
04-21 09:51:56.781: W/ApplicationPackageManager(930): getCSCPackageItemText()
04-21 09:51:56.781: W/ApplicationPackageManager(930): getCSCPackageItemText()
04-21 09:51:56.781: E/SamsungIME(1471): mOCRHelper is null
04-21 09:51:56.941: W/ApplicationPackageManager(951): getCSCPackageItemText()
04-21 09:51:58.343: W/ApplicationPackageManager(1195): getCSCPackageItemText()
04-21 09:51:58.453: E/EdmStorageProvider(596): Admin not in database, something went wrong
04-21 09:51:59.103: W/AlarmManager(596): Set alarm: type= 0 triggerAtTime= 1492761134119 , called by : com.android.vending, intent:Intent { cmp=com.android.vending/com.google.android.finsky.services.ContentSyncService }
04-21 09:51:59.344: W/IcingInternalCorpora(1352): getNumBytesRead when not calculated.
04-21 09:51:59.354: E/memtrack(26153): Couldn't load memtrack module (No such file or directory)
04-21 09:51:59.354: E/android.os.Debug(26153): failed to load memtrack module: -2
04-21 09:51:59.504: E/Finsky(25304): [1] com.google.android.finsky.wear.bl.a(847): onConnectionFailed: ConnectionResult{statusCode=API_UNAVAILABLE, resolution=null, message=null}
04-21 09:51:59.814: W/ActivityManager(596): mDVFSHelper.acquire()
04-21 09:51:59.994: W/AlarmManager(596): Set alarm: type= 3 triggerAtTime= 143937482 , called by : android, intent:Intent { act=android.intent.action.TIME_TICK flg=0x50000000 }
04-21 09:52:00.215: W/ActivityManager(596): Permission Denial: getCurrentUser() from pid=26179, uid=10129 requires android.permission.INTERACT_ACROSS_USERS
04-21 09:52:00.245: W/ApplicationPackageManager(26179): getCSCPackageItemText()
04-21 09:52:00.275: W/ActivityManager(596): Permission Denial: getCurrentUser() from pid=26179, uid=10129 requires android.permission.INTERACT_ACROSS_USERS
04-21 09:52:00.615: E/JniHelper(26179): Failed to find static java method. Class name: (null), method name: getCocos2dxPackageName, signature: ()Ljava/lang/String;
04-21 09:52:00.615: W/ResourceType(2304): Failure getting entry for 0x010400da (t=3 e=218) in package 0 (error -75)
04-21 09:52:00.625: A/libc(26179): Fatal signal 11 (SIGSEGV) at 0xfffffff4 (code=1), thread 26179 (peFromTheIsland)
04-21 09:52:00.635: E/accuweather(2304): [AccuTab_Magagine]>>> UIMK:1463 [0:0] time : 08:52
04-21 09:52:00.645: W/ResourceType(2304): Failure getting entry for 0x010400da (t=3 e=218) in package 0 (error -75)
04-21 09:52:00.865: W/SQLiteConnectionPool(1352): A SQLiteConnection object for database '+data+data+com_google_android_gms+databases+metrics_db' was leaked! Please fix your application to end transactions in progress properly and to close the database when it is no longer needed.
04-21 09:52:00.875: W/SQLiteConnectionPool(1352): A SQLiteConnection object for database '+data+data+com_google_android_gms+databases+help_responses_db_18' was leaked! Please fix your application to end transactions in progress properly and to close the database when it is no longer needed.
04-21 09:52:00.875: W/SQLiteConnectionPool(1352): A SQLiteConnection object for database '+data+data+com_google_android_gms+databases+auto_complete_suggestions_db' was leaked! Please fix your application to end transactions in progress properly and to close the database when it is no longer needed.
04-21 09:52:00.875: W/ApplicationPackageManager(1352): getCSCPackageItemText()
04-21 09:52:01.165: W/ActivityManager(596): Force finishing activity com.companyName.GameName/org.cocos2dx.cpp.AppActivity
04-21 09:52:01.206: W/ApplicationPackageManager(596): getCSCPackageItemText()
04-21 09:52:01.216: W/ApplicationPackageManager(596): getCSCPackageItemText()
04-21 09:52:01.516: E/android.os.Debug(596): !#Dumpstate > dumpstate -k -t -z -d -m 26179 -o /data/log/dumpstate_app_error
04-21 09:52:01.596: W/ContextImpl(596): Calling a method in the system process without a qualified user: android.app.ContextImpl.sendBroadcast:1372 com.android.server.analytics.data.collection.application.CrashAnrDetector.broadcastEvent:296 com.android.server.analytics.data.collection.application.CrashAnrDetector.processDropBoxEntry:254 com.android.server.analytics.data.collection.application.CrashAnrDetector.access$100:60 com.android.server.analytics.data.collection.application.CrashAnrDetector$1.onReceive:102
04-21 09:52:01.716: W/ActivityManager(596): Activity pause timeout for ActivityRecord{425a2d00 u0 com.companyName.GameName/org.cocos2dx.cpp.AppActivity t89 f}
04-21 09:52:01.906: W/ActivityManager(596): mDVFSHelper.release()
04-21 09:52:02.577: W/ApplicationPackageManager(596): getCSCPackageItemText()
LogCat (Filtered for application (Full)):
04-21 09:52:00.185: D/ActivityThread(26179): handleBindApplication:com.companyName.gameName
04-21 09:52:00.245: W/ApplicationPackageManager(26179): getCSCPackageItemText()
04-21 09:52:00.265: D/DisplayManager(26179): DisplayManager()
04-21 09:52:00.305: D/dalvikvm(26179): Trying to load lib /data/app-lib/com.companyName.gameName-1/libMyGame.so 0x41ccab70
04-21 09:52:00.615: E/JniHelper(26179): Failed to find static java method. Class name: (null), method name: getCocos2dxPackageName, signature: ()Ljava/lang/String;
04-21 09:52:00.625: A/libc(26179): Fatal signal 11 (SIGSEGV) at 0xfffffff4 (code=1), thread 26179 (peFromTheIsland)

<uses-permission android:name="android.permission.INSTALL_LOCATION_PROVIDER"/>
remove this permission from Manifest file. you can only use normal and Dangerous permission.
A third-party developer cannot grant to his/her application the permission required to install a new location provider (android.permission.INSTALL_LOCATION_PROVIDER). Only OEMs are allowed to install a new location provider.
EDIT
<permission android:name="android.permission.INTERACT_ACROSS_USERS_FULL" android:protectionLevel="signature"/>
EDIT
check package name I see com.companyName.gameName in AndroidManifest.xml, you are running your app using package com.companyName.GameName and AppActivity is in org.cocos2dx.cpp

This issue was caused by extern Userdefaults in Constants. To fix it I changed (Constants.cpp):
cocos2d::UserDefault *userDefaults = cocos2d::UserDefault::getInstance();
Constants.hpp:
extern cocos2d::UserDefault *userDefaults;
To:
Constants.cpp
cocos2d::UserDefault *userDefaults;
And (AppDelegate.cpp)
userDefaults = cocos2d::UserDefault::getInstance();
Have not done any changes to Constants.hpp.
Permissions is not required and also were was no problem with package name.
Logcat messages was not helpfull...

Related

App closes without any error when I send BOOT_COMPLETE broadcast from ADB Shell

I have a boot complete broadcast receiver which was not being called when the phone restarted, so I removed everything from onReceive method, added a log statement and used ADB shell to send BOOT_COMPLETE broadcasts, now the app just closes down without any message when I send the broadcast and the status of the app goes to DEAD in the logcat package dropdown.
I have the following permission defined in my Manifest file:
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
Here is how I'm registering my receiver:
<receiver
android:name=".BootCompleteBroadcastReceiver"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
</receiver>
I have tried without the android:exported="true" tag.
I am doing nothing in the onReceive method, I just have a log statement which is not being printed.
Here's the logcat, the apps seems to be force closed somehow, no error whatsoever:
04-24 19:34:28.639 768 1645 D ReceiverController: getBootReceiverEnabledSetting(com.vysh.theeye) at User(0) with identity: 1001
04-24 19:34:28.639 898 898 D AppChangedReceiver: kill back service:com.vysh.theeye
04-24 19:34:28.642 768 1633 V PackageController: forceStopPackage: com.vysh.theeye
04-24 19:34:28.642 768 1633 I ActivityManager: Force stopping com.vysh.theeye appid=10119 user=0: from pid 768
04-24 19:34:28.643 768 1633 I ActivityManager: Killing 31461:com.vysh.theeye/u0a119 (adj 0): stop com.vysh.theeye
04-24 19:34:28.696 195 822 I BufferQueueProducer: [com.vysh.theeye/com.vysh.theeye.MainActivity](this:0xb4dd5000,id:270,api:1,p:-1,c:195) disconnect(P): api 1
04-24 19:34:28.697 195 822 I BufferQueueConsumer: [com.vysh.theeye/com.vysh.theeye.MainActivity](this:0xb4dd5000,id:270,api:1,p:-1,c:195) getReleasedBuffers: returning mask 0xffffffffffffffff
04-24 19:34:28.697 768 3699 I WindowState: WIN DEATH: Window{a34299a u0 com.vysh.theeye/com.vysh.theeye.MainActivity}
04-24 19:34:28.697 768 3699 V WindowManager: Remove Window{a34299a u0 com.vysh.theeye/com.vysh.theeye.MainActivity} client=1866e45, surface=Surface(name=com.vysh.theeye/com.vysh.theeye.MainActivity) Callers=com.android.server.wm.WindowState$DeathRecipient.binderDied:1217 android.os.BinderProxy.sendDeathNotice:566 <bottom of call stack> <bottom of call stack>
04-24 19:34:28.699 195 195 I BufferQueueConsumer: [com.vysh.theeye/com.vysh.theeye.MainActivity](this:0xb4dd5000,id:270,api:1,p:-1,c:-1) disconnect(C)
04-24 19:34:28.700 768 1633 D ActivityManager: SVC-handleAppDiedLocked: app = ProcessRecord{f2d64fb 31461:com.vysh.theeye/u0a119}, app.pid = 31461
04-24 19:34:28.702 195 821 I BufferQueue: [com.vysh.theeye/com.vysh.theeye.MainActivity](this:0xb4dd5000,id:270,api:1,p:-1,c:-1) ~BufferQueueCore
04-24 19:34:28.704 768 1633 W ActivityManager: Scheduling restart of crashed service com.vysh.theeye/.WatcherService in 10229ms
04-24 19:34:28.705 768 1633 D ActivityManager: removeDyingProviderLocked: cpr=ContentProviderRecord{6c3aebd u0 com.vysh.theeye/com.google.firebase.provider.FirebaseInitProvider} always=false inLaunching=false
04-24 19:34:28.705 768 1633 W ActivityManager: Force removing ActivityRecord{e3b6f3d u0 com.vysh.theeye/.MainActivity t2248}: app died, no saved state

Packaging handheld and wearable Android app together from CLI [NativeScript]

I'm trying to build a Phone+Wear app with NativeScript for Android. I have been able to build both separately and to run them on the Android emulator also. The problem is that I'm unable to package them properly, I mean, I can't package them together in order to install only one APK, that will install the handheld app in the phone and push the wearable app into the watch.
Method and code
Even the post you wrote about Android Wear is quite outdated and the sample code repo is missing, I have been able to build a NativeScript app which APK runs properly in an Android Wear emulator.
I have also a normal phone app built with NativeScript that runs properly in the emulator and in my own device (described bellow).
I have tried to package the app following the steps described by the official documentation in the sections: "Signing the wearable and handheld app separately" and "Package Manually". I have tried both packaging methods but no one is working for me (the last one is also the one described in this post).
Bellow you can see the AndroidManifest.xml and app.gradle files of both applications and the commands that I'm executing to package the signed app:
Wearable App Files
bilbonbizi/wearable/package.json
"nativescript": {
"id": "com.berriart.bilbonbizi",
"tns-android": {
"version": "2.5.0"
}
},
bilbonbizi/wearable/app/App_Resources/Android/AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="__PACKAGE__"
android:versionCode="1"
android:versionName="1.0">
<supports-screens
android:smallScreens="true"
android:normalScreens="true"
android:largeScreens="true"
android:xlargeScreens="true"/>
<uses-sdk
android:minSdkVersion="20"
android:targetSdkVersion="__APILEVEL__"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" />
<uses-feature android:name="android.hardware.location.gps" />
<uses-feature android:name="android.hardware.location.network" />
<uses-feature android:name="android.hardware.type.watch" />
<application
android:name="com.tns.NativeScriptApplication"
android:allowBackup="true"
android:icon="#drawable/icon"
android:label="#string/app_name"
android:theme="#android:style/Theme.DeviceDefault">
<activity
android:name="com.tns.NativeScriptActivity"
android:label="#string/title_activity_kimera"
android:configChanges="keyboardHidden|orientation|screenSize"
android:theme="#style/LaunchScreenTheme">
<meta-data android:name="SET_THEME_ON_LAUNCH" android:resource="#style/AppTheme" />
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.tns.ErrorReportActivity"/>
</application>
</manifest>
bilbonbizi/wearable/app/App_Resources/Android/app.gradle
dependencies {
compile 'com.google.android.support:wearable:+'
}
android {
defaultConfig {
generatedDensities = []
applicationId = "com.berriart.bilbonbizi"
}
aaptOptions {
additionalParameters "--no-version-vectors"
}
}
Handled App Files
bilbonbizi/wearable/package.json
"nativescript": {
"id": "com.berriart.bilbonbizi",
"tns-android": {
"version": "2.5.0"
}
},
bilbonbizi/handheld/app/App_Resources/Android/AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="__PACKAGE__"
android:versionCode="1"
android:versionName="1.0">
<supports-screens
android:smallScreens="true"
android:normalScreens="true"
android:largeScreens="true"
android:xlargeScreens="true"/>
<uses-sdk
android:minSdkVersion="17"
android:targetSdkVersion="__APILEVEL__"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" />
<uses-feature android:name="android.hardware.location.gps" />
<uses-feature android:name="android.hardware.location.network" />
<uses-feature android:name="android.hardware.type.watch" />
<application
android:name="com.tns.NativeScriptApplication"
android:allowBackup="true"
android:icon="#drawable/icon"
android:label="#string/app_name"
android:theme="#style/AppTheme">
<meta-data android:name="com.google.android.wearable.beta.app"
android:resource="#xml/wearable_app_desc"/>
<activity
android:name="com.tns.NativeScriptActivity"
android:label="#string/title_activity_kimera"
android:configChanges="keyboardHidden|orientation|screenSize"
android:screenOrientation="portrait"
android:theme="#style/LaunchScreenTheme">
<meta-data android:name="SET_THEME_ON_LAUNCH" android:resource="#style/AppTheme" />
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.tns.ErrorReportActivity"/>
<service android:name="com.mapbox.mapboxsdk.telemetry.TelemetryService" />
</application>
</manifest>
bilbonbizi/handheld/app/App_Resources/Android/app.gradle
android {
defaultConfig {
generatedDensities = []
applicationId = "com.berriart.bilbonbizi"
}
aaptOptions {
additionalParameters "--no-version-vectors"
noCompress "apk"
}
}
bilbonbizi/handheld/app/App_Resources/Android/xml/wearable_app_desc.xml
<wearableApp package="com.berriart.bilbonbizi">
<versionCode>1</versionCode>
<versionName>1.0</versionName>
<rawPathResId>wearable_app</rawPathResId>
</wearableApp>
Steps to package the app (steps to reproduce the issue)
The signing key used is the same for both:
cd bilbonbizi/wearable
tns platform remove android && tns platform add android && tns prepare android
tns build android --release --key-store-path [hiddenpath] --key-store-password [hiddenpass] --key-store-alias [hiddenalias] --key-store-alias-password [hiddenpass] --copy-to ../handheld/app/App_Resources/Android/raw/wearable_app.apk
cd ../handheld
tns platform remove android && tns platform add android && tns prepare android
tns build android --release --key-store-path [hiddenpath] --key-store-password [hiddenpass] --key-store-alias [hiddenalias] --key-store-alias-password [hiddenpass] --copy-to ../bilbonbizi.apk
cd ..
adb install ./bilbonbizi.apk
After this, the app is properly installed in the phone but is not being pushed to the watch.
Output logs
adb logcat
02-07 20:39:24.600 28861 7360 I ActivityUpsampling: AR upsampling state transition NORMAL_STATE --> NORMAL_STATE, activity: unknown
02-07 20:39:24.625 28861 7360 I Fit:LocationProvider: Location recording changed to : STOP_HIGH_FIDELITY_RECORDING.
02-07 20:39:25.962 3553 3553 D powerUI : accValue============37
02-07 20:39:25.962 3553 3553 D powerUI : mCputempVlaue============37
02-07 20:39:27.965 3553 3553 D powerUI : accValue============41
02-07 20:39:27.965 3553 3553 D powerUI : mCputempVlaue============41
02-07 20:39:28.825 5372 5527 D ClClient: Not sending keepalive. Current connection state=STOPPED
02-07 20:39:29.968 3553 3553 D powerUI : accValue============42
02-07 20:39:29.968 3553 3553 D powerUI : mCputempVlaue============42
02-07 20:39:30.506 7351 7351 I dex2oat : dex2oat took 8.052s (threads: 4) arena alloc=3MB java alloc=5MB native alloc=25MB free=3MB
02-07 20:39:30.964 997 1050 V BackupManagerService: restoreAtInstall pkg=com.berriart.bilbonbizi token=18 restoreSet=35825bc48d1581dc
02-07 20:39:30.966 997 3469 D BackupManagerService: MSG_RUN_RESTORE observer=null
02-07 20:39:30.975 4181 27142 I Backup : [GmsBackupTransport] New restore session, 2 apps
02-07 20:39:31.127 4181 27142 W Conscrypt: Could not set socket write timeout: null
02-07 20:39:31.198 4181 27142 W Conscrypt: Could not set socket write timeout: null
02-07 20:39:31.399 4181 27142 I GmsBackupTransport: Http Response Code : 200
02-07 20:39:31.411 4181 11827 I Backup : [GmsBackupTransport] Current restore package : PackageInfo{ebff3de #pm#}
02-07 20:39:31.411 4181 11827 I Backup : [GmsBackupTransport] A key/value pairs restore
02-07 20:39:31.412 997 3469 D BackupManagerService: initiateOneRestore packageName=#pm#
02-07 20:39:31.446 997 3469 V BackupManagerService: No more packages; finishing restore
02-07 20:39:31.450 4181 6449 I Backup : [GmsBackupTransport] restore finished
02-07 20:39:31.453 997 3469 I BackupRestoreController: restoreFinished for 0
02-07 20:39:31.453 997 3469 I BackupManagerService: Restore complete.
02-07 20:39:31.455 997 1050 W Settings: Setting install_non_market_apps has moved from android.provider.Settings.Global to android.provider.Settings.Secure, returning read-only value.
02-07 20:39:31.456 997 1050 I art : Starting a blocking GC Explicit
02-07 20:39:31.687 997 1050 I art : Explicit concurrent mark sweep GC freed 192257(10MB) AllocSpace objects, 10(2MB) LOS objects, 33% free, 25MB/37MB, paused 2.673ms total 231.207ms
02-07 20:39:31.696 4764 4764 D BluetoothMapAppObserver: onReceive
02-07 20:39:31.696 4764 4764 D BluetoothMapAppObserver: The installed package is: com.berriart.bilbonbizi
02-07 20:39:31.700 4764 4764 D BluetoothMapAppObserver: Found 0 application(s) with intent android.bluetooth.action.BLUETOOTH_MAP_PROVIDER
02-07 20:39:31.703 4764 4764 D BluetoothMapAppObserver: Found 0 application(s) with intent android.bluetooth.action.BLUETOOTH_MAP_IM_PROVIDER
02-07 20:39:31.706 7337 7337 I art : System.exit called, status: 0
02-07 20:39:31.706 7337 7337 I AndroidRuntime: VM exiting with result code 0.
02-07 20:39:31.719 997 7064 W ActivityManager: Permission Denial: Accessing service ComponentInfo{com.google.android.music/com.google.android.music.dial.DialMediaRouteProviderService} from pid=6893, uid=1008$
that is not exported from uid 10065
02-07 20:39:31.722 7208 7364 D Documents: Update found 8 roots in 14ms
02-07 20:39:31.730 997 4095 W ActivityManager: Permission Denial: Accessing service ComponentInfo{com.google.android.music/com.google.android.music.dial.DialMediaRouteProviderService} from pid=12711, uid=1002
7 that is not exported from uid 10065
02-07 20:39:31.730 997 3363 I InputReader: Reconfiguring input devices. changes=0x00000010
02-07 20:39:31.802 7117 7117 W ContextImpl: Calling a method in the system process without a qualified user: android.app.ContextImpl.startService:1221 android.content.ContextWrapper.startService:581 android.co
ntent.ContextWrapper.startService:581 com.bq.gallerybq.app.PackagesMonitor.onReceive:40 android.app.ActivityThread.handleReceiver:2725
02-07 20:39:31.823 4108 4108 D CarrierServiceBindHelper: Receive action: android.intent.action.PACKAGE_ADDED
02-07 20:39:31.824 4108 4108 D CarrierServiceBindHelper: mHandler: 3
02-07 20:39:31.824 4108 4108 D CarrierConfigLoader: mHandler: 9 phoneId: 0
02-07 20:39:31.838 997 7064 I ActivityManager: Start proc 7371:com.google.android.partnersetup/u0a12 for broadcast com.google.android.partnersetup/.RlzPingBroadcastReceiver
02-07 20:39:31.891 7371 7371 W System : ClassLoader referenced unknown path: /system/priv-app/GooglePartnerSetup/lib/arm
02-07 20:39:31.970 3553 3553 D powerUI : accValue============39
02-07 20:39:31.970 3553 3553 D powerUI : mCputempVlaue============39
02-07 20:39:31.980 9247 9247 I Finsky : [1] com.google.android.finsky.wear.WearSupportService.a(307): Wear auto install disabled for package com.berriart.bilbonbizi
02-07 20:39:31.992 997 3623 I ActivityManager: Killing 6845:com.pushbullet.android/u0a118 (adj 15): empty #17
02-07 20:39:32.072 997 7067 D ActivityManager: cleanUpApplicationRecord -- 6845
02-07 20:39:32.116 9247 9247 I Finsky : [1] com.google.android.finsky.utils.PermissionPolicies$PermissionPolicyService.onStartCommand(115): post-install permissions check for com.berriart.bilbonbizi
02-07 20:39:32.117 3947 7369 I WearablePkgInstaller: Setting DataItem to install wearable apps for com.berriart.bilbonbizi
02-07 20:39:32.155 9247 9247 I Finsky : [1] com.google.android.finsky.utils.bd.run(2300): Package state data is missing for com.berriart.bilbonbizi
02-07 20:39:32.303 5372 5372 V ApplicationReceiver:onReceive: 2017-02-07 19:39:32-03f1a6a6-fd89-4d04-98ad-0967d0ad6a4f-Application install message is received ver:1.2.2
02-07 20:39:32.304 5372 5372 V ApplicationReceiver:onReceive: 2017-02-07 19:39:32-03f1a6a6-fd89-4d04-98ad-0967d0ad6a4f-ApplicationReceiver detectes the installation of package:com.berriart.bilbonbizi ver:1.2.2
02-07 20:39:32.351 6446 7009 I Icing : Usage reports 0 indexed 0 rejected 0 imm upload false
02-07 20:39:32.361 487 487 I MSM-irqbalance: Decided to move IRQ177 from CPU4 to CPU6
02-07 20:39:32.367 6446 7009 I Icing : Usage reports 0 indexed 0 rejected 0 imm upload false
02-07 20:39:32.375 6446 7401 W IcingInternalCorpora: getNumBytesRead when not calculated.
02-07 20:39:32.503 9247 9247 I Finsky : [1] com.google.android.finsky.wear.bc.onPostExecute(2601): Writing installed apps for account [9oegQYjV2A_lG13uYgoCCNs4Sr8]
02-07 20:39:32.714 4764 5061 D bt_btm_pm: btm_pm_snd_md_req switching from SNIFF to ACTIVE.
02-07 20:39:32.747 3947 4409 V WearableLS: bindService: com.google.android.wearable.app/com.google.android.clockwork.companion.DispatchingWearableListenerService
02-07 20:39:32.749 3947 4409 V WearableLS: unbindService: com.google.android.wearable.app/com.google.android.clockwork.companion.DispatchingWearableListenerService
02-07 20:39:32.795 3947 4409 V WearableLS: bindService: com.google.android.wearable.app/com.google.android.clockwork.companion.DispatchingWearableListenerService
02-07 20:39:32.798 3947 4409 V WearableLS: unbindService: com.google.android.wearable.app/com.google.android.clockwork.companion.DispatchingWearableListenerService
02-07 20:39:32.994 4764 5061 D bt_btm_pm: btm_pm_proc_mode_change switched from UNKNOWN to ACTIVE.
02-07 20:39:33.106 3947 7369 I WearablePkgInstaller: Setting DataItem to install wearable apps for com.berriart.bilbonbizi
02-07 20:39:33.148 3947 4409 V WearableLS: bindService: com.google.android.wearable.app/com.google.android.clockwork.companion.DispatchingWearableListenerService
02-07 20:39:33.151 3947 4409 V WearableLS: unbindService: com.google.android.wearable.app/com.google.android.clockwork.companion.DispatchingWearableListenerService
02-07 20:39:33.200 3947 4409 V WearableLS: bindService: com.google.android.wearable.app/com.google.android.clockwork.companion.DispatchingWearableListenerService
02-07 20:39:33.203 3947 4409 V WearableLS: unbindService: com.google.android.wearable.app/com.google.android.clockwork.companion.DispatchingWearableListenerService
02-07 20:39:33.270 9247 9639 I PlayCommon: [1735] com.google.android.play.a.g.e(909): Preparing logs for uploading
02-07 20:39:33.270 9247 9639 I PlayCommon: [1735] com.google.android.play.a.g.e(911): No file ready to send
02-07 20:39:33.372 6446 6714 I Icing : Indexing FDFCB9FA2CA9FD93DE9DD0B9F5797CCEABC83AD6 from com.google.android.gms
02-07 20:39:33.449 3947 4409 V WearableLS: bindService: com.google.android.wearable.app/com.google.android.clockwork.companion.DispatchingWearableListenerService
02-07 20:39:33.451 3947 4409 V WearableLS: unbindService: com.google.android.wearable.app/com.google.android.clockwork.companion.DispatchingWearableListenerService
02-07 20:39:33.509 6446 6714 I Icing : Indexing done FDFCB9FA2CA9FD93DE9DD0B9F5797CCEABC83AD6
02-07 20:39:33.974 3553 3553 D powerUI : accValue============36
02-07 20:39:33.974 3553 3553 D powerUI : mCputempVlaue============36
02-07 20:39:35.978 3553 3553 D powerUI : accValue============35
02-07 20:39:35.978 3553 3553 D powerUI : mCputempVlaue============35
02-07 20:39:37.360 487 487 I MSM-irqbalance: Decided to move IRQ130 from CPU4 to CPU6
02-07 20:39:37.982 3553 3553 D powerUI : accValue============35
02-07 20:39:37.982 3553 3553 D powerUI : mCputempVlaue============35
02-07 20:39:38.455 3947 4409 V WearableLS: bindService: com.google.android.wearable.app/com.google.android.clockwork.companion.DispatchingWearableListenerService
02-07 20:39:38.457 3947 4409 V WearableLS: unbindService: com.google.android.wearable.app/com.google.android.clockwork.companion.DispatchingWearableListenerService
I have pasted a long log in order to provide as much info as possible, but probably the most relevant logs are: (picked from above)
BluetoothMapAppObserver: The installed package is: com.berriart.bilbonbizi
CarrierServiceBindHelper: Receive action: android.intent.action.PACKAGE_ADDED
Finsky : [1] com.google.android.finsky.wear.WearSupportService.a(307): Wear auto install disabled for package com.berriart.bilbonbizi
Finsky : [1] com.google.android.finsky.utils.PermissionPolicies$PermissionPolicyService.onStartCommand(115): post-install permissions check for com.berriart.bilbonbizi
WearablePkgInstaller: Setting DataItem to install wearable apps for com.berriart.bilbonbizi
Finsky : [1] com.google.android.finsky.utils.bd.run(2300): Package state data is missing for com.berriart.bilbonbizi
ApplicationReceiver:onReceive: 2017-02-07 19:39:32-03f1a6a6-fd89-4d04-98ad-0967d0ad6a4f-Application install message is received ver:1.2.2
ApplicationReceiver:onReceive: 2017-02-07 19:39:32-03f1a6a6-fd89-4d04-98ad-0967d0ad6a4f-ApplicationReceiver detectes the installation of package:com.berriart.bilbonbizi ver:1.2.$
WearablePkgInstaller: Setting DataItem to install wearable apps for com.berriart.bilbonbizi
It's being extremely difficult for me to find information and understand the following log line:
Wear auto install disabled for package com.berriart.bilbonbizi
And also it is really strange to find the following line taking into account that I didn't change any version number and the one written in the manifest is 1.0:
the installation of package:com.berriart.bilbonbizi ver:1.2.$
Devices Information
PC
tns --version
# 2.5.0
cat /etc/lsb-release
# DISTRIB_ID=Ubuntu
# DISTRIB_RELEASE=16.10
# DISTRIB_CODENAME=yakkety
# DISTRIB_DESCRIPTION="Ubuntu 16.10"
tns-core-modules: "2.5.0"
tns-android: "2.5.0"
Phone
BQ Aquaris M5 (Android 6.0.1)
SmartWatch
Sony Smartwatch 3 (Compilation Number M1D64T)
Question
As I said, when the final APK is built and installed on a phone the wearable app is not being pushed to the connected watch. Is there anything wrong in the code/steps described above?
Let me know if I can help you by providing more information.
it could be useful to see the build.gradle files of your modules (both phone and weareable ones).
Also, you did not specify if you are trying to build an Android Wear App for Android Wear 2.0. I suppose you only need the Android Wear 1.x weareable app, since those are the only one that can be installed automatically over the air when installing the app on the handset.
In order for it to work correctly, your build.gradle file of the handset module should contains these dependencies:
dependencies {
...
compile 'com.google.android.gms:play-services-wearable:10.0.1'
compile 'com.android.support:support-compat:25.1.0'
wearApp project(':wearable')
...
}
Doing this you should normally just build and sign the handset apk

Google PlacePicker Closes Immediately After Launch

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!

Android app can not start for some devices which use MTK6592

The app runs fun for most of devices.However there are some of devices which use MTK6592 or so can not launch it.The log which I get is like below:
04-21 15:50:42.019 25924-25953/com.q.q E/CellLocation﹕ create GsmCellLocation
04-21 15:50:42.035 25924-25924/com.q.q E/linker﹕ load_library(linker.cpp:759): library "libmaliinstr.so" not found
04-21 15:50:42.037 25924-25924/com.qingdaonews.bus E/﹕ appName=com.q.q, acAppName=com.android.cts.openglperf

android eclipse java logcat runtime errors

04-21 02:27:40.341: E/vold(27): Error opening switch name path '/sys/class/switch/test2' (No such file or directory)
04-21 02:27:40.341: E/vold(27): Error bootstrapping switch '/sys/class/switch/test2' (No such file or directory)
04-21 02:27:40.341: E/vold(27): Error opening switch name path '/sys/class/switch/test' (No such file or directory)
04-21 02:27:40.341: E/vold(27): Error bootstrapping switch '/sys/class/switch/test' (No such file or directory)
04-21 02:27:49.111: E/BatteryService(52): usbOnlinePath not found
04-21 02:27:49.111: E/BatteryService(52): batteryVoltagePath not found
04-21 02:27:49.111: E/BatteryService(52): batteryTemperaturePath not found
04-21 02:27:49.111: E/SurfaceFlinger(52): Couldn't open /sys/power/wait_for_fb_sleep or /sys/power/wait_for_fb_wake
04-21 02:27:52.211: E/EventHub(52): could not get driver version for /dev/input/mouse0, Not a typewriter
04-21 02:27:52.211: E/EventHub(52): could not get driver version for /dev/input/mice, Not a typewriter
04-21 02:27:53.231: E/System(52): Failure starting core service
04-21 02:27:53.231: E/System(52): java.lang.SecurityException
04-21 02:27:53.231: E/System(52): at android.os.BinderProxy.transact(Native Method)
04-21 02:27:53.231: E/System(52): at android.os.ServiceManagerProxy.addService(ServiceManagerNative.java:146)
04-21 02:27:53.231: E/System(52): at android.os.ServiceManager.addService(ServiceManager.java:72)
04-21 02:27:53.231: E/System(52): at com.android.server.ServerThread.run(SystemServer.java:176)
04-21 02:27:53.251: E/AndroidRuntime(52): Crash logging skipped, no checkin service
04-21 02:28:01.915: E/ActivityThread(102): Failed to find provider info for android.server.checkin
04-21 02:28:03.255: E/ActivityThread(102): Failed to find provider info for android.server.checkin
04-21 02:28:03.325: E/ActivityThread(102): Failed to find provider info for android.server.checkin
04-21 02:28:05.265: E/MediaPlayerService(31): Couldn't open fd for content://settings/system/notification_sound
04-21 02:28:05.295: E/MediaPlayer(52): Unable to to create media player
04-21 02:28:13.005: E/AndroidRuntime(131): ERROR: thread attach failed
04-21 02:28:14.785: E/AndroidRuntime(210): ERROR: thread attach failed
04-21 02:28:14.975: E/jdwp(222): Failed sending req to debugger: Broken pipe (-1 of 27)
04-21 02:28:14.975: E/jdwp(222): Failed sending req to debugger: Broken pipe (-1 of 27)
04-21 02:28:14.975: E/jdwp(222): Failed sending reply to debugger: Broken pipe
I think the problem is in your native function signature. You should decare it with JNIEXPORT and JNICALL.
Use the javah tool for generating header and source files.
Here is example: JNI Example
And next time try to find some related answers like java-lang-unsatisfiedlinkerror before asking another question.

Categories

Resources