Android Question Watchface library issues

Dave G

Active Member
Licensed User
I've been trying to get a simple watchface app implemented. Have done them using Xamarin, but having issues with B4A and watchface library.

New project.
Add watchface libarary
Compile and get:
Convert byte code - optimized dex. Error
Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v4/app/INotificationSideChannel;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v4/app/INotificationSideChannel$Stub;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v4/app/INotificationSideChannel$Stub$Proxy;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v4/os/IResultReceiver;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v4/os/IResultReceiver$Stub;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v4/os/IResultReceiver$Stub$Proxy;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v4/os/ResultReceiver;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v4/os/ResultReceiver$1;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v4/os/ResultReceiver$MyResultReceiver;
UNEXPECTED TOP-LEVEL EXCEPTION:
java.lang.RuntimeException: Translation has been interrupted
at com.android.dx.command.dexer.Main.processAllFiles(Main.java:692)
at com.android.dx.command.dexer.Main.runMonoDex(Main.java:315)
at com.android.dx.command.dexer.Main.runDx(Main.java:293)
at com.android.dx.command.dexer.Main.main(Main.java:249)
at com.android.dx.command.Main.main(Main.java:94)
Caused by: java.lang.InterruptedException: Too many errors
at com.android.dx.command.dexer.Main.processAllFiles(Main.java:684)
... 4 more

I used the sdk from the instructions and the ready to run sdk, to no avail.

1578259344759.png


Thanks in advance
 

Dave G

Active Member
Licensed User
Here you go:
B4A Version: 9.50
Java Version: 8
Parsing code. (0.00s)
Building folders structure. (0.22s)
Compiling code. (0.13s)
Compiling layouts code. (0.00s)
Organizing libraries. (0.00s)
(AndroidX SDK)
Generating R file. (2.84s)
Compiling debugger engine code. (0.59s)
Compiling generated Java code. (2.84s)
Convert byte code - optimized dex. Error
Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v4/app/INotificationSideChannel;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v4/app/INotificationSideChannel$Stub;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v4/app/INotificationSideChannel$Stub$Proxy;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v4/os/IResultReceiver;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v4/os/IResultReceiver$Stub;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v4/os/IResultReceiver$Stub$Proxy;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v4/os/ResultReceiver;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v4/os/ResultReceiver$1;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v4/os/ResultReceiver$MyResultReceiver;
UNEXPECTED TOP-LEVEL EXCEPTION:
java.lang.RuntimeException: Translation has been interrupted
at com.android.dx.command.dexer.Main.processAllFiles(Main.java:692)
at com.android.dx.command.dexer.Main.runMonoDex(Main.java:315)
at com.android.dx.command.dexer.Main.runDx(Main.java:293)
at com.android.dx.command.dexer.Main.main(Main.java:249)
at com.android.dx.command.Main.main(Main.java:94)
Caused by: java.lang.InterruptedException: Too many errors
at com.android.dx.command.dexer.Main.processAllFiles(Main.java:684)
... 4 more
 
Upvote 0

Dave G

Active Member
Licensed User
Okay. I created a directory outside of B4 internal libraries and not in Program Files and moved the watchface library into it. Then I pointed the additional libraries on config paths to that new directory. Click Jetify and nothing happens and still get error during compilation. BTW, if it don't point fill in additional libraries and click Jetify it says directory doesn't exist. Shouldn't be this difficult.
 
Upvote 0

Dave G

Active Member
Licensed User
C:\Program Files (x86)\Android\android-sdk\platform-tools>java -showversion
java version "1.8.0_231"
Java(TM) SE Runtime Environment (build 1.8.0_231-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.231-b11, mixed mode)

Jetify window did not show up. Neither does SDK Manager. I have a shortcut to the B4ASdkManager.jar in order to get to Sdk Manager. Don't know of any configuration settings.
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
C:\Program Files (x86)\Android\android-sdk\platform-tools>java -showversion
Do NOT put the SDK in a Restricted folder.

Follow the installationinstructions carefully. It works


You also can give me your Anydesc ID and i´ll connect to your PC and help you setting it up correctly.

In about 1,5 hours i´ll have time for it. 5:30 PM German Time (MEZ+1)

 
Last edited:
Upvote 0

Dave G

Active Member
Licensed User
Look above. The SDK is not in Program Files. The JDK is in the standard location in Program Files as indicated in the Paths Configuration dialog.
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
The JDK is in the standard location in Program Files as indicated in the Paths Configuration dialog.
And the SDK is installed there too which is a mistake.
The SDKManager can not work inside Program Files folder.

Again. Follow the installationsteps carefully. It will work.

Good luck...
 
Upvote 0

Dave G

Active Member
Licensed User
I have to keep two SDK directories. One in standard Program Files (x86) for use by existing development environment (Xamarin) and one for B4A (see above). The snippet above was run from Program Files (x86) because I have a shortcut to it on my desktop, but it's not used for B4A.
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
C:\Program Files (x86)\Android\android-sdk\platform-tools>java -showversion
java version "1.8.0_231"
Version 1.8.0_231

But You showed us that you are using another Java in B4A!

I used the sdk from the instructions and the ready to run sdk, to no avail.

1578259344759.png


Thanks in advance

Tip: Update the reference to java in B4A to javac.exe

Better reinstall and follow the Installationinstructions carefully. :cool:

It is no problem to use multiple SDKs or Javas on the same machine. If properly configured.
 
Last edited:
Upvote 0

Dave G

Active Member
Licensed User
I created a new directory for Java 11. Same error. Could it be the watchface library?

4A Version: 9.50
Java Version: 11
Parsing code. (0.00s)
Building folders structure. (0.19s)
Compiling code. (0.08s)
Compiling layouts code. (0.01s)
Organizing libraries. (0.00s)
(AndroidX SDK)
Generating R file. (4.02s)
Compiling debugger engine code. (0.79s)
Compiling generated Java code. (3.27s)
Convert byte code - optimized dex. Error
Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v4/app/INotificationSideChannel;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v4/app/INotificationSideChannel$Stub;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v4/app/INotificationSideChannel$Stub$Proxy;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v4/os/IResultReceiver;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v4/os/IResultReceiver$Stub;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v4/os/IResultReceiver$Stub$Proxy;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v4/os/ResultReceiver;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v4/os/ResultReceiver$1;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v4/os/ResultReceiver$MyResultReceiver;
UNEXPECTED TOP-LEVEL EXCEPTION:
java.lang.RuntimeException: Translation has been interrupted
at com.android.dx.command.dexer.Main.processAllFiles(Main.java:692)
at com.android.dx.command.dexer.Main.runMonoDex(Main.java:315)
at com.android.dx.command.dexer.Main.runDx(Main.java:293)
at com.android.dx.command.dexer.Main.main(Main.java:249)
at com.android.dx.command.Main.main(Main.java:94)
Caused by: java.lang.InterruptedException: Too many errors
at com.android.dx.command.dexer.Main.processAllFiles(Main.java:684)
... 4 more
 

Attachments

  • b4a-jdk.png
    b4a-jdk.png
    51.4 KB · Views: 139
Upvote 0

Dave G

Active Member
Licensed User
BTW. everything works fine with a project that don'e use watchface library. As soon as I add watchface the compile errors occur. I was able to Jetify watchface etc. after pointing to Java 11 vs 8. Still fails. About ready to give up on using watchface. Thanks.
 
Upvote 0
Top