Exception running command on UI thread - unity3d

I add Prime31 plugin for GooglePlayGameServices but it don't want to authenticate and send an error: "Exception running command on UI thread"
if( GUILayout.Button( "Authenticate" ) )
{
PlayGameServices.authenticate();
}
public static void authenticate()
{
if( Application.platform != RuntimePlatform.Android )
return;
_plugin.Call( "authenticate" );
}
And I did all this tutorial steps.

Please make sure that you are using the Activity Sharing System. And also that The r21 Google Play SDK now requires that you are using JDK 1.7 or newer to compile. It will not compile with older JDK versions. The r21 Play SDK also has a bug with regard to silent authentication. We had to turn off automatic silent authentication in version 2.10 of the plugin due to a bug in the Play SDK. You can use the beginSilentAuthentication method when you are ready to actually authenticate the user or the authenticate method.

Related

.NET MAUI Plugin.Firebase.iOS does not exist

I'm using the new Plugin.Firebase plugin to get push notification function working with a clean .NET Maui app-project.
I have installed https://github.com/TobiasBuchholz/Plugin.Firebase but for some reson this code is "unreachable" or it does not exist in namespace.
#if IOS
using Plugin.Firebase.iOS; <-- Error: code is "unreachable" or it does not exist in namespace
#else
using Plugin.Firebase.Android;
#endif
Does anyone else have the same problem or knows any workarount the problem.
Android seems to work as it should to, but I dont understand why. I have compared the source code of both iOS and Android and the namespace should exist in both cases:
https://github.com/TobiasBuchholz/Plugin.Firebase/blob/development/src/Android/CrossFirebase.cs
https://github.com/TobiasBuchholz/Plugin.Firebase/blob/development/src/iOS/CrossFirebase.cs

Gradle Error: Colliding Attributes while upgrading unity project from android Google Play Billing Library v3 to v4

I am originally using Unity 2021.1.22f1
I have made a cardboard vr app for android and I need to make an update to it. I am not
using in app purchases or something similar, but I use the Play Asset Delivery package
for unity in order to minimize the app size. I successfullyu built the app and it throws
an error when I upload the app for internal testing and it will not proceed if this is not
resolved.
We have detected that this app is using an unsupported version of Play Billing.
Please upgrade your Billing Library to version 4 or later to publish this app.
When I click the "learn more" button it redirects me to this link:
https://developer.android.com/google/play/billing/deprecation-faq
and the internal test button is greyed out.
It is saying that the Google Play Billing Library must be upgraded from version 3 to at least
version 4.
Due to this forum thread https://forum.unity.com/threads/important-update-google-play-billing-library-v4.1315443/
I searched about the changelog in the unity versions https://docs.unity3d.com/Packages/com.unity.purchasing#4.4/changelog/CHANGELOG.html.
In this changelog is written, that the "GooglePlay - Google Play Billing Library version 4.0.0" is added in IAP 4.4.0 and date 2022-07-11.
So I guessed that i had to upgrade the unity version. I downloaded Unity 2022.1.23f1 and built the same app with the current settings
(Google Play Billing Library v3) and it was successfully built without errors.
I found a way to upgrade the library by downloading the unity package of Play Billing Library
from this website https://developers.google.com/unity/packages#google_play even if it
is saying version 3.2.4 . When I tried to build it a new error appeared:
Gradle Error: Colliding Attributes
The attribute
meta-data#com.google.android.play.billingclient.version#value=3.0.3
in :billing-4.0.0: collides with another value
(See the Console for details)
I tried updating the Play Asset Delivery package but there was no change in the error message.
I found this in my search for the bug https://github.com/RevenueCat/purchases-unity/issues/37#issuecomment-780970405.
In this link, the Google Play Billing Library is having a conflict with the same library
inside the IAP and it suggest a code to bypass the IAP library. and tried it, but to no avail.
After trying this I guess that there is a Google Play Billing Library v3 in the Play Asset Delivery package that probably is
needed to be bypassed.
If the Play Billing Library can be completely skipped it would be the best, because there is no billing function planned
to be implemented in the app, but I mainly want to be able to upload it to the playstore.
This is the mainTemplate.gradle file:
// GENERATED BY UNITY. REMOVE THIS COMMENT TO PREVENT OVERWRITING WHEN EXPORTING AGAIN
// Android Resolver Repos Start
([rootProject] + (rootProject.subprojects as List)).each { project ->
project.repositories {
def unityProjectPath = $/file:///**DIR_UNITYPROJECT**/$.replace("\\", "/")
maven {
url "https://maven.google.com"
}
maven {
url "https://android-sdk.is.com/" // Assets/IronSource/Editor/IronSourceSDKDependencies.xml:9
}
maven {
url "https://maven.google.com/" // Assets/IronSource/Editor/IronSourceSDKDependencies.xml:17, Assets/IronSource/Editor/IronSourceSDKDependencies.xml:25
}
mavenLocal()
mavenCentral()
}
}
// Android Resolver Repos End
apply plugin: 'com.android.library'
**APPLY_PLUGINS**
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.google.android.gms:play-services-vision:15.0.2'
implementation 'com.google.protobuf:protobuf-lite:3.0.0'
// Android Resolver Dependencies Start
implementation 'com.google.android.gms:play-services-ads-identifier:17.0.0' // Assets/IronSource/Editor/IronSourceSDKDependencies.xml:17
implementation 'com.google.android.gms:play-services-basement:17.2.1' // Assets/IronSource/Editor/IronSourceSDKDependencies.xml:25
implementation 'com.google.android.play:asset-delivery:2.0.0' // Assets/GooglePlayPlugins/com.google.play.assetdelivery/Editor/Dependencies.xml:3
implementation 'com.google.android.play:core-common:2.0.0' // Assets/GooglePlayPlugins/com.google.play.core/Editor/Dependencies.xml:3
implementation 'com.ironsource.sdk:mediationsdk:7.2.5' // Assets/IronSource/Editor/IronSourceSDKDependencies.xml:9
// Android Resolver Dependencies End
**DEPS**}
// Android Resolver Exclusions Start
android {
packagingOptions {
exclude ('/lib/armeabi/*' + '*')
exclude ('/lib/armeabi-v7a/*' + '*')
exclude ('/lib/mips/*' + '*')
exclude ('/lib/mips64/*' + '*')
exclude ('/lib/x86/*' + '*')
exclude ('/lib/x86_64/*' + '*')
}
}
// Android Resolver Exclusions End
android {
aaptOptions {
noCompress = ['.ress', '.resource', '.obb'] + unityStreamingAssets.tokenize(', ')
ignoreAssetsPattern = "!.svn:!.git:!.ds_store:!*.scc:.*:!CVS:!thumbs.db:!picasa.ini:!*~"
}
compileSdkVersion **APIVERSION**
buildToolsVersion '**BUILDTOOLS**'
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
defaultConfig {
minSdkVersion **MINSDKVERSION**
targetSdkVersion **TARGETSDKVERSION**
ndk {
abiFilters **ABIFILTERS**
}
versionCode **VERSIONCODE**
versionName '**VERSIONNAME**'
consumerProguardFiles 'proguard-unity.txt'**USER_PROGUARD**
}
lintOptions {
abortOnError false
}
**PACKAGING_OPTIONS**
}**REPOSITORIES**
**IL_CPP_BUILD_SETUP**
**SOURCE_BUILD_SETUP**
**EXTERNAL_SOURCES**

