I am trying to run a simple app in my device I am using a GALAXY S5 but the app would never launch, in the Android Studio the log cat is just loading and loading like this:
-10 19:07:07.856 3006-3006/? D/STATUSBAR-IconMerger﹕ checkOverflow(576), More:false, Req:false Child:3
08-10 19:07:08.836 3006-3006/? D/STATUSBAR-NetworkController onSignalStrengthsChanged signalStrength=SignalStrength: 99 -1 -1 -1 -1 -1 -1 13 -121 -13 16 -1 2147483647 gsm|lte 0x0 level=0
08-10 19:07:09.306 912-6264/? D/SSRMv2:SIOP﹕ SIOP:: AP = 280, PST = 287, Delta = -1
08-10 19:07:09.316 912-6264/? D/AmoledAdjustTimer﹕ prevTemp = 264, currTemp = 264, prevStep = 4, currStep = 4
08-10 19:07:09.866 3006-3006/? D/STATUSBAR-NetworkController﹕ refreshSignalCluster - setNWBoosterIndicators(false)
08-10 19:07:09.866 3006-3006/? D/STATUSBAR-NetworkController﹕ refreshSignalCluster: data=0 bt=false
08-10 19:07:09.886 3006-3006/? D/STATUSBAR-IconMerger﹕ checkOverflow(576), More:false, Req:false Child:3
08-10 19:07:09.916 912-3520/? D/BatteryService﹕ level:100, scale:100, status:5, health:2, present:true, voltage: 4372, temperature: 263, technology: Li-ion, AC powered:false, USB powered:true, Wireless powered:false, icon:17303678, invalid charger:0, online:6, current avg:1000, charge type:0, power sharing:false
This is the console :
Installing com.example.juano.stiktag
DEVICE SHELL COMMAND: pm install -r "/data/local/tmp/com.example.juano.stiktag"
pkg: /data/local/tmp/com.example.juano.stiktag
Success
Launching application:com.example.juano.stiktag/com.example.juano.stiktag.LoginActivity.
DEVICE SHELL COMMAND: am start -n "com.example.juano.stiktag/com.example.juano.stiktag.LoginActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Starting: Intent { act=android.intent.action.MAIN cat= [android.intent.category.LAUNCHER] cmp=com.example.juano.stiktag/.LoginActivity }
java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.example.juano.stiktag/.LoginActivity } from null (pid=13739, uid=2000) not exported from uid 10247
at android.os.Parcel.readException(Parcel.java:1465)
at android.os.Parcel.readException(Parcel.java:1419)
at android.app.ActivityManagerProxy.startActivityAsUser(ActivityManagerNative.java:2367)
at com.android.commands.am.Am.runStart(Am.java:680)
at com.android.commands.am.Am.onRun(Am.java:270)
at com.android.internal.os.BaseCommand.run(BaseCommand.java:47)
at com.android.commands.am.Am.main(Am.java:76)
at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:301)
Sometimes it finish but still the app never launch, however in the virtual device works, I tried to follow all the steps on the android studio website enable usb debugger, please any help will be highly appreciated, Thanks!
Related
There are a few questions out there that have similar issues but none of the solutions help. I'm trying to connect an Android Things Raspberry Pi to Wifi. My 2.4 GHz wifi ssid is 'cake' and I even removed the passphrase to see if that would help. Here is what comes out in the logcat:
09-20 01:37:00.340 1233 1233 D WifiSetupService: onStartCommand(Intent { act=WifiSetupService.Connect cmp=com.google.wifisetup/.WifiSetupService (has extras) })
09-20 01:37:00.341 1233 1233 I WifiConfigurator: Connecting to network with SSID "cake"
09-20 01:37:00.345 1233 1251 W WifiManager: com.google.wifisetup attempted call to setWifiApEnabled: enabled = false
09-20 01:37:00.346 311 546 D WifiService: setWifiEnabled: true pid=1233, uid=1000, package=com.google.wifisetup
09-20 01:37:00.349 1233 1233 V WifiWatcher: Network state changed to DISCONNECTED
09-20 01:37:01.258 1233 1251 D WifiConfigurator: Adding new network
09-20 01:37:01.873 311 380 E WifiConfigManager: Cannot find network with networkId -1 or configKey "cake"NONE
09-20 01:37:01.874 311 380 E WifiConfigManager: Cannot find network with configKey "cake"NONE
09-20 01:37:02.648 311 323 D WificondControl: Scan result ready event
09-20 01:37:03.423 311 380 D WifiConfigStore: Writing to stores completed in 1304 ms.
09-20 01:37:03.430 311 380 D WifiStateMachine: connectToUserSelectNetwork netId 0, uid 1000, forceReconnect = false
09-20 01:37:04.261 311 380 D WifiConfigStore: Writing to stores completed in 823 ms.
09-20 01:37:34.306 1233 1251 E WifiConfigurator: Wifi failed to connect in 30000 ms
09-20 01:39:49.672 1233 1233 D WifiSetupService: onStartCommand(Intent { act=WifiSetupService.Connect cmp=com.google.wifisetup/.WifiSetupService (has extras) })
09-20 01:39:49.673 1233 1233 I WifiConfigurator: Connecting to network with SSID "cake"
09-20 01:39:49.675 1233 1279 W WifiManager: com.google.wifisetup attempted call to setWifiApEnabled: enabled = false
09-20 01:39:49.676 311 322 D WifiService: setWifiEnabled: true pid=1233, uid=1000, package=com.google.wifisetup
09-20 01:39:49.681 1233 1279 D WifiConfigurator: Updating existing network 0
09-20 01:39:49.906 311 380 D WifiConfigStore: Writing to stores completed in 219 ms.
09-20 01:39:49.909 311 380 D WifiStateMachine: connectToUserSelectNetwork netId 0, uid 1000, forceReconnect = false
09-20 01:39:49.945 311 380 D WifiConfigStore: Writing to stores completed in 32 ms.
09-20 01:39:50.195 311 920 D WificondControl: Scan result ready event
09-20 01:40:19.980 1233 1279 E WifiConfigurator: Wifi failed to connect in 30000 ms
Here is what I'm typing in the adb shell
rpi3:/ $ am startservice -n com.google.wifisetup/.WifiSetupService -a WifiSetupService.Connect -e ssid cake
I had also some issues setting up the Wifi.
Blundell's answer to my question solved the issues
Network: Wi-Fi cannot connect to the internet if Ethernet is also
connected to a network without internet access.
https://developer.android.com/things/preview/releases.html
I had to remove the Ethernet cable from the Pi-3 and then it connected to my WiFi
If you have no application installed on the Pi you can observce your connectivity state by attaching an external display using the HDMI port (a monitor would do the job).
You should see a screen like this:
I am trying to analyse a simple HelloJni project (built in Android Studio) using Valgrind and I am facing some troubles in the final steps when executing the application with Valgrind.
I am developing on a Nexus 4 device with Android 5.1.
Installation info:
I have used the "build_valgrind.sh" script to cross-compile valgrind (for api android-21) and to copy it to /data/local/Inst.
I have also copied "start_valgrind.sh" to /data/local/ folder, giving all permissions ("chmod 777) to the script.
Then I set properties to the HelloJni app.
adb shell "su -c 'setprop wrap.com.example.hellojni \"logwrapper /data/local/start_valgrind.sh \"'"
The actual problem comes when I try to execute the app:
adb shell "su -c 'am start -a android.intent.action.MAIN -n com.example.hellojni/.HelloJni'"
The logcat output I get is posted at the end.
When I execute the HelloJni app without setting logwrapper properties, it executes as expected. I am not sure what I am doing wrong, but it looks as if I have problems with "CheckJNI is OFF". Has someone been able to execute any application with this approach? Any help will be appreciated.
logcat_output
--------- beginning of main
I/Finsky (19498): [1] com.google.android.finsky.services.j.a(148): Installation state replication succeeded.
E/kickstart( 627): Wrote to /sys/power/wake_lock
E/kickstart( 627): Received file "/dev/block/platform/msm_sdcc.1/by-name/m9kefs1"
E/kickstart( 627): 786432 bytes transferred in 0.185s (4.06 MBps)
E/kickstart( 627): Successfully downloaded files from target
E/kickstart( 627): Wrote to /sys/power/wake_unlock
E/kickstart( 627): Sahara protocol completed
D/AndroidRuntime(22076): >>>>>> START com.android.internal.os.RuntimeInit uid 0 <<<<<<
D/AndroidRuntime(22076): CheckJNI is OFF
D/AndroidRuntime(22077): >>>>>> START com.android.internal.os.RuntimeInit uid 0 <<<<<<
D/AndroidRuntime(22077): CheckJNI is OFF
W/app_process32_o(22077): type=1400 audit(0.0:317): avc: denied { write } for name="system#framework#boot.art" dev="mmcblk0p23" ino=185108 scontext=u:r:shell:s0 tcontext=u:object_r:dalvikcache_data_file:s0 tclass=file
D/AndroidRuntime(22076): Calling main entry com.android.commands.am.Am
--------- beginning of system
I/ActivityManager(18563): START u0 {act=android.intent.action.MAIN flg=0x10000000 cmp=com.example.hellojni/.HelloJni} from uid 0 on display 0
V/WindowManager(18563): addAppToken: AppWindowToken{385169a4 token=Token{13e037 ActivityRecord{2ce09936 u0 com.example.hellojni/.HelloJni t3}}} to stack=1 task=3 at 0
D/AndroidRuntime(22077): Calling main entry com.android.commands.am.Am
I/art (22110): Late-enabling -Xcheck:jni
I/start_valgrind.sh(22127): valgrind: cannot create log file '/sdcard/valgrind.log.22128': Permission denied
I/start_valgrind.sh(22127): start_valgrind.sh terminated by exit(1)
W/Zygote (18317): Error reading pid from wrapped process, child may have died
W/Zygote (18317): java.io.EOFException
W/Zygote (18317): at libcore.io.Streams.readFully(Streams.java:83)
W/Zygote (18317): at java.io.DataInputStream.readInt(DataInputStream.java:103)
W/Zygote (18317): at com.android.internal.os.ZygoteConnection.handleParentProc(ZygoteConnection.java:979)
W/Zygote (18317): at com.android.internal.os.ZygoteConnection.runOnce(ZygoteConnection.java:276)
W/Zygote (18317): at com.android.internal.os.ZygoteInit.runSelectLoop(ZygoteInit.java:788)
W/Zygote (18317): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
I/ActivityManager(18563): Start proc 22110:com.example.hellojni/u0a125 for activity com.example.hellojni/.HelloJni
D/AndroidRuntime(22076): Shutting down VM
I/art (22076): Debugger is no longer active
D/AndroidRuntime(22077): Shutting down VM
I/art (22077): Debugger is no longer active
I/Zygote (18317): Process 22110 exited cleanly (1)
W/ActivityManager(18563): Process ProcessRecord{173c48d3 22110:com.example.hellojni/u0a125} failed to attach
I/ActivityManager(18563): Killing 22110:com.example.hellojni/u0a125 (adj -100): start timeout
I have been confused by a random crash in my app since I updated to cordova 5 and started using crosswalk.
This is my logcat:
D/STATUSBAR-NetworkController( 1110): refreshSignalCluster - setNWBoosterIndicators(false)
D/STATUSBAR-NetworkController( 1110): refreshSignalCluster: data=-1 bt=false
D/STATUSBAR-IconMerger( 1110): checkOverflow(1344), More:false, Req:false Child:5
W/ActivityManager( 891): Permission Denial: getCurrentUser() from pid=32252, uid=10037 requires android.permission.INTERACT_ACROSS_USERS
I/ActivityManager( 891): Process com.tesingguru.tesing_Guru (pid 29852) (adj 0) has died.
I/WindowState( 891): WIN DEATH: Window{42fb82c0 u0 com.tesingguru.tesing_Guru/com.tesingguru.tesing_Guru.MainActivity}
I/SurfaceFlinger( 329): id=3847 Removed NainActivit (16/29)
I/SurfaceFlinger( 329): id=3847 Removed NainActivit (-2/29)
I/FactoryTest( 891): isRunningFactoryApp=false
I/FactoryTest( 891): isRunningFactoryApp=false
W/ActivityManager( 891): Force removing ActivityRecord{4303e860 u0 com.tesingguru.tesing_Guru/.MainActivity t221}: app died, no saved state
I am completely confused by this? The line I am suspecting is:
W/ActivityManager( 891): Permission Denial: getCurrentUser() from pid=32252, uid=10037 requires android.permission.
I have added a new System Service into Android Framework in earlier versions (4.4) following this tutorial from Texas Instruments
But when I try to do a similar thing in Android Lollipop, the SELinux policy denies me to do so.
This is the output from logcat.
05-11 15:49:51.362 248 248 I SystemServer: Test Service Starting
05-11 15:49:51.364 248 248 I TestManagerService: Started Test Manager Service
05-11 15:49:51.370 54 54 E SELinux : avc: denied { add } for service=TestManagerService scontext=u:r:system_server:s0 tcontext=u:object_r:default_android_service:s0 tclass=service_manager
05-11 15:49:51.371 54 54 E ServiceManager: add_service('TestManagerService',28) uid=1000 - PERMISSION DENIED
05-11 15:49:51.378 248 248 E SystemServer: Failure starting TestManagerService
05-11 15:49:51.378 248 248 E SystemServer: java.lang.SecurityException
05-11 15:49:51.378 248 248 E SystemServer: at android.os.BinderProxy.transactNative(Native Method)
05-11 15:49:51.378 248 248 E SystemServer: at android.os.BinderProxy.transact(Binder.java:496)
05-11 15:49:51.378 248 248 E SystemServer: at android.os.ServiceManagerProxy.addService(ServiceManagerNative.java:150)
05-11 15:49:51.378 248 248 E SystemServer: at android.os.ServiceManager.addService(ServiceManager.java:72)
05-11 15:49:51.378 248 248 E SystemServer: at com.android.server.SystemServer.startOtherServices(SystemServer.java:551)
05-11 15:49:51.378 248 248 E SystemServer: at com.android.server.SystemServer.run(SystemServer.java:257)
05-11 15:49:51.378 248 248 E SystemServer: at com.android.server.SystemServer.main(SystemServer.java:171)
05-11 15:49:51.378 248 248 E SystemServer: at java.lang.reflect.Method.invoke(Native Method)
05-11 15:49:51.378 248 248 E SystemServer: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:723)
05-11 15:49:51.378 248 248 E SystemServer: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:613)
I do not want to disable SELinux policy. I just want the policy to allow my new service too. What should I do?
Check this link: http://androidosp.blogspot.com.tr/2014/11/selinux-seandroid-exceptions-for-system.html
You can simply goto: /external/sepolicy/service_contexts
and add your new service there. Thats it!
To file:
android-dev\external\sepolicy\service.te
Add:
type mytest_service, system_api_service, system_server_service,
service_manager_type;
To file:
android-dev\external\sepolicy\service_contexts
Add:
mytestservice u:object_r:mytest_service:s0
where mytestservice your name service
It's help me
In Android 7.1.1 the service_contexts file has moved to system/sepolicy
to add A service "foo" to the policy add to the file service_contexts
foo u:object_r:foo_service:s0
And in service.te add:
type foo_service, app_api_service, system_server_service, service_manager_type;
A device specific policy can be created by adding a service_contexts & service.te file in the devices sepolicy directory: device/myDevice/versionName/sepolicy
add in your sepolicy file
allow system_server default_android_service:service_manager add
This is not really something I'm developing, more like something I'm trying to debug. For some reason my HTC Desire HD keeps disconnecting from my car's bluetooth. It worked fine on phone's original rom, then I upgraded to Gingerbread (HTC rom) and it started to disconnect. I'm not sure what happened next (possibly I've installed something? mb the car's computer was reset as I had a service?) but it actually started to work after a few months and all was good until I upgraded again to 2.3.5 (HTC official upgrade). The phone connects to my car without any issues, then looses the connection within a minute and will not reconnect until the phone or the car's restarted. Here's some log data that I was able to collect in case someone might be familiar with how the bluetooth works on android:
I//system/bin/btld(23506): ##### USERIAL_Ioctl: BT_Sleep, USERIAL_IO_BT_WAKE_DEASSERT ####
W/ (23507): bta_dm_pm_timer_cback 0x255fa4
W/ (23507): dm_pm_timer expires 0
W/ (23507): proc dm_pm_timer expires
I//system/bin/btld(23506): ##### USERIAL_Ioctl: BT_Wake, USERIAL_IO_BT_WAKE_ASSERT ####
I/PTIM (23507): Call GKI_add_to_timer_list in ptim_start_timer
W/ (23507): start dm_pm_timer:0, 5000
D/dalvikvm(23586): GC_CONCURRENT freed 381K, 48% free 3295K/6279K, external 0K/0K, paused 2ms+3ms
I/keystore( 1264): uid: 1000 action: e -> 7 state: 1 -> 1 retry: 4
I/BtAtPhonebook( 1631): Refreshed phonebook ME with 255 results
I/keystore( 1264): uid: 1000 action: e -> 7 state: 1 -> 1 retry: 4
I/BtAtPhonebook( 1631): Refreshed phonebook ME with 255 results
D/dalvikvm(15887): GC_EXPLICIT freed 124K, 44% free 4129K/7303K, external 0K/512K, paused 79ms
I//system/bin/btld(23506): ##### USERIAL_Ioctl: BT_Sleep, USERIAL_IO_BT_WAKE_DEASSERT ####
W/ (23507): stop dm_pm_timer:0
W/HeadsetBase.cpp( 1631): RFCOMM poll() returned success (1), but with an unexpected revents bitmask: 0x11
I/HeadsetBase( 1631): headset read error 5
I//system/bin/btld(23506): send_ctrl_msg: [BTL_IFS CTRL] send BTLIF_DISCONNECT_IND (AG) 8 pbytes (hdl 18)
I//system/bin/btld(23506): BTL_IF_DisconnectDatapath: Disconnect datapath on handle 21
I//system/bin/btld(23506): wrp_setup_rxflow: wrp_setup_rxflow : 0 (fd 21)
I//system/bin/btld(23506): wsactive_del: delete wsock 21 from active list [212ef8]
I//system/bin/btld(23506): wrp_close_data: wrp_close 21 [brcm.bt.btlif]
I//system/bin/btld(23506): wsactive_del: delete wsock 21 from active list [212ef8]
I/BTL_IFC ( 1631): btl_ifc_ctrl_rx: [BTL_IFC CTRL] recv BTLIF_DISCONNECT_IND (AG) 10 pbytes (hdl 92)
D/BLZ_WRAPPER( 1631): blz_ctrl_msg: [blz ctrl] received message [BTLIF_DISCONNECT_IND]
D/BLZ_WRAPPER( 1631): blz_ctrl_msg: Channel disconnected remotely, rf_ch 65535
I/BTL_IFC_WRP( 1631): wrp_find_wsock_by_rfhdl: wrp_find_wsock_by_rfhdl : no entry found, lst 0, rfchan 65535
I/BLZ_WRAPPER( 1631): btl_if_close: btl_if_close (105)
D/BLZ_WRAPPER( 1631): btl_if_close: [btl_if_close] : (105:100), disc_pending 0, asnc 0, selct 0, flags 2
I/BTL_IFC ( 1631): send_ctrl_msg: [BTL_IFC CTRL] send BTLIF_DISCONNECT_REQ (AG) 8 pbytes (hdl 92)
W/ (23507): Could not find conn_info for chdl=0x3
D/BluetoothHeadsetService( 1631): Device: 00:13:A9:A1:19:1E Headset state 2 -> 0, result = 0
W/ (23507): BTA_DM_LINK_DOWN_EVT::bdaddr 00:13:a9:a1:19:1e reason x15
D/DTUN_HCID4(23540): dtun_dm_sig_link_down()
I/DTUN_HCID4(23540): dtun_dm_sig_link_down device = 0xf750 handle = 256 reason = 0x15
I//system/bin/btld(23506): send_ctrl_msg: [BTL_IFS CTRL] send BTLIF_DTUN_SIGNAL_EVT (CTRL) 11 pbytes (hdl 17)
D/BTL_IFC_WRP( 1631): wrp_close_s_only: wrp_close_s_only [105] (105:100) [brcm.bt.btlif]
D/BTL_IFC_WRP( 1631): wrp_close_s_only: data socket closed
D/BTL_IFC_WRP( 1631): wsactive_del: delete wsock 105 from active list [ad3ca3c0]
I/DTUN_HCID4(23540): [embedded]LINK_DOWN name = UHP, address = 00:13:A9:A1:19:1E, reason = 0x15
D/BluetoothService( 1379): Device property changed:00:13:A9:A1:19:1E property:Connected
I/BluetoothHeadsetService( 1631): [embedded] HSP/HFP state : address: 00:13:A9:A1:19:1E name: UHP State:2->0
I/BTL_IFC ( 1631): send_ctrl_msg: [BTL_IFC CTRL] send BTLIF_DISCONNECT_REQ (SCO) 0 pbytes (hdl 102)
W/ (23507): Could not find conn_info with active SCO
I/BluetoothA2dpService( 1379): BluetoothHeadset disconnected, remove AV CONNECT_TO msg
I/StatusBarPolicy( 1577): updateBluetooth bt icon:true,HS:0,A2DP:false
D/AudioPolicyManagerBase( 1260): setDeviceConnectionState() device: 40, state 0, address 00:13:A9:A1:19:1E
I/AudioPolicyManagerBase( 1260): setOutputDevice() output 4 device 0 delayMs 0
I/AudioPolicyManagerBase( 1260): setOutputDevice() setting same device 0 or null device for output 4
I/BluetoothDeviceProfileState( 1379): Entering IncomingHandsfree state with: 6
I/BluetoothDeviceProfileState( 1379): Processing command:6
I/BluetoothDeviceProfileState( 1379): Entering ACL Connected state with: 102
I/NaviReceiver(23556): Got BluetoothHeadset.ACTION_STATE_CHANGED
I/NaviReceiver(23556): conn state = 0