Android Wear app not installing from the mobile package - mobile

Yes, I have followed all the other instructions and links. My wearable app is definitely being packaged with the mobile one, but is not installing.
The debug version of the mobile.apk is 4.9MB and of wear.apk is 1.9MB. When I build signed release versions, the mobile.apk is 5.8MB so I believe the packaging is happening.
When I do an adb install of the mobile.apk on the handheld, I get the following errors in the logcat of the handheld (the app package is com.pipperpublishing.refwatch so note the strange refwatch-1 reference in the second error):
01-27 07:49:59.129 8729-8729/? W/System.err: android.content.pm.PackageManager$NameNotFoundException: com.pipperpublishing.refwatch
01-27 07:49:59.129 8729-8729/? W/System.err: at android.app.ApplicationPackageManager.getApplicationInfo(ApplicationPackageManager.java:303)
01-27 07:49:59.129 8729-8729/? W/System.err: at com.samsung.aasaservice.AASAUpdateReceiver.onReceive(AASAUpdateReceiver.java:33)
01-27 07:49:59.129 8729-8729/? W/System.err: at android.app.ActivityThread.handleReceiver(ActivityThread.java:2948)
01-27 07:49:59.129 8729-8729/? W/System.err: at android.app.ActivityThread.access$1800(ActivityThread.java:172)
01-27 07:49:59.129 8729-8729/? W/System.err: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1498)
01-27 07:49:59.129 8729-8729/? W/System.err: at android.os.Handler.dispatchMessage(Handler.java:102)
01-27 07:49:59.129 8729-8729/? W/System.err: at android.os.Looper.loop(Looper.java:145)
01-27 07:49:59.129 8729-8729/? W/System.err: at android.app.ActivityThread.main(ActivityThread.java:5835)
01-27 07:49:59.129 8729-8729/? W/System.err: at java.lang.reflect.Method.invoke(Native Method)
01-27 07:49:59.129 8729-8729/? W/System.err: at java.lang.reflect.Method.invoke(Method.java:372)
01-27 07:49:59.129 8729-8729/? W/System.err: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1399)
01-27 07:49:59.129 8729-8729/? W/System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1194)
01-27 07:50:54.219 771-11243/? W/System.err: java.io.FileNotFoundException: /data/app/com.pipperpublishing.refwatch-1: open failed: EISDIR (Is a directory)
01-27 07:50:54.239 771-11243/? W/System.err: at libcore.io.IoBridge.open(IoBridge.java:456)
01-27 07:50:54.239 771-11243/? W/System.err: at java.io.FileInputStream.<init>(FileInputStream.java:76)
01-27 07:50:54.239 771-11243/? W/System.err: at android.content.pm.PackageParser.getHashValueOfPackage(PackageParser.java:5141)
01-27 07:50:54.239 771-11243/? W/System.err: at com.android.server.pm.PackageManagerService.saveHash(PackageManagerService.java:18383)
01-27 07:50:54.239 771-11243/? W/System.err: at com.android.server.pm.PackageManagerService.access$5200(PackageManagerService.java:329)
01-27 07:50:54.239 771-11243/? W/System.err: at com.android.server.pm.PackageManagerService$20.run(PackageManagerService.java:18368)
01-27 07:50:54.239 771-11243/? W/System.err: Caused by: android.system.ErrnoException: open failed: EISDIR (Is a directory)
01-27 07:50:54.239 771-11243/? W/System.err: at libcore.io.IoBridge.open(IoBridge.java:446)
01-27 07:50:54.239 771-11243/? W/System.err: ... 5 more
I have tried a factory reset of the watch, resyncing, etc etc. Any ideas?
Here's my mobile build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.pipperpublishing.refwatch"
minSdkVersion 14
targetSdkVersion 23
versionCode 203
versionName "0.2.03"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
wearApp project(':wear')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.google.android.gms:play-services:8.4.0'
compile 'com.android.support:design:23.1.1'
compile 'com.google.android.gms:play-services-ads:8.4.0'
compile 'com.google.android.gms:play-services-identity:8.4.0'
compile 'com.google.android.gms:play-services-gcm:8.4.0'
compile 'com.google.android.gms:play-services-auth:8.4.0'
}
apply plugin: 'com.google.gms.google-services'
and my "wear" build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion '23.0.2'
defaultConfig {
applicationId "com.pipperpublishing.refwatch"
minSdkVersion 21
targetSdkVersion 23
versionCode 203
versionName "0.2.03"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
debuggable true
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.google.android.support:wearable:1.3.0'
compile 'com.android.support:recyclerview-v7:23.1.1'
compile 'com.android.support:support-v13:23.1.1'
compile 'com.google.android.gms:play-services-wearable:8.4.0'
compile 'com.google.android.gms:play-services-auth:8.4.0'
}
apply plugin: 'com.google.gms.google-services'

