$begingroup$
I want to build for Android and today one error popped up after building.
Your Android setup is not correct. See Settings in Facebook menu. UnityEditor.HostView:OnGUI()
Important things about this problem:
-
The only error in the inspector I can see is
OpenSSL not found. Make sure that OpenSSL is installed and that it is in your path.
Even tho I have installed it and added it to my path
-
When I open the inspector in Facebook> Edit Settings, unity becomes very unresponsive
-
This error has not popped up before today
- I still get a APK even if I get errors
asked Jul 21, 2015 at 22:23
$endgroup$
3
$begingroup$
There is actually a major bug with the latest version of Facebook SDK and the OpenSSL. Every time you click on Facebook/Settings Unity hang and becomes unresponsive.
I had to download openssl-0.9.8k_X64.zip found here and the problem was solved.
The proper solution was provided on SO.
answered Jun 1, 2016 at 14:02
$endgroup$
$begingroup$
This question has been answered multiple time at least here.
Here are steps.
-
Download the OpenSSL installer
-
Download the lastest x64 JavaSDK here. I have installed the latest Java 8 SDK.
-
Make sure to use the latest Facebook SDK. Take a look here.
-
Now you have all the needed files.
-
So start installing OpenSSL on «C:/OpenSSL» and go to «Control Panel > System > Advanced system settings > Environment Variables» and select the Variable «Path» in the «System variables» window and click Edit. And finally, add the path to your OpenSSL bin folder to the end of the «Variable value» after a «;». For example, using «C:/OpenSSL» install folder, you’ll type
;C:OpenSSLbin
. -
You’ll have to do the same for JavaSDK. Install it and then add the environment variable. Using Java8, I have putted
;C:Program FilesJavajdk1.8.0bin
just after openssl one. -
Adding these variables make prompt commands working (like «keytool» or «openssl») but to make it work in Unity, I have had to restart Windows. The problem was here. When I was testing some solutions without restarting, they didn’t work. But if you install these packages and configure environment variables like I did and after that, restart windows, when you’ll create a new Unity project using the last Facebook SDK, you’ll probably not get the warning message telling you «keytool» or maybe «openssl» is not founded.
answered Nov 12, 2015 at 14:55
Adnan NazirAdnan Nazir
4311 gold badge7 silver badges22 bronze badges
$endgroup$
You must log in to answer this question.
Not the answer you’re looking for? Browse other questions tagged
.
Not the answer you’re looking for? Browse other questions tagged
.
question
doronhn
asked
Aug 5, ’18
hey,
i am working with playfab and facebook sdk, when i try to build for android i am getting this error:
Error building Player: Your Android setup is not correct. See Settings in Facebook menu.
i found some same topic over here with no solution.
any idea?
unity3dsdks
Comment
Comment
10 |1200
- Viewable by all users
- Viewable by moderators
- Viewable by moderators and the original poster
- Advanced visibility
Toggle Comment visibility. Current Visibility: Viewable by all users
Attachments: Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.
1 Answer
·
brendan
answered
Aug 5, ’18
The issue is, that’s not an issue with anything PlayFab related. Are you using Unity? Have a look at this thread: https://forum.unity.com/threads/fixed-ucb-team-android-builds-with-the-facebook-sdk-are-failing-17th-march.461561/
1
comment
Comment
10 |1200
- Viewable by all users
- Viewable by moderators
- Viewable by moderators and the original poster
- Advanced visibility
Toggle Comment visibility. Current Visibility: Viewable by all users
Attachments: Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.
doronhn
commented
· Aug 05, 2018 at 08:28 PM
i saw this post, didnt saw any solution there.
i ended up installing open ssl , and it fix the problem.
0 Likes 0
·
Write an Answer
Write an Answer
Hint: Notify or tag a user in this post by typing @username.
Attachments: Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.
Even new v8.1.0 version tries to obtain SDK incorrectly when Embedded SDK Check is marked.
Value in EditorPrefs for «AndroidSdkRoot» can be set to custom anyway.
Here’s is my workaround to get rid of the error message about SDK during build (GPGS plugin obtains real embedded values the same way):
_log.Log("preferences to use embedded JDK and android SDK/NDK");
EditorPrefs.SetInt("JdkUseEmbedded", 1);
EditorPrefs.SetInt("SdkUseEmbedded", 1);
EditorPrefs.SetInt("NdkUseEmbedded", 1);
// workaround to fix android build error message in Unity 2020.1.9 + FacebookSDK v8.1.0
// reset any custom value specified in settings even when embedded setting is marked
// because thirparty (FacebookSDK v8.1.0 looks to the following values instead of using embedded ones)
// possibly it's Unity issue - we need the way to obtain default values too
var androidPlayerDir = BuildPipeline.GetPlaybackEngineDirectory(BuildTarget.Android, BuildOptions.None);
if (string.IsNullOrEmpty(androidPlayerDir))
throw new Exception("BuildPipeline.GetPlaybackEngineDirectory(BuildTarget.Android) failed");
void SetDefaultToolsDir(string prefsKey, string subDir)
{
var dir = Path.Combine(androidPlayerDir, subDir);
if (!Directory.Exists(dir))
throw new Exception($"failed to find installed with unity external tool: {prefsKey}: {dir}");
EditorPrefs.SetString(prefsKey, dir);
}
SetDefaultToolsDir("JdkPath", "OpenJDK");
SetDefaultToolsDir("AndroidSdkRoot", "SDK");
SetDefaultToolsDir("AndroidNdkRoot", "NDK");
SetDefaultToolsDir("AndroidNdkRootR19", "NDK");
_log.Log($"JdkPath: {EditorPrefs.GetString("JdkPath")}");
_log.Log($"AndroidSdkRoot: {EditorPrefs.GetString("AndroidSdkRoot")}");
_log.Log($"AndroidNdkRoot: {EditorPrefs.GetString("AndroidNdkRoot")}");
_log.Log($"AndroidNdkRootR19: {EditorPrefs.GetString("AndroidNdkRootR19")}");
1] После импортирующего пакета найдите следующие проблемы в Android, это проблема с окружающей средой OpenSSL
ERROR:Your Android setup is not correct. See Settings in Facebook menu.
Открыть Facebooksetting:
включитьhttps://code.google.com/archive/p/openssl-for-windows/downloads
Скачать соответствующий SSL
После загрузки декомпрессия находится в каталоге C: Program файлов, ———— [неправильно! ! ! ! ! Путь SSL не может с пространством! ! ! А где этот путь случайный, до тех пор, пока путь прав, это ojbk.
Windows Enter Env Открыть конфигурацию среды
Оригинальные переменные -> системные переменные -> Найти путь, редактировать
Новая переменная, затем введите путь
Затем открыть единство
2] Когда вы экспортируете APK, если это сообщается, то подумайте, что Keystone создается команда CMD.
Конкретная операция на FB разработчик
Секретный ключ развития: keytool -exportcert -alaias androiddebugkey-itstore% homepath% . Android debug.keystore | openssl sha1-bary | openssl base64
Публикация секретного ключа: keytool -exportcert -lias your_release_key_alias — keystore your_release_key_path | openssl sha1 minary | openssl base64
Например: keytool-exportcert -lias Slots [Имя псевдонима] — keyStore e: _ Worksprojects laohuji app_code androidkeystone / slots.keystore Кладовой таблицы [] | D: openssl bin openssl.exe sha1 [path] OpensSL | D: openssl bin openssl.exe 【path openssl】 base64
[Лучше всего выпустить секрет при разработке
PS: Обязательно быть. Файл клавиш для выполнения KeyTool и других операций
I know that similar questions have been asked before, and I have reviewed all of the answers suggested, tried lots of different possible solutions, but still no go, so I’m asking my (same) question again…
I’m trying to access FB through a Unity app that I’m developing for Android. I downloaded the FB SDK and did as instructed on the developer website. The problem is that, when in Unity, in Facebook / Edit Settings, the Android Debug Haskey that I’m supposed to copy into the FB developer website is missing.
I tried re-generating a key with keytool and OpenSSL (which are both in my PATH, I made sure of that, too) and pasted it into the FB site, but it still doesn’t work (I get an error message which goes : «Your Android setup is not correct. See Settings in Facebook menu. UnityEditor.HostView:OnGUI()»
The thing I don’t get is that there WAS (and still is, but I guess it’s a different file now that I’ve ran keytool, etc.) a debug.keystore in my %HOMEPATH%.android folder, so there seems to be nothing wrong here either.
I restarted Unity many times (each time I tried one of the solutions described in the StackOverflow answers I’d found) to check whether the key would appear : it didn’t.
I really am at my wit’s end, and do not know anyone proficient enough in Android dev to help me out (I’m just a beginner @ Unity). Does anybody know what I should do / doublecheck to fix that ?
NB : The only solution I have not tried is the one described in Unity : creating and building an empty project in Eclipse. Having never developed natively for Android, I have no idea how this is done…
Example 1: flutter You uploaded an APK or Android App Bundle that was signed in debug mode
buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.release
}
}
// FLUTTER CLEAN AFTER THE EDIT
Example 2: android not have focus ob start
<!-- Dummy item to prevent AutoCompleteTextView from receiving focus -->
<LinearLayout
android:focusable="true"
android:focusableInTouchMode="true"
android:layout_width="0px"
android:layout_height="0px"/>
<!-- :nextFocusUp and :nextFocusLeft have been set to the id of this component
to prevent the dummy from receiving focus again -->
<AutoCompleteTextView android:id="@+id/autotext"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:nextFocusUp="@id/autotext"
android:nextFocusLeft="@id/autotext"/>
Tags:
Misc Example
Related
For all my games, I use:
-
MoPob mediation to monetize.
-
Unity Easy Mobile Pro asset to integrate MoPub ADs/mediation and to implement other generic features like app rating etc,.
For reference I am using Unity 2019.4.17f1.
Time to time I see few errors while building for Android. So, in this bog post I am compiling fixes for my future reference and to help for other devs who face these.
-
No Java runtime present, requesting install.
-
Error: unexpected element <queries> found in <manifest>
-
Error while merging dex archives: The number of method references in a .dex file cannot exceed 64K.
-
Your Android setup is not correct. See Settings in Facebook menu.
-
You uploaded a debuggable APK or Android App Bundle.
-
Google Play Console Error: This release is not compliant with the Google Play 64-bit requirement.
Could not find or load main class com.android.manifmerger.Merger
Still not sure what the root cause is for this issue, time to time this reappears and disappears. Things to do to fix this:
-
Perform this trick Failed to update Android SDK Package List
-
Get the latest SDK, NDK, and SDK tools from Android Studio that is pointing to Unity Android set up.
-
Last but not least, get latest assets and import them in my case they are — EasyMobilePro, GameAnalytics, Facebook SDK, GoogleMobileADs
No Java runtime present, requesting install.
After you install Unity for the first time, some times it throws this error.
From https://github.com/firebase/quickstart-unity/issues/849 post: «So first, I know this sounds really odd, but I’ve seen issues in MacOS in the past that are resolved simply by toggling the «JDK Installed with Unity» button. As in on or off doesn’t matter, just that it changes. Try unchecking that and hitting build (without restarting Unity). If that works, that is one bug to start tracking and can help you get unstuck.»
I tried toggle & untoggle couple of times and it fixed No Java runtime present, requesting install. issue.
Failed to update Android SDK Package List
step 1 — Disable all checkmarks in preferences and close editor. step 2 — Reopen the editor Enable all checkmarks in preferences after that hit the play button. Now it will start resolving dependencies for android and the problem will be solved
Ref: https://answers.unity.com/questions/1719056/failed-to-update-android-sdk-package-list-unity-20.html
Error: unexpected element <queries> found in <manifest>
To fix this use gradle version that included queries in it, which seems to be above 3.4.3. So use this
classpath 'com.android.tools.build:gradle:3.4.3'
instead of
classpath 'com.android.tools.build:gradle:3.4.0'
From this link https://answers.unity.com/questions/1784106/applovinmax-inmobi-adapter-failes-the-build-with-g.html
Error while merging dex archives: The number of method references in a .dex file cannot exceed 64K.
To fix this enable multidex via launcherTemplate.gradle
-
multiDexEnabled true
-
implementation ‘androidx.multidex:multidex:2.0.1’
Reference: https://forum.unity.com/threads/cant-build-with-multidex-enabled.773348/
Your Android setup is not correct. See Settings in Facebook menu.
Just uncheck recommended Android SDK from Unity preferences and browse Android SDK to the exact same one Unity already using will fix this issue.
Reference: https://forum.unity.com/threads/fixed-ucb-team-android-builds-with-the-facebook-sdk-are-failing-17th-march.461561/?_ga=2.228307998.221903671.1610293567-802375710.1601661615
You uploaded a debuggable APK or Android App Bundle.
Sometimes when I upload android build that is built with Unity throws this error: You uploaded a debuggable APK or Android App Bundle. For security reasons you need to disable debugging before it can be published in Google Play. Learn more about debuggable APKs and Android App Bundles.
If you are using FacebookSDK which comes with Google Play services, it can be that in injects a Debuggable=true key in the Manifest, for whatever reason.
you can fix it by going to Assets -> Android -> AndroidManifest.xml
In there find ‘android:debuggable=»true»‘ and set it to false.
Reference : https://forum.unity.com/threads/2019-3-you-uploaded-a-debuggable-apk.757094/
Google Play Console Error: This release is not compliant with the Google Play 64-bit requirement.
To fix this Go to Player Settings -> Other Setting -> Under Configuration
-
Select IL2CPP for Scripting Background.
-
Now you will see ARM64 under Target Architecture and check it.
-
Regenerate build and it shouldn’t throw above error anymore.