Could not securely load assembly (Unity 4.5.1 + Facebook Unity SDK 5.1)

I've just updated Unity from 4.3.4 to 4.5.1 and got this error with Facebook Unity SDK 5.1:
Could not securely load assembly from https://integrated-plugin-canvas-rsrc.fbsbx.com/rsrc/unity/lib/sdk_5.1/CanvasFacebook.dll
I tried the fix explained in Unable to verify assembly data; you must provide an authorization key when loading this assembly but was unable to comment (not enough reputaion) so had to ask a new question.
string key = "B8GvecdX0rQ47kzhCEwlrRzYKA8LKeiZxy1HI3HfnhdgUATvBwQQViji8ot44dADM55QuHk5+hwrLso" +
"au32IDmRDQTclMSsTsIywGRo/nE5vbmRMMIECYXBFhliz+kvK0RWZ57XPxw0s7YhGnNLav0EE2QH/m+9a" +
"jlLOY+2ckxSoSEHLpotllyZLktRK+oFiDPvmzXLDUMOnwK9RFRSh2VBmoyWTZx8BYqWjqug3kAljJk/Xw" +
"TYZT9Ie+HvzLO5DBSqMNYbEX03WaNfpaq9GKBF/Oz37AHelf1Es36amP1v2Aut3nmIk2xxN6zwzBXyEyw" +
"90vJ/O8suikU+8kDDbZA==";
var assembly = Security.LoadAndVerifyAssembly(www.bytes, key);
Note that I added the fix code into the UNITY_4_5 section.
Is the key now wrong as it was given back in March?
I should note that I only see this error in one project. I have another project that also uses the Facebook Unity SDK but I don't see the error in that one.
UPDATE:
As of Monday 30 June the original issue seems to have been resolved. There's now no problem loading the assembly via the original code.
UPDATE 2:
Actually I've seen the secure load fail a few times since, but not always.

How to ignore SSL errors in Qt5 QML QWebKit 3.0?

