Problem with unity gradle build (java maybe?) - java

I've got an android project going on and it all goes smoothly until i try to implement ads. As soon as i turn on the unity ads and install the ads package, my game doesn't build anymore and gives me this Gradle build failed error. I've really tried anything so everything helps. Thank you.
Console errors:
Configure project :launcher warning: C:\Users\fili7\OneDrive\Desktop\Unity Proj\Lio\Library\Bee\Android\Prj\Mono2x\Gradle\unityLibrary\libs\classes.jar(com/samsung/android/gamesdk/GameSDKManager.class): major version 53 is newer than 52, the highest major version supported by this compiler. It is recommended that the compiler be upgraded. CommandInvokationFailure: Gradle build failed. C:\Program Files\Unity\Hub\Editor\2021.3.11f1\Editor\Data\PlaybackEngines\AndroidPlayer\OpenJDK\bin\java.exe -classpath "C:\Program Files\Unity\Hub\Editor\2021.3.11f1\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\gradle\lib\gradle-launcher-6.1.1.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx4096m" "assembleRelease" Build completed with a result of 'Failed' in 46 seconds (46351 ms) UnityEngine.GUIUtility: ProcessEvent (int,intptr,bool&) UnityEditor.BuildPlayerWindow+BuildMethodException: 4 errors at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (UnityEditor.BuildPlayerOptions options) [0x002da] in :0 at UnityEditor.BuildPlayerWindow.CallBuildMethods (System.Boolean askForBuildLocation, UnityEditor.BuildOptions defaultBuildOptions) [0x00080] in :0 UnityEngine.GUIUtility: ProcessEvent (int,intptr,bool&)
Pretty much everything. Tried on multiple unity versions, even tried to use custom skd and ndk and gradles, nothing worked.

Related

JPackage getting ERROR: Unknown exception caught trying to find MSI installer

I'm getting the following error in JPackage using JDK-19 and JavaFX-19. Same configuration used to work using JDK-18 and JavaFX-16. It builds the install image, but is missing the msi installer.
Required environment variables:
PATH_TO_FX = C:\Java\javafx-19\sdk\lib
PATH_TO_FX_MODS = C:\Java\javafx-19\jmods
JPackage Version 19
[2022/11/12 10:46:54.801, jpackage.dll (PID: 5696, TID: 11192), jpackage.cpp:155 (Java_jdk_jpackage_internal_WinExeBundler_embedMSI)]
ERROR: Unknown exception caught
[10:45:03.636] Running candle.exe
[10:45:03.647] Running C:\Program Files (x86)\WiX Toolset v3.11\bin\candle.exe
[10:45:03.784] Running light.exe
[10:45:03.788] Running C:\Program Files (x86)\WiX Toolset v3.11\bin\light.exe
[10:45:03.989] Detected [candle.exe] version [3.11.2.4516].
[10:45:03.989] Detected [light.exe] version [3.11.2.4516].
[10:45:03.990] WiX 3.11.2.4516 detected. Enabling advanced cleanup action.
Any guidance or where I might get help is much appreciated.
Thank you
Unfortunately, I needed to replace my boot drive, which involved reinstalling Windows and WIX Toolkit and Java plus all the other stuff. The error no longer occurs. I have no idea what fixed it, the new SSD is built the same as the old with the same versions of all software. There is not a software migration history on the new SSD as there was on the old HD. I'm using the same procedures as before.
I hate when we fix things and not know why, but such is life.

Android WireApp logs UnsatisfiedLink error: "wcall_set_video_send_state" when attempting video calls