Only using the release .apk file will the wear application get automatically installed. It wont work using the debug key.
In case the application is signed with a release key, then check whether the application already exists in the android wear device.

So, after multiple uninstalls and reinstalls, but without changing any code, the install is now working. Sometimes I have to "Resync applications" to see changes on the phone. The whole process seems quite clunky.

Related

React Native callback type only permits a single invocation from native code

I'm using Promise to received callback from native module on React Native project, When I was connect to server to get data:
* The first, I called action "LOGIN"
* After received data from login I called action "GET_LIST",
But the response of action "GET_LIST", I received wrong as below:
09-06 08:48:22.117 13540-15635/? W/System.err: JNA: Callback com.lnzekesi.SoLibraryModule$1#8f35faa threw the following exception:
09-06 08:48:22.119 13540-15635/? W/System.err: java.lang.RuntimeException: Illegal callback invocation from native module. This callback type only permits a single invocation from native code.
09-06 08:48:22.125 13540-15635/? W/System.err: at com.facebook.react.bridge.CallbackImpl.invoke(CallbackImpl.java:30)
09-06 08:48:22.125 13540-15635/? W/System.err: at com.facebook.react.bridge.PromiseImpl.resolve(PromiseImpl.java:32)
09-06 08:48:22.125 13540-15635/? W/System.err: at com.lnzekesi.SharedLibraryModule$1.function_recv_msg(SharedLibraryModule.java:213)
09-06 08:48:22.125 13540-15635/? W/System.err: at java.lang.reflect.Method.invoke(Native Method)
09-06 08:48:22.125 13540-15635/? W/System.err: at com.sun.jna.CallbackReference$DefaultCallbackProxy.invokeCallback(CallbackReference.java:520)
09-06 08:48:22.125 13540-15635/? W/System.err: at com.sun.jna.CallbackReference$DefaultCallbackProxy.callback(CallbackReference.java:551)
09-06 08:48:22.125 13540-15635/? W/System.err: at com.sun.jna.Native.invokePointer(Native Method)
09-06 08:48:22.125 13540-15635/? W/System.err: at com.sun.jna.Function.invokePointer(Function.java:490)
09-06 08:48:22.125 13540-15635/? W/System.err: at com.sun.jna.Function.invoke(Function.java:434)
09-06 08:48:22.125 13540-15635/? W/System.err: at com.sun.jna.Function.invoke(Function.java:354)
09-06 08:48:22.125 13540-15635/? W/System.err: at com.sun.jna.Library$Handler.invoke(Library.java:244)
09-06 08:48:22.125 13540-15635/? W/System.err: at java.lang.reflect.Proxy.invoke(Proxy.java:393)
09-06 08:48:22.125 13540-15635/? W/System.err: at $Proxy2.cli_wait(Unknown Source)
This is my callback called from native module:
onMsg = new SoLib.fnCallback() {
public synchronized void recvMsg(Pointer cli, final Pointer msg) {
promise.resolve(getResponse(msg, resIndex));
//always delete recv msg
SoLib.msgDelete(msg);
}
};
SoLib.cliRegOnMsg(cli, onMsg);
SoLib.cliConnect(cli);
Additional Information
React Native version: 0.47.2
Platform: IOS, Android
Development Operating System: MacOS
Dev tools: Android Studio, Xcode
A ReactNative Promise object, like a JavaScript Promise, can only be called once. If you want to send something multiple times from a native module to JS, you should be using an event pattern using something like DeviceEventEmiter android, ios.

Fatal Error loading the resource file: java.io.EFOException Codenameone

