我们之前为 jellybean to nougat 开发了一个应用程序,但现在我们在 visual studio 中更新我们的 xamarin 后遇到了问题。
以前,我们的 apk 在所有 Android 版本中都能完美运行,但现在更新后,它现在正在崩溃......但仅在 5.1.1 中。我们已经使用 kitkat、lollipop 5.1、marshmallow 和 nougat 对其进行了测试,并且它确实在运行。
我们注意到我们的应用程序在 OnCreate 方法中的最后一个大括号“}”之后崩溃了。它在没有事先详细信息的情况下启动异常。
这个异常的原因是什么?或者任何已经有人解决的解决方案。
我不知道这是否只是由于 xamarin 更新而更改的设置。
在其他5.1和5.1.1版本上测试,仅在OPPO手机上出现异常
异常图像在这里,正如我所说,没有任何细节
这是调试器的输出
Android application is debugging.
Mono Warning: option gen-compact-seq-points is deprecated.
07-14 10:37:16.613 W/monodroid(18119): Trying to load sgen from: /data/app/RBOS_2.x_0.x_1.RBOS_2.x_0.x_1-1/lib/arm/libmonosgen-2.0.so
07-14 10:37:16.613 W/monodroid-debug(18119): Trying to initialize the debugger with options: --debugger-agent=transport=dt_socket,loglevel=0,address=127.0.0.1:29342,server=y,embedding=1
07-14 10:37:16.953 W/monodroid-debug(18119): Accepted stdout connection: 29
07-14 10:37:18.793 W/monodroid-gc(18119): GREF GC Threshold: 46080
07-14 10:37:18.793 W/monodroid(18119): Calling into managed runtime init
Loaded assembly: RBOS 2.0.1.dll
Loaded assembly: BusinessLogic.dll
Loaded assembly: BusinessObject.dll
Loaded assembly: DotNetCross.Memory.Unsafe.dll [External]
Loaded assembly: Newtonsoft.Json.dll [External]
Loaded assembly: Realm.dll [External]
Loaded assembly: Remotion.Linq.dll [External]
Loaded assembly: Xamarin.Android.Support.Animated.Vector.Drawable.dll [External]
Loaded assembly: Xamarin.Android.Support.Design.dll [External]
Loaded assembly: Xamarin.Android.Support.v4.dll [External]
Loaded assembly: Xamarin.Android.Support.v7.AppCompat.dll [External]
Loaded assembly: Xamarin.Android.Support.v7.CardView.dll [External]
Loaded assembly: Xamarin.Android.Support.v7.RecyclerView.dll [External]
Loaded assembly: Xamarin.Android.Support.Vector.Drawable.dll [External]
Loaded assembly: UTILITIES.dll
Loaded assembly: Mono.Android.dll [External]
Loaded assembly: Java.Interop.dll [External]
Loaded assembly: System.Core.dll [External]
Loaded assembly: MonoDroidConstructors [External]
Loaded assembly: System.dll [External]
Loaded assembly: System.Data.dll [External]
Loaded assembly: System.Xml.dll [External]
07-14 10:37:20.183 D/OpenGLRenderer(18119): Use EGL_SWAP_BEHAVIOR_PRESERVED: true
07-14 10:37:20.193 D/Atlas (18119): Validating map...
07-14 10:37:20.303 W/ResourceType(18119): Too many attribute references, stopped at: 0x01010099
07-14 10:37:20.303 W/ResourceType(18119): Too many attribute references, stopped at: 0x0101009b
07-14 10:37:20.313 I/TextInputLayout(18119): EditText added is not a TextInputEditText. Please switch to using that class instead.
Loaded assembly: System.Web.Services.dll [External]
Loaded assembly: Mono.Security.dll [External]
07-14 10:37:20.903 I/Adreno-EGL(18119): <qeglDrvAPI_eglInitialize:379>: EGL 1.4 QUALCOMM build:
AU_LINUX_ANDROID_LA.BR.1.1.3.C8.05.01.00.115.092_msm8916_64_refs/tags/AU_LINUX_ANDROID_LA.BR.1.1.3.C8.05.01.00.115.092__release_AU (I6eddbfa548)
07-14 10:37:20.903 I/Adreno-EGL(18119): OpenGL ES Shader Compiler Version: E031.25.03.04
07-14 10:37:20.903 I/Adreno-EGL(18119): Build Date: 09/16/15 Wed
07-14 10:37:20.903 I/Adreno-EGL(18119): Local Branch:
07-14 10:37:20.903 I/Adreno-EGL(18119): Remote Branch: refs/tags/AU_LINUX_ANDROID_LA.BR.1.1.3.C8.05.01.00.115.092
07-14 10:37:20.903 I/Adreno-EGL(18119): Local Patches: NONE
07-14 10:37:20.903 I/Adreno-EGL(18119): Reconstruct Branch: NOTHING
07-14 10:37:20.903 I/OpenGLRenderer(18119): Initialized EGL, version 1.4
07-14 10:37:20.923 D/OpenGLRenderer(18119): Enabling debug mode 0
07-14 10:37:20.963 W/ResourceType(18119): Too many attribute references, stopped at: 0x01010099
07-14 10:37:20.963 W/ResourceType(18119): Too many attribute references, stopped at: 0x0101009b
07-14 10:37:20.963 D/AndroidRuntime(18119): Shutting down VM
An unhandled exception occured.
示例如下
protected override void OnCreate(Bundle savedInstanceState)
{
base.OnCreate(savedInstanceState);
SetContentView(Resource.Layout.RequestAccess);
#region Check if there is an active user - proceed to login, else proceed to request access
UserAccountLogic.getAllUserAccountsFromDatabase(listUserObject);
if (listUserObject.Count > 0 && listUserObject[0].isActive!=0)
{
//Call LoginActivity
var intent = new Intent(this, typeof(Login));
StartActivity(intent);
FinishAffinity();
}
else
{
txtAccessCode = FindViewById<TextInputLayout>(Resource.Id.layoutAccessCode);
button = FindViewById<Button>(Resource.Id.btnSend);
button.Click += delegate { sendButtonClicked(); };
}
#endregion
Android.Util.Log.Error("L", "Error Occured");
}//this is the place where exception occur in 5.1.1 . I don't know why.
如果有一个用户并且是活跃的。它将继续登录。但同样的事情会发生。在 OnCreate() 方法下的 login.cs 最后一个括号会再次崩溃
这是 LogCat 输出,对我来说很难阅读,因为这是我第一次看到它。
E/L ( 6824): Error Occured // I added a log tag here before the bracket
V/WindowManager( 866): Adding window Window{386088e1 u0 RBOS_2.x_0.x_1.RBOS_2.x_0.x_1/md53392bfeb2a49aa0a04b6510289d0206f.RequestAccess} at 7 of 14 (before Window{3031e02c u0 Starting RBOS_2.x_0.x_1.RBOS_2.x_0.x_1})
V/WindowManager( 866): Changing focus from null to Window{386088e1 u0 RBOS_2.x_0.x_1.RBOS_2.x_0.x_1/md53392bfeb2a49aa0a04b6510289d0206f.RequestAccess} Callers=com.android.server.wm.WindowManagerService.relayoutWindow:3410 com.android.server.wm.Session.relayout:202 android.view.IWindowSession$Stub.onTransact:273 com.android.server.wm.Session.onTransact:130
I/Adreno-EGL( 6824): <qeglDrvAPI_eglInitialize:379>: EGL 1.4 QUALCOMM build: AU_LINUX_ANDROID_LA.BR.1.1.3.C8.05.01.00.115.092_msm8916_64_refs/tags/AU_LINUX_ANDROID_LA.BR.1.1.3.C8.05.01.00.115.092__release_AU (I6eddbfa548)
I/Adreno-EGL( 6824): OpenGL ES Shader Compiler Version: E031.25.03.04
I/Adreno-EGL( 6824): Build Date: 09/16/15 Wed
I/Adreno-EGL( 6824): Local Branch:
I/Adreno-EGL( 6824): Remote Branch: refs/tags/AU_LINUX_ANDROID_LA.BR.1.1.3.C8.05.01.00.115.092
I/Adreno-EGL( 6824): Local Patches: NONE
I/Adreno-EGL( 6824): Reconstruct Branch: NOTHING
I/OpenGLRenderer( 6824): Initialized EGL, version 1.4
D/OpenGLRenderer( 6824): Enabling debug mode 0
W/ResourceType( 6824): Too many attribute references, stopped at: 0x01010099
W/ResourceType( 6824): Too many attribute references, stopped at: 0x0101009b
D/AndroidRuntime( 6824): Shutting down VM
I/KSO_STAT( 1466): App is in background, stop update end time, ready to start a new session.
V/ExReceiver(32431): revceive action =android.intent.action.BATTERY_CHANGED
E/QCOMSysDaemon( 6861): Can't find/open bootselect node: (No such file or directory)
I/QCOMSysDaemon( 6861): Starting qcom system daemon
E/Diag_Lib( 6861): Diag_LSM_Init: Failed to open handle to diag driver, error = 2
E/QCOMSysDaemon( 6861): Diag_LSM_Init failed : 0
I/Babel_ConcService( 5697): Acquired partial wake lock to keep ConcurrentService alive
I/Babel_ConcService( 5697): Released partial wake lock as ConcurrentService became idle
I/KSO_STAT( 1466): App is in background, stop update end time, ready to start a new session.
W/ActivityManager( 866): Launch timeout has expired, giving up wake lock!
V/ExReceiver(32431): revceive action =android.intent.action.BATTERY_CHANGED
D/TelephonyProvider( 1787): simId = 0
D/TelephonyProvider( 1787): simId = 0
D/TelephonyProvider( 1787): query(): mccmnc = 51503 spn = SMART Prepaid simId = 0
D/PhoneInterfaceManager( 1787): [PhoneIntfMgr] getDataEnabled: subId=1 phoneId=0
D/PhoneInterfaceManager( 1787): [PhoneIntfMgr] getDataEnabled: subId=1 retVal=true
E/QCOMSysDaemon( 6864): Can't find/open bootselect node: (No such file or directory)
I/QCOMSysDaemon( 6864): Starting qcom system daemon
E/Diag_Lib( 6864): Diag_LSM_Init: Failed to open handle to diag driver, error = 2
E/QCOMSysDaemon( 6864): Diag_LSM_Init failed : 0
E/AndroidRuntime( 6824): FATAL EXCEPTION: main
E/AndroidRuntime( 6824): Process: RBOS_2.x_0.x_1.RBOS_2.x_0.x_1, PID: 6824
E/AndroidRuntime( 6824): android.view.InflateException: Binary XML file line #24: Error inflating class TextView
E/AndroidRuntime( 6824): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:763)
E/AndroidRuntime( 6824): at android.view.LayoutInflater.rInflate(LayoutInflater.java:806)
E/AndroidRuntime( 6824): at android.view.LayoutInflater.rInflate(LayoutInflater.java:809)
E/AndroidRuntime( 6824): at android.view.LayoutInflater.rInflate(LayoutInflater.java:809)
E/AndroidRuntime( 6824): at android.view.LayoutInflater.inflate(LayoutInflater.java:504)
E/AndroidRuntime( 6824): at android.view.LayoutInflater.inflate(LayoutInflater.java:414)
E/AndroidRuntime( 6824): at android.view.LayoutInflater.inflate(LayoutInflater.java:365)
E/AndroidRuntime( 6824): at android.widget.OppoCursorController$FloatPanelViewController.<init>(OppoCursorController.java:1382)
E/AndroidRuntime( 6824): at android.widget.OppoCursorController.createFloatPanelViewController(OppoCursorController.java:122)
E/AndroidRuntime( 6824): at android.widget.OppoCursorController$InsertionPointCursorController.<init>(OppoCursorController.java:197)
E/AndroidRuntime( 6824): at android.widget.OppoCursorController.create(OppoCursorController.java:75)
E/AndroidRuntime( 6824): at android.widget.OppoEditor.getOppoInsertionController(OppoEditor.java:410)
E/AndroidRuntime( 6824): at android.widget.OppoEditor.onFocusChanged(OppoEditor.java:298)
E/AndroidRuntime( 6824): at android.widget.TextView.onFocusChanged(TextView.java:8092)
E/AndroidRuntime( 6824): at android.view.View.handleFocusGainInternal(View.java:4963)
E/AndroidRuntime( 6824): at android.view.View.requestFocusNoSearch(View.java:7679)
E/AndroidRuntime( 6824): at android.view.View.requestFocus(View.java:7658)
E/AndroidRuntime( 6824): at android.view.ViewGroup.onRequestFocusInDescendants(ViewGroup.java:2656)
E/AndroidRuntime( 6824): at android.view.ViewGroup.requestFocus(ViewGroup.java:2612)
E/AndroidRuntime( 6824): at android.view.ViewGroup.onRequestFocusInDescendants(ViewGroup.java:2656)
E/AndroidRuntime( 6824): at android.view.ViewGroup.requestFocus(ViewGroup.java:2612)
E/AndroidRuntime( 6824): at android.view.ViewGroup.onRequestFocusInDescendants(ViewGroup.java:2656)
E/AndroidRuntime( 6824): at android.view.ViewGroup.requestFocus(ViewGroup.java:2612)
E/AndroidRuntime( 6824): at android.view.ViewGroup.onRequestFocusInDescendants(ViewGroup.java:2656)
E/AndroidRuntime( 6824): at android.view.ViewGroup.requestFocus(ViewGroup.java:2612)
E/AndroidRuntime( 6824): at android.view.ViewGroup.onRequestFocusInDescendants(ViewGroup.java:2656)
E/AndroidRuntime( 6824): at android.view.ViewGroup.requestFocus(ViewGroup.java:2612)
E/AndroidRuntime( 6824): at android.view.ViewGroup.onRequestFocusInDescendants(ViewGroup.java:2656)
E/AndroidRuntime( 6824): at android.view.ViewGroup.requestFocus(ViewGroup.java:2612)
E/AndroidRuntime( 6824): at android.view.ViewGroup.onRequestFocusInDescendants(ViewGroup.java:2656)
E/AndroidRuntime( 6824): at android.view.ViewGroup.requestFocus(ViewGroup.java:2612)
E/AndroidRuntime( 6824): at android.view.ViewGroup.onRequestFocusInDescendants(ViewGroup.java:2656)
E/AndroidRuntime( 6824): at android.view.ViewGroup.requestFocus(ViewGroup.java:2615)
E/AndroidRuntime( 6824): at android.view.View.requestFocus(View.java:7625)
E/AndroidRuntime( 6824): at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2019)
E/AndroidRuntime( 6824): at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1116)
E/AndroidRuntime( 6824): at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6084)
E/AndroidRuntime( 6824): at android.view.Choreographer$CallbackRecord.run(Choreographer.java:773)
E/AndroidRuntime( 6824): at android.view.Choreographer.doCallbacks(Choreographer.java:586)
E/AndroidRuntime( 6824): at android.view.Choreographer.doFrame(Choreographer.java:556)
E/AndroidRuntime( 6824): at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:759)
E/AndroidRuntime( 6824): at android.os.Handler.handleCallback(Handler.java:739)
E/AndroidRuntime( 6824): at android.os.Handler.dispatchMessage(Handler.java:95)
E/AndroidRuntime( 6824): at android.os.Looper.loop(Looper.java:150)
E/AndroidRuntime( 6824): at android.app.ActivityThread.main(ActivityThread.java:5408)
E/AndroidRuntime( 6824): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime( 6824): at java.lang.reflect.Method.invoke(Method.java:372)
E/AndroidRuntime( 6824): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:964)
E/AndroidRuntime( 6824): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:759)
E/AndroidRuntime( 6824): Caused by: java.lang.RuntimeException: Failed to resolve attribute at index 24
E/AndroidRuntime( 6824): at android.content.res.TypedArray.getColor(TypedArray.java:401)
E/AndroidRuntime( 6824): at android.widget.TextView.<init>(TextView.java:709)
E/AndroidRuntime( 6824): at android.widget.TextView.<init>(TextView.java:645)
E/AndroidRuntime( 6824): at android.support.v7.widget.AppCompatTextView.<init>(AppCompatTextView.java:60)
E/AndroidRuntime( 6824): at android.support.v7.widget.AppCompatTextView.<init>(AppCompatTextView.java:56)
E/AndroidRuntime( 6824): at android.support.v7.app.AppCompatViewInflater.createView(AppCompatViewInflater.java:103)
E/AndroidRuntime( 6824): at android.support.v7.app.AppC
D/ActivityManager( 866): addErrorToDropBox processName = RBOS_2.x_0.x_1.RBOS_2.x_0.x_1
W/ActivityManager( 866): Force finishing activity 1 RBOS_2.x_0.x_1.RBOS_2.x_0.x_1/md53392bfeb2a49aa0a04b6510289d0206f.RequestAccess
W/ActivityManager( 866): Force finishing activity 2 RBOS_2.x_0.x_1.RBOS_2.x_0.x_1/md53392bfeb2a49aa0a04b6510289d0206f.Launcher
W/DropBoxManagerService( 866): Dropping: data_app_crash (10 > 0 bytes)
V/WindowManager( 866): Changing focus from Window{386088e1 u0 RBOS_2.x_0.x_1.RBOS_2.x_0.x_1/md53392bfeb2a49aa0a04b6510289d0206f.RequestAccess} to null Callers=com.android.server.wm.WindowManagerService.setFocusedApp:4259 com.android.server.am.ActivityManagerService.setFocusedActivityLocked:2553 com.android.server.am.ActivityStack.adjustFocusedActivityLocked:2873 com.android.server.am.ActivityStack.finishActivityLocked:3118
D/DropBoxManagerService( 866): file :: /data/system/dropbox/data_app_crash@1501223953398.lost
V/WindowManager( 866): Changing focus from null to Window{18da7c8d u0 Application Error: RBOS_2.x_0.x_1.RBOS_2.x_0.x_1} Callers=com.android.server.wm.WindowManagerService.addWindow:2660 com.android.server.wm.Session.addToDisplay:173 android.view.ViewRootImpl.setView:582 android.view.WindowManagerGlobal.addView:300
D/StatusBarManagerService( 866): manageDisableList userId=0 what=0x0 pkg=Window{18da7c8d u0 Application Error: RBOS_2.x_0.x_1.RBOS_2.x_0.x_1}
W/ActivityManager( 866): Dismiss app error dialog : RBOS_2.x_0.x_1.RBOS_2.x_0.x_1
V/WindowManager( 866): Changing focus from Window{18da7c8d u0 Application Error: RBOS_2.x_0.x_1.RBOS_2.x_0.x_1} to null Callers=com.android.server.wm.WindowManagerService.removeWindowLocked:2830 com.android.server.wm.WindowManagerService.removeWindowLocked:2739 com.android.server.wm.WindowManagerService.removeWindow:2729 com.android.server.wm.Session.remove:192
I/Process ( 6824): Sending signal. PID: 6824 SIG: 9
V/Process ( 6824): killProcess [6824] Callers=com.android.internal.os.RuntimeInit$UncaughtHandler.uncaughtException:99 android.runtime.UncaughtExceptionHandler.n_uncaughtException:-2 android.runtime.UncaughtExceptionHandler.uncaughtException:37 java.lang.ThreadGroup.uncaughtException:693
I/WindowState( 866): WIN DEATH: Window{2ec5203a u0 RBOS_2.x_0.x_1.RBOS_2.x_0.x_1/md53392bfeb2a49aa0a04b6510289d0206f.Launcher}
I/WindowState( 866): WIN DEATH: Window{386088e1 u0 RBOS_2.x_0.x_1.RBOS_2.x_0.x_1/md53392bfeb2a49aa0a04b6510289d0206f.RequestAccess}
D/WindowStateAnimator( 866): finishExit add win to mPendingRemove. win:Window{386088e1 u0 RBOS_2.x_0.x_1.RBOS_2.x_0.x_1/md53392bfeb2a49aa0a04b6510289d0206f.RequestAccess}
I/ActivityManager( 866): Process RBOS_2.x_0.x_1.RBOS_2.x_0.x_1 (pid 6824) has died
V/WindowManager( 866): Changing focus from null to Window{8939001 u0 com.android.settings/com.android.settings.SubSettings} Callers=com.android.server.wm.WindowManagerService.relayoutWindow:3410 com.android.server.wm.Session.relayout:202 android.view.IWindowSession$Stub.onTransact:273 com.android.server.wm.Session.onTransact:130
D/StatusBarManagerService( 866): manageDisableList userId=0 what=0x0 pkg=Window{8939001 u0 com.android.settings/com.android.settings.SubSettings}
W/InputMethodManagerService( 866): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@29eee4cb attribute=null, token = android.os.BinderProxy@129961e8
D/AndroidRuntime( 6867): >>>>>> START com.android.internal.os.RuntimeInit uid 2000 <<<<<<
D/AndroidRuntime( 6867): CheckJNI is OFF
E/jniPro ( 6867): protecteyesinit, try to dlopen arm32 so:/system/lib/libprotecteyes.so
E/jniPro ( 6867): protecteyesinit, dlopen arm32 so:/system/lib/libprotecteyes.so, open ***success****, now dlerror info: (null)
D/AndroidRuntime( 6867): Calling main entry com.android.commands.am.Am
D/ActivityManager( 866): for debug: forceStopPackage[pkg:RBOS_2.x_0.x_1.RBOS_2.x_0.x_1,userId:-1], caller[pid:6867,uid:2000]
I/ActivityManager( 866): Force stopping RBOS_2.x_0.x_1.RBOS_2.x_0.x_1 appid=10189 user=0: from pid 6867
D/AndroidRuntime( 6867): Shutting down VM
I/KSO_STAT( 1466): App is in background, stop update end time, ready to start a new session.
E/QCOMSysDaemon( 6886): Can't find/open bootselect node: (No such file or directory)
I/QCOMSysDaemon( 6886): Starting qcom system daemon
E/Diag_Lib( 6886): Diag_LSM_Init: Failed to open handle to diag driver, error = 2
E/QCOMSysDaemon( 6886): Diag_LSM_Init failed : 0
D/TaskPersister( 866): removeObsoleteFile: deleting file=354_task.xml
** 更新 XML 和样式 **
这是我的 XML
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:alpha="0.9"
android:background="@drawable/rbos_2"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:weightSum="100">
<LinearLayout
android:layout_width="match_parent"
android:layout_weight="55"
android:gravity="center"
android:layout_height="match_parent"
android:orientation="vertical">
<ImageView
android:src="@drawable/dtglogo3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:id="@+id/imgLogo" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_weight="45"
android:layout_height="match_parent"
android:orientation="vertical"
android:gravity="top"
android:paddingLeft="25dp"
android:paddingRight="25dp">
<android.support.design.widget.TextInputLayout
android:id="@+id/layoutAccessCode"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/TextLabel"
android:background="@android:color/transparent"
android:layout_marginTop="15dp">
<!--android:background="@drawable/layouttextbox"-->
<EditText
android:id="@+id/txtAccessCode"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="15dp"
android:layout_marginBottom="5dp"
android:maxLength="15"
android:digits="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"
android:fontFamily="@string/fontFamily"
android:inputType="textVisiblePassword|textNoSuggestions"
android:imeOptions="actionDone"
android:singleLine="true"
android:hint="Access Code" />
</android.support.design.widget.TextInputLayout>
<Button
android:id="@+id/btnSend"
android:textAllCaps="false"
android:theme="@style/button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Send"
android:layout_marginTop="15dp"
android:fontFamily="@string/fontFamily"
android:textSize="20dp"
android:textColor="#e4ecd4"
android:background="@drawable/layoutbutton"/>
</LinearLayout>
<TextView
android:text="@string/versionName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:textSize="6dp"
android:gravity="right"
android:padding="5dp"
android:textColor="#0d47a1"/>
</LinearLayout>
这是我以前的风格
<!-- Input Layout -->
<style name="TextLabel" parent="TextAppearance.AppCompat">
<!-- Hint color and label color in FALSE state -->
<item name="android:textColorHint">#000000</item>
<item name="android:textSize">16sp</item>
<!-- Label color in TRUE state and bar color FALSE and TRUE State -->
<item name="colorAccent">#0d47a1</item>
<item name="colorControlNormal">#000000</item>
<item name="colorControlActivated">#0d47a1</item>
</style>
** 问题已解决 **
按照建议,我可能需要将样式的父级从 TextAppearance.AppCompat 更改为 Widget.Design.TextInputLayout 。我试过了,效果很好!
非常感谢!
*仅供其他程序员测试之用
只是,我想知道为什么只在 OPPO 5.1.1 中。我试过和工作的其他安卓版本在这里
-棉花糖和牛轧糖与华硕 6.0 和 7.0
-Kitkat 和 Marshmallow Starmobile 4.4 和 6.0
-JellyBean、Kitkat 和 Marshmallow 与三星 4.2、4.4 和 6.0
- 5.1 和 5.1.1 的其他品牌(不是 OPPO)
最佳答案
问题出在您的样式颜色上。
E/AndroidRuntime( 6824): android.view.InflateException: Binary XML file line #24: Error inflating class TextView
.../...
Caused by: java.lang.RuntimeException: Failed to resolve attribute at index 24
E/AndroidRuntime( 6824): at android.content.res.TypedArray.getColor(TypedArray.java:401)
如果来自这里,我假设:
txtAccessCode = FindViewById<TextInputLayout>(Resource.Id.layoutAccessCode);
没有看到你的风格,你可以尝试这样的事情:
For example确保 TextView 继承自 Widget.Design.TextInputLayout:
<style name="TextViewStyle" parent="Widget.Design.TextInputLayout">
并且您已经包含了 Design Support Library 依赖项。
如果您想要更具体的答案,请添加您的样式代码、xml/布局、layoutAccessCode 和构建依赖项。
看看这两个问题的答案:
Android XML: RuntimeException: Failed to resolve attribute at index 6
TextInputLayout: RuntimeException - Failed to resolve attribute at index 24
RuntimeException while using new TextInputLayout from support design library
关于c# - 在 visual studio 中进行 xamarin 更新后,使用 Android 5.1.1 Lollipop 启动应用程序时应用程序启动崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45077109/
我需要在客户计算机上运行Ruby应用程序。通常需要几天才能完成(复制大备份文件)。问题是如果启用sleep,它会中断应用程序。否则,计算机将持续运行数周,直到我下次访问为止。有什么方法可以防止执行期间休眠并让Windows在执行后休眠吗?欢迎任何疯狂的想法;-) 最佳答案 Here建议使用SetThreadExecutionStateWinAPI函数,使应用程序能够通知系统它正在使用中,从而防止系统在应用程序运行时进入休眠状态或关闭显示。像这样的东西:require'Win32API'ES_AWAYMODE_REQUIRED=0x0
对于具有离线功能的智能手机应用程序,我正在为Xml文件创建单向文本同步。我希望我的服务器将增量/差异(例如GNU差异补丁)发送到目标设备。这是计划:Time=0Server:hasversion_1ofXmlfile(~800kiB)Client:hasversion_1ofXmlfile(~800kiB)Time=1Server:hasversion_1andversion_2ofXmlfile(each~800kiB)computesdeltaoftheseversions(=patch)(~10kiB)sendspatchtoClient(~10kiBtransferred)Cl
Rackup通过Rack的默认处理程序成功运行任何Rack应用程序。例如:classRackAppdefcall(environment)['200',{'Content-Type'=>'text/html'},["Helloworld"]]endendrunRackApp.new但是当最后一行更改为使用Rack的内置CGI处理程序时,rackup给出“NoMethodErrorat/undefinedmethod`call'fornil:NilClass”:Rack::Handler::CGI.runRackApp.newRack的其他内置处理程序也提出了同样的反对意见。例如Rack
我想用ruby编写一个小的命令行实用程序并将其作为gem分发。我知道安装后,Guard、Sass和Thor等某些gem可以从命令行自行运行。为了让gem像二进制文件一样可用,我需要在我的gemspec中指定什么。 最佳答案 Gem::Specification.newdo|s|...s.executable='name_of_executable'...endhttp://docs.rubygems.org/read/chapter/20 关于ruby-在Ruby中编写命令行实用程序
我构建了两个需要相互通信和发送文件的Rails应用程序。例如,一个Rails应用程序会发送请求以查看其他应用程序数据库中的表。然后另一个应用程序将呈现该表的json并将其发回。我还希望一个应用程序将存储在其公共(public)目录中的文本文件发送到另一个应用程序的公共(public)目录。我从来没有做过这样的事情,所以我什至不知道从哪里开始。任何帮助,将不胜感激。谢谢! 最佳答案 无论Rails是什么,几乎所有Web应用程序都有您的要求,大多数现代Web应用程序都需要相互通信。但是有一个小小的理解需要你坚持下去,网站不应直接访问彼此
我尝试运行2.x应用程序。我使用rvm并为此应用程序设置其他版本的ruby:$rvmuseree-1.8.7-head我尝试运行服务器,然后出现很多错误:$script/serverNOTE:Gem.source_indexisdeprecated,useSpecification.Itwillberemovedonorafter2011-11-01.Gem.source_indexcalledfrom/Users/serg/rails_projects_terminal/work_proj/spohelp/config/../vendor/rails/railties/lib/r
刚入门rails,开始慢慢理解。有人可以解释或给我一些关于在application_controller中编码的好处或时间和原因的想法吗?有哪些用例。您如何为Rails应用程序使用应用程序Controller?我不想在那里放太多代码,因为据我了解,每个请求都会调用此Controller。这是真的? 最佳答案 ApplicationController实际上是您应用程序中的每个其他Controller都将从中继承的类(尽管这不是强制性的)。我同意不要用太多代码弄乱它并保持干净整洁的态度,尽管在某些情况下ApplicationContr
最近,当我启动我的Rails服务器时,我收到了一长串警告。虽然它不影响我的应用程序,但我想知道如何解决这些警告。我的估计是imagemagick以某种方式被调用了两次?当我在警告前后检查我的git日志时。我想知道如何解决这个问题。-bcrypt-ruby(3.1.2)-better_errors(1.0.1)+bcrypt(3.1.7)+bcrypt-ruby(3.1.5)-bcrypt(>=3.1.3)+better_errors(1.1.0)bcrypt和imagemagick有关系吗?/Users/rbchris/.rbenv/versions/2.0.0-p247/lib/ru
我是一个Rails初学者,但我想从我的RailsView(html.haml文件)中查看Ruby变量的内容。我试图在ruby中打印出变量(认为它会在终端中出现),但没有得到任何结果。有什么建议吗?我知道Rails调试器,但更喜欢使用inspect来打印我的变量。 最佳答案 您可以在View中使用puts方法将信息输出到服务器控制台。您应该能够在View中的任何位置使用Haml执行以下操作:-puts@my_variable.inspect 关于ruby-on-rails-如何在我的R
如何在ruby中调用C#dll? 最佳答案 我能想到几种可能性:为您的DLL编写(或找人编写)一个COM包装器,如果它还没有,则使用Ruby的WIN32OLE库来调用它;看看RubyCLR,其中一位作者是JohnLam,他继续在Microsoft从事IronRuby方面的工作。(估计不会再维护了,可能不支持.Net2.0以上的版本);正如其他地方已经提到的,看看使用IronRuby,如果这是您的技术选择。有一个主题是here.请注意,最后一篇文章实际上来自JohnLam(看起来像是2009年3月),他似乎很自在地断言RubyCL