I've got a problem showing www.facebook.com in Qt5 QML QWebKit 3.0.
The problem is with SSL certificate. There is a solution for Qt 4.*, but I need to implement this in the Qt 5.0.1 where all the API had changed.
The example solution for Qt 4.* could be found here link
Here is the solution, how you could ignore SSL errors from QML in Qt5. It helped me to show facebook page. I'm to use experimental API. The solution is correct for Qt 5.0.1 msvc2010 version in Windows 7 64bit.
import QtWebKit 3.0
import QtWebKit.experimental 1.0
WebView {
id: webView;
url: "https://www.facebook.com";
experimental.certificateVerificationDialog: Item {
Component.onCompleted: {
model.accept();
}
}
}
I was not able to resolve this problem with Qt 5.1 and MinGW4.8 using the experimental feature.
Finally I installed the new Qt 5.2 release that has a more expressive error message:
QSslSocket: cannot call unresolved function SSLv23_client_method
QSslSocket: cannot call unresolved function SSL_CTX_new
QSslSocket: cannot call unresolved function SSL_library_init
QSslSocket: cannot call unresolved function ERR_get_error
QSslSocket: cannot call unresolved function ERR_get_error
So with this new information the solution was installing Win32OpenSSL: http://slproweb.com/products/Win32OpenSSL.html

J2ME emulator does not appear to open in Eclipse

I currently have Java ME SDK 3.0.5 installed and am running a MIDLET from Eclipse.
When I run the app under the emulator device I get the following data in the console:
Syntax:
emulator [arguments]
In order to get commands supported by given device run:
emulator.exe -Xdevice:<device name> -Xquery
Generic list of arguments is:
-version Display version information about the emulator
-help Display list of valid arguments
-classpath, -cp The class path for the VM
-D<name>=<value> Set a system property
-Xdebug Use a remote debugger
-Xrunjdwp:[transport=<transport>,address=<address>,server=<y/n>,
suspend=<y/n>]
Debugging options
-Xdevice:<device> Select a device skin for the emulator
-Xdomain:<domain_name>
Set the MIDlet suite's security domain
-Xmain:<main class name>
Run the main method of a Java class, as in Java SE
-Xquery Print device information
Everything seems to be alright, but I can't get any form of emulation to appear.
here is the code of my MIDLET, although I don't think the problem lies here.
import javax.microedition.midlet.MIDlet;
import javax.microedition.midlet.MIDletStateChangeException;
import javax.microedition.lcdui.*;
public class Hello extends MIDlet implements CommandListener {
private Command exitCommand;
private Display display;
private Form screen;
public Hello() {
display = Display.getDisplay(this);
exitCommand = new Command ("Exit", Command.EXIT, 2);
screen = new Form ("Hello World");
StringItem strItem = new StringItem ("","Hello World");
screen.append (strItem);
screen.addCommand (exitCommand);
screen.setCommandListener(this);
}
public void startApp() throws MIDletStateChangeException {
// set the current display to the screen
display.setCurrent(screen);
}
public void pauseApp() {
// TODO Auto-generated method stub
}
public void destroyApp(boolean unconditional) {
// TODO Auto-generated method stub
}
public void commandAction (Command c, Displayable s)
{
if (c == exitCommand)
{
destroyApp (false);
notifyDestroyed();
}
}
}
The output is pretty simple, it's telling you that the command line syntax to the emulator is incorrect.
Go to the Java ME device settings and edit the emulator command line / start options to suit.
Switching IDE's may work for you as a short-term fix, but it's always better to get to the root of the issue. Plus it'll help you understand the emulator framework.
I switched over to Netbeans, which has integrated support for J2ME (as opposed to having to install a 3rd party plugin for Eclipse) and it now works perfectly.
I had a similar problem while running a basic JavaMe app on eclipse, "Corrupt JAR, error while reading". It worked for me after I followed this series for starters http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse.mtj.doc.user/html/gettingstarted/prepare_workbench.html (try not to miss anything mentioned here).
Note, when you launch the app, use "Launch as emulated Java ME JAD"(-in the top right "Running" section on the page) from the "Application descriptor" (-from left menu.)
This is a late reply but might just help someone in future.
If you are adventurous and want to develop / run JavaME application without IDE's than I have some ray of hope, write a batch script (or shell script for linux system) to manually run the emulator with specific jad
Batch Script (run.bat)
"<javame-3.0-sdk-root-folder>\bin\emulator.exe"
-Xdescriptor:"<jad-filename-with-extension>" >> logs.txt
pause
exit
save the above script in the same folder as the application jad/jar. The console prints will be available in log.txt file.
Here is post how to run jar from emulator (Java ME SDK 3.0.5)
(How to run MIDLET in Java ME SDK 3.0.5 ::http://madhukaudantha.blogspot.com/2012/10/how-to-run-midlet-in-java-me-sdk-305.html