Android Question Wear 2.0 development

Dave G

Active Member
Licensed User
Using the new WatchfaceWear2_0 project and Watchface 2.0 library.

Having issues getting the apk installed in debug or release (see below) if I'm using watchface/wear, but I can use ADB to install it manually.

I can't deploy to watch or phone (same errors).

With CustomBuildAction of:
CustomBuildAction: 4, C:\windows\system32\xcopy.exe, WatchfaceWear.apk ..\..\WatchfaceMobile\resource\raw\watchfacewear.apk /Y)

Running custom action. Error
Process timed out.


If I comment out the CustomBuildAction: then it get another error related to privilege (see below):

Installing file to device. Error
Security exception: Permission Denial: starting Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=de.amberhome.watchfacedemo/.main } from null (pid=10020, uid=2000) not exported from uid 10092
java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=de.amberhome.watchfacedemo/.main } from null (pid=10020, uid=2000) not exported from uid 10092
at com.android.server.am.ActivityStackSupervisor.checkStartAnyActivityPermission(ActivityStackSupervisor.java:1788)
at com.android.server.am.ActivityStarter.startActivity(ActivityStarter.java:728)
at com.android.server.am.ActivityStarter.startActivity(ActivityStarter.java:554)
at com.android.server.am.ActivityStarter.startActivityMayWait(ActivityStarter.java:1164)
at com.android.server.am.ActivityStarter.execute(ActivityStarter.java:492)
at com.android.server.am.ActivityManagerService.startActivityAsUser(ActivityManagerService.java:5132)
at com.android.server.am.ActivityManagerService.startActivityAsUser(ActivityManagerService.java:5106)
at com.android.server.am.ActivityManagerShellCommand.runStartActivity(ActivityManagerShellCommand.java:479)
at com.android.server.am.ActivityManagerShellCommand.onCommand(ActivityManagerShellCommand.java:161)
at android.os.ShellCommand.exec(ShellCommand.java:103)
at com.android.server.am.ActivityManagerService.onShellCommand(ActivityManagerService.java:16073)
at android.os.Binder.shellCommand(Binder.java:634)
at android.os.Binder.onTransact(Binder.java:532)
at android.app.IActivityManager$Stub.onTransact(IActivityManager.java:3592)
at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:3291)
at android.os.Binder.execTransact(Binder.java:731)

BTW, if I compile for debug I get an error:

Running custom action. Error
File not found - WatchfaceWear.apk
Because the compilation creates WatchfaceWear_RAPID_DEBUG.apk vs WatchfaceWear.apk

Thanks
 

msmerce

Member
Licensed User
Longtime User
If your question is still relevant, you can avoid the error by commenting out the following two lines from the manifest:
B4X:
AddReplacement(<action android:name="android.intent.action.MAIN" />, )
AddReplacement(<category android:name="android.intent.category.LAUNCHER" />, )
 
Upvote 0

Dave G

Active Member
Licensed User
That worked for Release and Debug. Thanks so much. Was just adding some features and frustrated that I could debug. Thanks so much.
 
Upvote 0
Top