I've built the wire app from the following repository:
https://github.com/wireapp/wire-android
Using the following build directions:
How to build locally Check out the wire-android repository. Switch to
latest relase branch release From the checkout folder, run ./gradlew
assembleProdRelease. This will pull in all the necessary dependencies
from Maven.
I've tried the release branch:
git clone https://github.com/wireapp/wire-android.git --branch release
And the master:
git clone https://github.com/wireapp/wire-android.git
Initially both versions gave the error:
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
at java.lang.Thread.run(Thread.java:764)
Caused by: java.lang.UnsatisfiedLinkError: Error looking up function 'wcall_set_video_send_state': undefined symbol: wcall_set_video_send_state
at com.sun.jna.Function.<init>(Function.java:245)
at com.sun.jna.NativeLibrary.getFunction(NativeLibrary.java:566)
However, this error can be solved by running the following command prior to opening the project in Android Studio:
gradlew assembleProdRelease
This command also creates the apks in build/output/apks. However, the build isn't signed with either the release or debug key. I used the following tool to sign the apk:
https://github.com/patrickfav/uber-apk-signer/releases
The APK is stable and runs fine, but still cannot initiate a video call. It gives the following errors:
Android 5:
08-24 22:53:29.877 296-881/? E/FastThread: did not receive expected
priority boost
Android 8:
08-24 23:10:02.190 406-4592/? E/AudioALSAPlaybackHandlerBase:
-getHardwareBufferInfo(), pcm_get_htimestamp fail, ret = -1, pcm_get_error =
Android 9 Emulator:
08-25 19:56:58.425 1583-3268/? W/audio_hw_generic: Not supplying
enough data to HAL, expected position 4108693 , only wrote 4108320
UPDATE:
I thought about trying to build my own versions of the AVS libraries: following https://github.com/wireapp/wire-audio-video-signaling
The following command needs to be run:
make dist_android
C:\work\wire-audio-video-signaling>make dist-android mk/target.mk:167:
*** Unknown host system. Stop.
mk/target.mk looks like:
# Start by auto-determining host system and arch.
ifeq ($(HOST_OS),)
HOST_UNAME := $(shell uname)
ifeq ($(HOST_UNAME),Darwin)
HOST_OS := osx
else
ifeq ($(HOST_UNAME),Linux)
HOST_OS := linux
else
$(error Unknown host system)
endif
endif
endif
The Makefile doesn't seem to be setup to support Windows so I'm going to try building it from a Linux machine to see if that helps.
UPDATE 2:
It does build better on Ubuntu, but it eventually dies complaining about compiler arguments. [Sorry I don't have the error to hand]
But I've managed to find binary copies of the library built for Android/ARM here:
http://dl.bintray.com/wire-android/releases/com/wire/avs/
However, these libraries do not seem to solve the issue either.
UPDATE 3:
Tried the following:
Downloaded the latest version of the .aar file from the link above
Renamed it to avs.aar
Installed in app/libs
Uncommented the line: "implementation (name:'avs', ext:'aar')"
But I got the error:
Program type already present: com.waz.avs.VideoCapturer$4
Message{kind=ERROR, text=Program type already present:
com.waz.avs.VideoCapturer$4, sources=[Unknown source file], tool
name=Optional.of(D8)}
There is a another reference to the AVS library below, if you comment that out the error will go away.
However, none of these steps solve the problem.
Now I will try to build older versions of the release branch...
Update 4: Release Branch: 2.41.359
[The most recent non-beta tagged release]
No longer compiles in Android studio because some of the XML files in the layout DIR are not well formed. Those must be fixed and checked into Git since the build process checks all the files out from Git.
The app initially runs normally and allows login, but always crashes after the edit devices screen. The app then crashes every time that you try to open it.
08-25 14:51:02.142 29066-29109/? E/AndroidRuntime: FATAL EXCEPTION:
Thread-4
Process: com.wire, PID: 29066
java.lang.NullPointerException: Attempt to invoke interface method 'int com.waz.call.RequestHandler.request$1d4ff469()' on a null object
reference
at com.waz.call.FlowManager.request(FlowManager.java:365)
Note: Seems that edit devices screen is not the cause of the problem because I removed all my devices in the web app but then 2.41.359 crashes on the phone without displaying the edit devices screen.
This issue is mentioned in following threads:
https://github.com/wireapp/wire-android/issues/1271
https://github.com/wireapp/wire-android/issues/1288
The advice seems to be to use the avslib.so file from the production version since the provided one is inadequate to run the project.
So I've dowloaded the APK off their website:
https://wire.com/en/download/
It is version: 3.15.634 [That's older than the one in the app store: 3.16.638 though hopefully that doesn't matter].
For anyone that doesn't know, an APK is just a ZIP file so I renamed it to from .apk to .zip for purposes of obtaining libavs.so:
Root Dir:
Libs Dir:
Arm Dir:
With libavs.so extracted, I renamed the unsigned version of wire-prod-release-2.41.99999 produced by the build tools to wire-prod-release-2.41.99999-avs-mod.zip and deleted the old libavs.so and replaced it with the one that I just took from the production version of the app. I renamed it back to .pkg then ran the following command to sign it:
java -jar \uber-apk-signer-0.8.4.jar --apks wire-prod-release-2.41.99999-avs-mod.apk -debug
Pretty good result, 2.41.359 no longer crashes. However, I still cannot initiate any audio or video calls. Same error found in the latest version of the release branch:
08-25 16:01:51.748 406-4592/? E/AudioALSAPlaybackHandlerBase: -getHardwareBufferInfo(), pcm_get_htimestamp fail, ret = -1, pcm_get_error =
As a sanity check, I installed the production version: 3.15.634 used to extra libavs.so and it is able to make both audio and video calls. [The version on GooglePlay: 3.16.638 also works fine for audio and video...]
Any ideas?
After a few days of trying, I found a way to build the project in such a way that it will initiate audio and video calls:
Procedure:
git clone https://github.com/wireapp/wire-android.git --branch release
cd wire-android
git checkout 2.40.357
Load the project into Android Studio
Edit the file res/layout/collection_file_asset.xml
Move <?xml version="1.0" encoding="utf-8"?> above the copyright comment since the file must begin with the XML tag
git add .
git commit -m "fixed syntax error"
gradlew assembleProdRelease
java -jar \uber-apk-signer-0.8.4.jar --apks wire-prod-release-2.40.99999.apk -debug
adb install wire-prod-release-2.40.99999-aligned-debugSigned.apk
Other Notes:
Master currently does not build due to Scala errors...
The current release branch produces a stable app but results in the following error when tapping on the video icon: "E/AudioALSAPlaybackHandlerBase: -getHardwareBufferInfo(), pcm_get_htimestamp fail, ret = -1, pcm_get_error ="
The most recent stable release 2.41.359 does not work because it crashes on every app launch with: "AndroidRuntime: FATAL EXCEPTION: Thread-4 Process: com.wire, PID: 29066 java.lang.NullPointerException: Attempt to invoke interface method 'int com.waz.call.RequestHandler.request$1d4ff469()' on a null object reference at com.waz.call.FlowManager.request(FlowManager.java:365)"
While building 2.40.357 enables audio and video, it is unstable and crashes quite a bit while receiving and making calls. I've spoken with other developers using this code base and they've encountered similar problems...
Thoughts:
I'm not really sure what's happening with this project. There are developers pleading for help with audio / video issues on Git with little response. I think I'd feel a little uneasy about using this code for a commercial project unless there is a bit more stability and support...
I gave up to compile a working application from source. Aside from educational reasons, my motivation to compile from source was a particular code change (lifting the limit of simultaneous accounts in the android app, as I have more than 2)
Doing that change itself is trivial, its just a constant defined in
app/src/main/scala/com/waz/zclient/pages/main/profile/preferences/pages/ProfileBottomSheetDialog.scala:
val MaxAccountsCount = 2
However, since no working application can be built from the provided sources - even with considerable effort - I instead used the smali/backsmali tool from
https://github.com/JesusFreke/smali
to create a patch/diff of this particular code change between a modified and unmodified (nonfunctional) binary app built from source - reflecting the corresponding changes in bytecode. (Although apktool could probably be used to do the same)
This bytecode patch can then be applied to the precompiled and fully functional production app as well, also using smali/backsmali (or apktool)

Android Build Error: make: *** [build/core/main.mk:21: run_soong_ui] Error 1

I am trying to build AOSP from source for the Nexus 6P and encountering the following error. This issue started happening with branch android-8.0.0_r17 (OPR5.170623.007) and has continued in branch android-8.0.0_r31 (OPR5.170623.011). Branches prior to *_r17 did not have this issue for me.
[ 85% 69912/81560] Building with...rmediates/with-local/classes.de
ninja: build stopped: subcommand failed.
01:31:54 ninja failed with: exit status 1
make: *** [build/core/main.mk:21: run_soong_ui] Error 1
#### make failed to build some targets (42:12 (mm:ss)) ####
Similar questions have been asked before, but the suggestion to increase the Java heap size(here also) did not work for me. Nor did syncing the repo again, syncing repo with a single tread, or building with a single thread (in suspicion of running out of memory). prebuilt/misc/linux-x86/bison/bison does exist (as suggested here and here). The question has also been unanswered on XDA Developers for branch *_12.
My base system is Arch Linux (4.13.11-1-hardened), virtualenv in place (to use Python2 as python), and JAVA_HOME = /usr/lib/jvm/java-8-openjdk.
I'm out of ideas and would really like to continue developing my Android projects. Any suggestions?

Android app with Oracle MAF, build.xml not found

I'm currently developing an Android (API 21) app on Eclipse OEPE (Mars) using a 64-bit Win7. The SDK was downloaded and installed by Android Studio (with all the platform-tools and build-tools). I have had no trouble writing the app, but as soon as I try to debug it as described here (Step 6), I get the following error:
BUILD FAILED
{WorkspacePath}\HelloWorld\.main.android.1\bin\build.xml:3: The following error occurred while executing this line:
{WorkspacePath}\HelloWorld\.main.android.1\bin\build-set-globals.xml:67: Cannot find C:\AndroidSdk\tools\ant\build.xml imported from {WorkspacePath}\HelloWorld\.main.android.1\bin\build-set-globals.xml
Total time: 895 milliseconds
(I'm the one who replaced the path to the workspace with {WorkspacePath}).
I have no idea what's going on and couldn't find anything on internet; any suggestion?
EDIT: I forgot to mention it, but the thing that is bothering me the most is that there's no "ant" folder in {SDKPath}/tools

Phonegap 3.3 cannot add platform

I have upgraded my Phonegap running on Windows 7 to the currently latest version to 3.3.0. I could create a project without any issue but when I try to add a platform say "android" an error occurs. Shown below is the error I get when I run "cordova platform add android" command on command promt on Windows 7. Please help.
E:\Dropbox\Development\Android\weatherlk>cordova platform add android
Creating android project...
C:\Users\Teshan\AppData\Roaming\npm\node_modules\cordova\node_modules\q\
throw e;
^
Error: An error occured during creation of android sub-project.
C:\Users\Teshan\.cordova\lib\android\cordova\3.3.0\bin\node_modules\q\q.
throw e;
^
Error: An error occurred while listing Android targets
at C:\Users\Teshan\.cordova\lib\android\cordova\3.3.0\bin\lib\check_
at _rejected (C:\Users\Teshan\.cordova\lib\android\cordova\3.3.0\bin
at C:\Users\Teshan\.cordova\lib\android\cordova\3.3.0\bin\node_modul
at Promise.when (C:\Users\Teshan\.cordova\lib\android\cordova\3.3.0\
at Promise.promise.promiseDispatch (C:\Users\Teshan\.cordova\lib\and
752:41)
at C:\Users\Teshan\.cordova\lib\android\cordova\3.3.0\bin\node_modul
at flush (C:\Users\Teshan\.cordova\lib\android\cordova\3.3.0\bin\nod
at process._tickCallback (node.js:415:13)
at C:\Users\Teshan\AppData\Roaming\npm\node_modules\cordova\src\plat
at ChildProcess.exithandler (child_process.js:641:7)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:735:16)
at Process.ChildProcess._handle.onexit (child_process.js:802:5)
I had exactly this problem today. Turned out I had white space in the path variable for \android-sdk\tools (in windows 7 environment variables). Check the android batch file runs, ie type android in a command prompt in any directory, and also adb for the platform-tools path. A similar question is answered here < An error occured during creation of android sub-project >.
Here is a blog about installing it from start to finish with a little more detail than phonegap/cordova docs offer. A lot easier than piecing together the different stack questions: http://www.andrewsavory.com/blog/2013/2517

Categories