I have an error within my project. I'm not sure what happened but I was working on my app and all of a sudden the Theme.res file stopped working. When I try to access the Theme.res file, I receive an error saying
Fatal Error loading the resource file: java.io.EFOException
When I run the project the console output displays this:
[EDT] 0:0:0,17 - Exception: java.io.EOFException - null
java.io.EOFException
at java.io.DataInputStream.readByte(DataInputStream.java:267)
at com.codename1.ui.util.Resources.openFileImpl(Resources.java:281)
at com.codename1.ui.util.Resources.openFile(Resources.java:269)
at com.codename1.ui.util.Resources.<init>(Resources.java:189)
at com.codename1.ui.util.Resources.open(Resources.java:740)
at com.codename1.ui.util.Resources.openLayered(Resources.java:702)
at com.codename1.ui.util.Resources.openLayered(Resources.java:666)
at com.codename1.ui.plaf.UIManager.initFirstTheme(UIManager.java:1551)
at com.prestonwhite.productionpumpapp.Run.init(Run.java:27)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:43
at java.lang.reflect.Method.invoke(Method.java:498)
at com.codename1.impl.javase.Executor$1$1.run(Executor.java:117)
at com.codename1.ui.Display.processSerialCalls(Display.java:1056)
at com.codename1.ui.Display.mainEDTLoop(Display.java:873)
at com.codename1.ui.RunnableWrapper.run(RunnableWrapper.java:120)
at com.codename1.impl.CodenameOneThread.run(CodenameOneThread.java:176)
java.lang.NullPointerException
at com.prestonwhite.productionpumpapp.Run.init(Run.java:29)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.codename1.impl.javase.Executor$1$1.run(Executor.java:117)
at com.codename1.ui.Display.processSerialCalls(Display.java:1056)
at com.codename1.ui.Display.mainEDTLoop(Display.java:873)
at com.codename1.ui.RunnableWrapper.run(RunnableWrapper.java:120)
at com.codename1.impl.CodenameOneThread.run(CodenameOneThread.java:176)
Java Result: 1
I don't know what happened because everything was running fine and then all of a sudden this error randomly occurred. What can I do to fix this problem? Can I restore/recover my Theme.res file?
Note: I am using Netbeans on Windows 7.

EOFException when restarting my app on Android

I loose values in Preferences (CN1Preferences) in particular scenario of using my application on Android.
When I launch my app the first time, I save some values in Preferences. If I close my app (from background task) and then I sleep my tablet, when I relaunch the app, values save in Preferences are lost. This is the log I obtain after the relaunch :
CliniScore: [EDT] 0:0:0,4 - Exception: java.io.EOFException - null
05-04 16:32:40.667 10618-10978/? W/System.err: java.io.EOFException
05-04 16:32:40.667 10618-10978/? W/System.err: at java.io.DataInputStream.readBoolean(DataInputStream.java:69)
05-04 16:32:40.667 10618-10618/? D/SecWifiDisplayUtil: Metadata value : SecSettings2
05-04 16:32:40.667 10618-10978/? W/System.err: at com.codename1.io.Util.readObject(Util.java:541)
05-04 16:32:40.667 10618-10978/? W/System.err: at com.codename1.io.Util.readObject(Util.java:638)
05-04 16:32:40.667 10618-10978/? W/System.err: at com.codename1.io.Storage.readObject(Storage.java:261)
05-04 16:32:40.667 10618-10978/? W/System.err: at com.codename1.io.Preferences.get(Preferences.java:83)
05-04 16:32:40.667 10618-10978/? W/System.err: at com.codename1.io.Preferences.get(Preferences.java:298)
05-04 16:32:40.667 10618-10978/? W/System.err: at com.codename1.impl.CodenameOneImplementation.initEDT(CodenameOneImplementation.java:235)
05-04 16:32:40.667 10618-10978/? W/System.err: at com.codename1.ui.Display.mainEDTLoop(Display.java:952)
05-04 16:32:40.667 10618-10978/? W/System.err: at com.codename1.ui.RunnableWrapper.run(RunnableWrapper.java:120)
05-04 16:32:40.667 10618-10978/? W/System.err: at com.codename1.impl.CodenameOneThread$1.run(CodenameOneThread.java:60)
05-04 16:32:40.667 10618-10978/? W/System.err: at java.lang.Thread.run(Thread.java:818)
If I force close my app only (without sleep my tablet), there is no problem with my preferences values.
This problem doesn't occurs in iOS/Simulator/Emulator(Android). I've only noticed it on a Samsung Galaxy Tab A running Android 6.0.1
Thanks in advance.
It's possible that this relates to threaded access to the preferences which should be legal. I've made the two potentially disruptive methods synchronized in today's update and hopefully this would resolve that issue.
In my case, I copied a working project to start a new one. And I left the file
keystore.jks (keystore to upload to Google Play) empty, so when I compiled I got this exception.
I just removed the signingConfig line in android/buildTypes section in the application level build.gradle, and it worked.
May be you had a problem of this kind, an empty forgotten file that shouldnt be empty.

ConcurrentModificationException in Codename One app

