起初,我可以正常构建我的游戏。然后我导入firebase并将其编码到我的脚本中以调用firebase中的数据库。我在Unity中运行游戏,它在firebase中有数据。
void Start()
{
// Set up the Editor before calling into the realtime database.
//FirebaseApp.DefaultInstance.SetEditorDatabaseUrl("https://lively-option-113515.firebaseio.com/");
}
IEnumerator LoadData() {
//yield return new WaitForSeconds(5.1f);
string wwwtext = "";
if (hasInternet)
{
var subjectsData = FirebaseDatabase
.DefaultInstance.GetReference("data").Child("0").GetValueAsync();
yield return new WaitUntil(() => subjectsData.IsCompleted || subjectsData.IsFaulted);
if (subjectsData.IsCompleted)
{
wwwtext = subjectsData.Result.GetRawJsonValue();
print("text:" + wwwtext);
}
}
print (wwwtext);
var total_word_local = 0;
Data _data_online=null;
if (!wwwtext.Equals(""))
{
_data_online = JsonUtility.FromJson<Data>(wwwtext);
print("data onl: " + _data_online.version.ToString());
}
var text_offline = PlayerPrefs.GetString ("data", "");
Data _data_offline=null;
if (!text_offline.Equals ("") && text_offline.Contains("subjects")) {
_data_offline = JsonUtility.FromJson<Data> (text_offline);
}
if (_data_offline == null) {
TextAsset ta = Resources.Load ("data") as TextAsset;
_data_offline = JsonUtility.FromJson<Data> (ta.text);
}
if (_data_online != null) {
if (_data_online.version > _data_offline.version) {
data = _data_online;
PlayerPrefs.SetString ("data", wwwtext);
} else
data = _data_offline;
} else
data = _data_offline;
int count_subject = 0;
foreach (var item in data.subjects) {
//print(item.brain);
count_subject++;
foreach (var u in item.words) {
total_word_local++;
string key = item.name + total_word.ToString ();
item.hint = PlayerPrefs.GetInt (key, 0);
item.solve=(PlayerPrefs.GetInt(key+"solve",0)==1)?true:false;
if (count_subject <= 20 || data.version >=20)
item.show = true;
else item.show = false;
}
}
total_word = total_word_local;
Load ();
Save ();
ShowMenu ();
Begin();
BoardCreate ();
if(PlayerPrefs.GetInt("notify",0)==0)
{
SendNotification();
PlayerPrefs.SetInt("notify", 1);
}
}
但是当我再次构建时,它会显示此错误。
CommandInvokationFailure: Failed to re-package resources.
C:\Users\TaiTran\AppData\Local\Android\sdk\build-tools\25.0.1\aapt.exe package --auto-add-overlay -v -f -m -J gen -M AndroidManifest.xml -S "res" -I "C:/Users/TaiTran/AppData/Local/Android/sdk\platforms\android-25\android.jar" -F bin/resources.ap_ --extra-packages com.unity.purchasing:com.facebook:com.facebook.android:com.google.firebase.unity:com.google.firebase.unity.app:com.google.firebase.auth.api:com.google.firebase.unity.auth:com.google.firebase:com.google.android.gms:com.google.unity:com.unity.purchasing.googleplay:com.google.android.gms.base:com.google.android.gms:com.google.android.gms.tasks:android.support.v4:com.pixa.findword:com.pushok.test -S "C:\Users\TaiTran\Desktop\FindWordBasic\Temp\StagingArea\android-libraries\common\res" -S "C:\Users\TaiTran\Desktop\FindWordBasic\Temp\StagingArea\android-libraries\facebook-android-sdk-4.8.2\res" -S "C:\Users\TaiTran\Desktop\FindWordBasic\Temp\StagingArea\android-libraries\facebook-android-wrapper-release\res" -S "C:\Users\TaiTran\Desktop\FindWordBasic\Temp\StagingArea\android-libraries\Firebase\res" -S "C:\Users\TaiTran\Desktop\FindWordBasic\Temp\StagingArea\android-libraries\firebase-auth-10.2.0\res" -S "C:\Users\TaiTran\Desktop\FindWordBasic\Temp\StagingArea\android-libraries\firebase-common-10.2.0\res" -S "C:\Users\TaiTran\Desktop\FindWordBasic\Temp\StagingArea\android-libraries\google-play-services_lib\res" -S "C:\Users\TaiTran\Desktop\FindWordBasic\Temp\StagingArea\android-libraries\GooglePlay\res" -S "C:\Users\TaiTran\Desktop\FindWordBasic\Temp\StagingArea\android-libraries\play-services-base-10.2.0\res" -S "C:\Users\TaiTran\Desktop\FindWordBasic\Temp\StagingArea\android-libraries\play-services-basement-10.2.0\res" -S "C:\Users\TaiTran\Desktop\FindWordBasic\Temp\StagingArea\android-libraries\play-services-tasks-10.2.0\res" -S "C:\Users\TaiTran\Desktop\FindWordBasic\Temp\StagingArea\android-libraries\support-v4-24.0.0\res" -S "C:\Users\TaiTran\Desktop\FindWordBasic\Temp\StagingArea\android-libraries\unity-android-resources\res"
stderr[
warning: string 'common_google_play_services_api_unavailable_text' has no default translation.
C:\Users\TaiTran\Desktop\FindWordBasic\Temp\StagingArea\android-libraries\google-play-services_lib\res\values-az-rAZ\common_strings.xml:31: note: locale az-AZ found
C:\Users\TaiTran\Desktop\FindWordBasic\Temp\StagingArea\android-libraries\google-play-services_lib\res\values-en-rAU\common_strings.xml:31: note: locale en-AU found
C:\Users\TaiTran\Desktop\FindWordBasic\Temp\StagingArea\android-libraries\google-play-services_lib\res\values-gu-rIN\common_strings.xml:31: note: locale gu-IN found
C:\Users\TaiTran\Desktop\FindWordBasic\Temp\StagingArea\android-libraries\google-play-services_lib\res\values-pa-rIN\common_strings.xml:31: note: locale pa-IN found
C:\Users\TaiTran\Desktop\FindWordBasic\Temp\StagingArea\android-libraries\google-play-services_lib\res\values-sq-rAL\common_strings.xml:31: note: locale sq-AL found
warning: string 'common_google_play_services_updating_title' has no default translation.
C:\Users\TaiTran\Desktop\FindWordBasic\Temp\StagingArea\android-libraries\google-play-services_lib\res\values-az-rAZ\common_strings.xml:20: note: locale az-AZ found
C:\Users\TaiTran\Desktop\FindWordBasic\Temp\StagingArea\android-libraries\google-play-services_lib\res\values-en-rAU\common_strings.xml:20: note: locale en-AU found
C:\Users\TaiTran\Desktop\FindWordBasic\Temp\StagingArea\android-libraries\google-play-services_lib\res\values-gu-rIN\common_strings.xml:20: note: locale gu-IN found
C:\Users\TaiTran\Desktop\FindWordBasic\Temp\StagingArea\android-libraries\google-play-services_lib\res\values-pa-rIN\common_strings.xml:20: note: locale pa-IN found
C:\Users\TaiTran\Desktop\FindWordBasic\Temp\StagingArea\android-libraries\google-play-services_lib\res\values-sq-rAL\common_strings.xml:20: note: locale sq-AL found
C:\Users\TaiTran\Desktop\FindWordBasic\Temp\StagingArea\android-libraries\google-play-services_lib\res\values\base_attrs.xml:11: error: Attribute "buttonSize" already defined with incompatible format.
C:\Users\TaiTran\Desktop\FindWordBasic\Temp\StagingArea\android-libraries\play-services-base-10.2.0\res\values\values.xml:47: Original attribute defined here.
C:\Users\TaiTran\Desktop\FindWordBasic\Temp\StagingArea\android-libraries\google-play-services_lib\res\values\base_attrs.xml:16: error: Attribute "colorScheme" already defined with incompatible format.
C:\Users\TaiTran\Desktop\FindWordBasic\Temp\StagingArea\android-libraries\play-services-base-10.2.0\res\values\values.xml:55: Original attribute defined here.
C:\Users\TaiTran\Desktop\FindWordBasic\Temp\StagingArea\android-libraries\google-play-services_lib\res\values\common_attrs.xml:13: error: Attribute "imageAspectRatioAdjust" already defined with incompatible format.
C:\Users\TaiTran\Desktop\FindWordBasic\Temp\StagingArea\android-libraries\play-services-base-10.2.0\res\values\values.xml:34: Original attribute defined here.
]
stdout[
Configurations:
(default)
mdpi-v4
hdpi-v4
xhdpi-v4
xxhdpi-v4
xxxhdpi-v4
Files:
drawable\notify_icon_small.png
Src: () C:\Users\TaiTran\Desktop\FindWordBasic\Temp\StagingArea\android-libraries\unity-android-resources\res\drawable\notify_icon_small.png
Src: (mdpi-v4) C:\Users\TaiTran\Desktop\FindWordBasic\Temp\StagingArea\android-libraries\unity-android-resources\res\drawable-mdpi\notify_icon_small.png
Src: (hdpi-v4) C:\Users\TaiTran\Desktop\FindWordBasic\Temp\StagingArea\android-libraries\unity-android-resources\res\drawable-hdpi\notify_icon_small.png
Src: (xhdpi-v4) C:\Users\TaiTran\Desktop\FindWordBasic\Temp\StagingArea\android-libraries\unity-android-resources\res\drawable-xhdpi\notify_icon_small.png
Src: (xxhdpi-v4) C:\Users\TaiTran\Desktop\FindWordBasic\Temp\StagingArea\android-libraries\unity-android-resources\res\drawable-xxhdpi\notify_icon_small.png
Src: (xxxhdpi-v4) C:\Users\TaiTran\Desktop\FindWordBasic\Temp\StagingArea\android-libraries\unity-android-resources\res\drawable-xxxhdpi\notify_icon_small.png
AndroidManifest.xml
Src: () AndroidManifest.xml
Resource Dirs:
Type drawable
drawable\notify_icon_small.png
Src: () C:\Users\TaiTran\Desktop\FindWordBasic\Temp\StagingArea\android-libraries\unity-android-resources\res\drawable\notify_icon_small.png
Src: (mdpi-v4) C:\Users\TaiTran\Desktop\FindWordBasic\Temp\StagingArea\android-libraries\unity-android-resources\res\drawable-mdpi\notify_icon_small.png
Src: (hdpi-v4) C:\Users\TaiTran\Desktop\FindWordBasic\Temp\StagingArea\android-libraries\unity-android-resources\res\drawable-hdpi\notify_icon_small.png
Src: (xhdpi-v4) C:\Users\TaiTran\Desktop\FindWordBasic\Temp\StagingArea\android-libraries\unity-android-resources\res\drawable-xhdpi\notify_icon_small.png
Src: (xxhdpi-v4) C:\Users\TaiTran\Desktop\FindWordBasic\Temp\StagingArea\android-libraries\unity-android-resources\res\drawable-xxhdpi\notify_icon_small.png
Src: (xxxhdpi-v4) C:\Users\TaiTran\Desktop\FindWordBasic\Temp\StagingArea\android-libraries\unity-android-resources\res\drawable-xxxhdpi\notify_icon_small.png
Including resources from package: C:\Users\TaiTran\AppData\Local\Android\sdk\platforms\android-25\android.jar
applyFileOverlay for drawable
trying overlaySet Key=common_full_open_on_phone.png
trying overlaySet Key=common_google_signin_btn_icon_dark.xml
trying overlaySet Key=common_google_signin_btn_icon_dark_focused.xml
trying overlaySet Key=common_google_signin_btn_icon_dark_normal.xml
trying overlaySet Key=common_google_signin_btn_icon_dark_normal_background.9.png
trying overlaySet Key=common_google_signin_btn_icon_disabled.xml
trying overlaySet Key=common_google_signin_btn_icon_light.xml
trying overlaySet Key=common_google_signin_btn_icon_light_focused.xml
trying overlaySet Key=common_google_signin_btn_icon_light_normal.xml
trying overlaySet Key=common_google_signin_btn_icon_light_normal_background.9.png
trying overlaySet Key=common_google_signin_btn_text_dark.xml
trying overlaySet Key=common_google_signin_btn_text_dark_focused.xml
trying overlaySet Key=common_google_signin_btn_text_dark_normal.xml
trying overlaySet Key=common_google_signin_btn_text_dark_normal_background.9.png
trying overlaySet Key=common_google_signin_btn_text_disabled.xml
trying overlaySet Key=common_google_signin_btn_text_light.xml
trying overlaySet Key=common_google_signin_btn_text_light_focused.xml
trying overlaySet Key=common_google_signin_btn_text_light_normal.xml
trying overlaySet Key=common_google_signin_btn_text_light_normal_background.9.png
trying overlaySet Key=googleg_disabled_color_18.png
trying overlaySet Key=googleg_standard_color_18.png
trying overlaySet Key=cast_ic_notification_0.png
trying overlaySet Key=cast_ic_notification_1.png
trying overlaySet Key=cast_ic_notification_2.png
trying overlaySet Key=cast_ic_notification_connecting.xml
trying overlaySet Key=cast_ic_notification_on.png
trying overlaySet Key=common_full_open_on_phone.png
baseFile 0 has flavor hdpi-v4
baseFile 1 has flavor xhdpi-v4
overlayFile 0 has flavor mdpi-v4
overlayFile 1 has flavor tvdpi-v4
overlayFile 2 has flavor hdpi-v4
overlayFile 3 has flavor xhdpi-v4
overlayFile 4 has flavor xxhdpi-v4
nothing matches overlay file common_full_open_on_phone.png, for flavor mdpi-v4
nothing matches overlay file common_full_open_on_phone.png, for flavor tvdpi-v4
found a match (2) for overlay file common_full_open_on_phone.png, for flavor hdpi-v4
found a match (3) for overlay file common_full_open_on_phone.png, for flavor xhdpi-v4
nothing matches overlay file common_full_open_on_phone.png, for flavor xxhdpi-v4
trying overlaySet Key=common_google_signin_btn_icon_dark.xml
baseFile 0 has flavor
overlayFile 0 has flavor
found a match (0) for overlay file common_google_signin_btn_icon_dark.xml, for flavor
trying overlaySet Key=common_google_signin_btn_icon_dark_disabled.9.png
trying overlaySet Key=common_google_signin_btn_icon_dark_focused.9.png
trying overlaySet Key=common_google_signin_btn_icon_dark_normal.9.png
trying overlaySet Key=common_google_signin_btn_icon_dark_pressed.9.png
trying overlaySet Key=common_google_signin_btn_icon_light.xml
baseFile 0 has flavor
overlayFile 0 has flavor
found a match (0) for overlay file common_google_signin_btn_icon_light.xml, for flavor
trying overlaySet Key=common_google_signin_btn_icon_light_disabled.9.png
trying overlaySet Key=common_google_signin_btn_icon_light_focused.9.png
trying overlaySet Key=common_google_signin_btn_icon_light_normal.9.png
trying overlaySet Key=common_google_signin_btn_icon_light_pressed.9.png
trying overlaySet Key=common_google_signin_btn_text_dark.xml
baseFile 0 has flavor
overlayFile 0 has flavor
found a match (0) for overlay file common_google_signin_btn_text_dark.xml, for flavor
trying overlaySet Key=common_google_signin_btn_text_dark_disabled.9.png
trying overlaySet Key=common_google_signin_btn_text_dark_focused.9.png
trying overlaySet Key=common_google_signin_btn_text_dark_normal.9.png
trying overlaySet Key=common_google_signin_btn_text_dark_pressed.9.png
trying overlaySet Key=common_google_signin_btn_text_light.xml
baseFile 0 has flavor
overlayFile 0 has flavor
found a match (0) for overlay file common_google_signin_btn_text_light.xml, for flavor
trying overlaySet Key=common_google_signin_btn_text_light_disabled.9.png
trying overlaySet Key=common_google_signin_btn_text_light_focused.9.png
trying overlaySet Key=common_google_signin_btn_text_light_normal.9.png
trying overlaySet Key=common_google_signin_btn_text_light_pressed.9.png
trying overlaySet Key=common_ic_googleplayservices.png
trying overlaySet Key=common_plus_signin_btn_icon_dark.xml
trying overlaySet Key=common_plus_signin_btn_icon_dark_disabled.9.png
trying overlaySet Key=common_plus_signin_btn_icon_dark_focused.9.png
trying overlaySet Key=common_plus_signin_btn_icon_dark_normal.9.png
trying overlaySet Key=common_plus_signin_btn_icon_dark_pressed.9.png
trying overlaySet Key=common_plus_signin_btn_icon_light.xml
trying overlaySet Key=common_plus_signin_btn_icon_light_disabled.9.png
trying overlaySet Key=common_plus_signin_btn_icon_light_focused.9.png
trying overlaySet Key=common_plus_signin_btn_icon_light_normal.9.png
trying overlaySet Key=common_plus_signin_btn_icon_light_pressed.9.png
trying overlaySet Key=common_plus_signin_btn_text_dark.xml
trying overlaySet Key=common_plus_signin_btn_text_dark_disabled.9.png
trying overlaySet Key=common_plus_signin_btn_text_dark_focused.9.png
trying overlaySet Key=common_plus_signin_btn_text_dark_normal.9.png
trying overlaySet Key=common_plus_signin_btn_text_dark_pressed.9.png
trying overlaySet Key=common_plus_signin_btn_text_light.xml
trying overlaySet Key=common_plus_signin_btn_text_light_disabled.9.png
trying overlaySet Key=common_plus_signin_btn_text_light_focused.9.png
trying overlaySet Key=common_plus_signin_btn_text_light_normal.9.png
trying overlaySet Key=common_plus_signin_btn_text_light_pressed.9.png
trying overlaySet Key=common_signin_btn_icon_dark.xml
trying overlaySet Key=common_signin_btn_icon_disabled_dark.9.png
trying overlaySet Key=common_signin_btn_icon_disabled_focus_dark.9.png
trying overlaySet Key=common_signin_btn_icon_disabled_focus_light.9.png
trying overlaySet Key=common_signin_btn_icon_disabled_light.9.png
trying overlaySet Key=common_signin_btn_icon_focus_dark.9.png
trying overlaySet Key=common_signin_btn_icon_focus_light.9.png
trying overlaySet Key=common_signin_btn_icon_light.xml
trying overlaySet Key=common_signin_btn_icon_normal_dark.9.png
trying overlaySet Key=common_signin_btn_icon_normal_light.9.png
trying overlaySet Key=common_signin_btn_icon_pressed_dark.9.png
trying overlaySet Key=common_signin_btn_icon_pressed_light.9.png
trying overlaySet Key=common_signin_btn_text_dark.xml
trying overlaySet Key=common_signin_btn_text_disabled_dark.9.png
trying overlaySet Key=common_signin_btn_text_disabled_focus_dark.9.png
trying overlaySet Key=common_signin_btn_text_disabled_focus_light.9.png
trying overlaySet Key=common_signin_btn_text_disabled_light.9.png
trying overlaySet Key=common_signin_btn_text_focus_dark.9.png
trying overlaySet Key=common_signin_btn_text_focus_light.9.png
trying overlaySet Key=common_signin_btn_text_light.xml
trying overlaySet Key=common_signin_btn_text_normal_dark.9.png
trying overlaySet Key=common_signin_btn_text_normal_light.9.png
trying overlaySet Key=common_signin_btn_text_pressed_dark.9.png
trying overlaySet Key=common_signin_btn_text_pressed_light.9.png
trying overlaySet Key=ic_plusone_medium_off_client.png
trying overlaySet Key=ic_plusone_small_off_client.png
trying overlaySet Key=ic_plusone_standard_off_client.png
trying overlaySet Key=ic_plusone_tall_off_client.png
trying overlaySet Key=powered_by_google_dark.png
trying overlaySet Key=powered_by_google_light.png
trying overlaySet Key=com_facebook_button_background.xml
trying overlaySet Key=com_facebook_button_icon.png
trying overlaySet Key=com_facebook_button_like_background.xml
trying overlaySet Key=com_facebook_button_like_icon_selected.png
trying overlaySet Key=com_facebook_button_login_silver_background.xml
trying overlaySet Key=com_facebook_button_send_background.xml
trying overlaySet Key=com_facebook_button_send_icon.png
trying overlaySet Key=com_facebook_close.png
trying overlaySet Key=com_facebook_profile_picture_blank_portrait.png
trying overlaySet Key=com_facebook_profile_picture_blank_square.png
trying overlaySet Key=com_facebook_tooltip_black_background.9.png
trying overlaySet Key=com_facebook_tooltip_black_bottomnub.png
trying overlaySet Key=com_facebook_tooltip_black_topnub.png
trying overlaySet Key=com_facebook_tooltip_black_xout.png
trying overlaySet Key=com_facebook_tooltip_blue_background.9.png
trying overlaySet Key=com_facebook_tooltip_blue_bottomnub.png
trying overlaySet Key=com_facebook_tooltip_blue_topnub.png
trying overlaySet Key=com_facebook_tooltip_blue_xout.png
trying overlaySet Key=messenger_bubble_large_blue.png
trying overlaySet Key=messenger_bubble_large_white.png
trying overlaySet Key=messenger_bubble_small_blue.png
trying overlaySet Key=messenger_bubble_small_white.png
trying overlaySet Key=messenger_button_blue_bg_round.xml
trying overlaySet Key=messenger_button_blue_bg_selector.xml
trying overlaySet Key<message truncated>
这个错误意味着什么,以及如何修复它们?