In my Codename One app that involves (Android) Native interface implementation, I receive on the device from time to time a ConcurrentModificationException which stack trace reads :
W/System.err: java.util.ConcurrentModificationException
W/System.err: at java.util.ArrayList$ArrayListIterator.next(ArrayList.java:573)
W/System.err: at com.codename1.impl.android.AndroidAsyncView.flushGraphics(AndroidAsyncView.java:380)
W/System.err: at com.codename1.impl.android.AndroidImplementation.flushGraphics(AndroidImplementation.java:1147)
W/System.err: at com.codename1.impl.CodenameOneImplementation.paintDirty(CodenameOneImplementation.java:580)
W/System.err: at com.codename1.ui.Display.edtLoopImpl(Display.java:1075)
W/System.err: at com.codename1.ui.Display.mainEDTLoop(Display.java:997)
W/System.err: at com.codename1.ui.RunnableWrapper.run(RunnableWrapper.java:120)
W/System.err: at com.codename1.impl.CodenameOneThread$1.run(CodenameOneThread.java:60)
W/System.err: at java.lang.Thread.run(Thread.java:841)
My code (Codename One part or the native interface implementation) does not use ArrayList andthe app can continue after clicking OK when the 'Internal Error' pops up, but I would prefer to avoid this error.
Where should I look at to prevent this error from happening ?
Any help greatly appreciated,
That means code is triggering a native repaint for some reason on a separate thread. Does your native code that interacts with the peer component do so using the Android native UI thread?
If not that might trigger a race condition.

Getting an OOM when rendering Bitmap for videoPlayer in Codename one app

Just after calling show() on a form that has either a video or image displayed I am seeing this in the logs of my codenameOne Android app:
07-01 12:43:08.790 3369-3406/? E/art: Throwing OutOfMemoryError "Failed to allocate a 4631116 byte allocation with 4380676 free bytes and 4MB until OOM"
07-01 12:43:08.800 3369-3406/? W/System.err: java.lang.OutOfMemoryError: Failed to allocate a 4631116 byte allocation with 4380676 free bytes and 4MB until OOM
07-01 12:43:08.800 3369-3406/? W/System.err: at dalvik.system.VMRuntime.newNonMovableArray(Native Method)
07-01 12:43:08.800 3369-3406/? W/System.err: at android.graphics.Bitmap.nativeCreate(Native Method)
07-01 12:43:08.800 3369-3406/? W/System.err: at android.graphics.Bitmap.createBitmap(Bitmap.java:939)
07-01 12:43:08.800 3369-3406/? W/System.err: at android.graphics.Bitmap.createBitmap(Bitmap.java:912)
07-01 12:43:08.800 3369-3406/? W/System.err: at android.graphics.Bitmap.createBitmap(Bitmap.java:879)
07-01 12:43:08.800 3369-3406/? W/System.err: at com.codename1.impl.android.AndroidNativeUtil.renderViewOnBitmap(AndroidNativeUtil.java:163)
07-01 12:43:08.800 3369-3406/? W/System.err: at com.codename1.impl.android.f$b.m_(AndroidImplementation.java:2652)
07-01 12:43:08.800 3369-3406/? W/System.err: at com.codename1.p.y.B(PeerComponent.java:64)
07-01 12:43:08.800 3369-3406/? W/System.err: at com.codename1.p.y.a(PeerComponent.java:211)
07-01 12:43:08.800 3369-3406/? W/System.err: at com.codename1.p.h.b(Component.java:1323)
07-01 12:43:08.800 3369-3406/? W/System.err: at com.codename1.p.h.d(Component.java:1297)
07-01 12:43:08.800 3369-3406/? W/System.err: at com.codename1.p.h.a(Component.java:1272)
07-01 12:43:08.800 3369-3406/? W/System.err: at com.codename1.p.i.a(Container.java:1323)
07-01 12:43:08.800 3369-3406/? W/System.err: at com.codename1.p.h.b(Component.java:1323)
07-01 12:43:08.800 3369-3406/? W/System.err: at com.codename1.p.h.d(Component.java:1297)
07-01 12:43:08.800 3369-3406/? W/System.err: at com.codename1.p.h.a(Component.java:1272)
07-01 12:43:08.800 3369-3406/? W/System.err: at com.codename1.p.i.a(Container.java:1323)
It only seem to happen when the image is a large file, and every time with a video.
Video is a peer component which means that in order to implement transitions properly we try to convert it to an image and back again. For some reason this fails here.
We are looking at a different approach for peer components which is partially explained in this issue. It should vastly improve things like video, html etc. but might be a bit challenging.
For now I would suggest disabling the transition to try to workaround this exception.

Resources