- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
我们之前为 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/
我喜欢 smartcase,也喜欢 * 和 # 搜索命令。但我更希望 * 和 # 搜索命令区分大小写,而/和 ?搜索命令遵循 smartcase 启发式。 是否有隐藏在某个地方我还没有找到的设置?我宁
关闭。这个问题是off-topic .它目前不接受答案。 想改进这个问题? Update the question所以它是on-topic对于堆栈溢出。 10年前关闭。 Improve this qu
从以下网站,我找到了执行java AD身份验证的代码。 http://java2db.com/jndi-ldap-programming/solution-to-sslhandshakeexcepti
似乎 melt 会使用 id 列和堆叠的测量变量 reshape 您的数据框,然后通过转换让您执行聚合。 ddply,从 plyr 包看起来非常相似..你给它一个数据框,几个用于分组的列变量和一个聚合
我的问题是关于 memcached。 Facebook 使用 memcached 作为其结构化数据的缓存,以减少用户的延迟。他们在 Linux 上使用 UDP 优化了 memcached 的性能。 h
在 Camel route ,我正在使用 exec 组件通过 grep 进行 curl ,但使用 ${HOSTNAME} 的 grep 无法正常工作,下面是我的 Camel 路线。请在这方面寻求帮助。
我正在尝试执行相当复杂的查询,在其中我可以排除与特定条件集匹配的项目。这是一个 super 简化的模型来解释我的困境: class Thing(models.Model) user = mod
我正在尝试执行相当复杂的查询,我可以在其中排除符合特定条件集的项目。这里有一个 super 简化的模型来解释我的困境: class Thing(models.Model) user = mod
我发现了很多嵌入/内容项目的旧方法,并且我遵循了在这里找到的最新方法(我假设):https://blog.angular-university.io/angular-ng-content/ 我正在尝试
我正在寻找如何使用 fastify-nextjs 启动 fastify-cli 的建议 我曾尝试将代码简单地添加到建议的位置,但它不起作用。 'use strict' const path = req
我正在尝试将振幅 js 与 React 和 Gatsby 集成。做 gatsby developer 时一切看起来都不错,因为它发生在浏览器中,但是当我尝试 gatsby build 时,我收到以下错
我试图避免过度执行空值检查,但同时我想在需要使代码健壮的时候进行空值检查。但有时我觉得它开始变得如此防御,因为我没有实现 API。然后我避免了一些空检查,但是当我开始单元测试时,它开始总是等待运行时异
尝试进行包含一些 NOT 的 Kibana 搜索,但获得包含 NOT 的结果,因此猜测我的语法不正确: "chocolate" AND "milk" AND NOT "cow" AND NOT "tr
我正在使用开源代码共享包在 iOS 中进行 facebook 集成,但收到错误“FT_Load_Glyph failed: glyph 65535: error 6”。我在另一台 mac 机器上尝试了
我正在尝试估计一个标准的 tobit 模型,该模型被审查为零。 变量是 因变量 : 幸福 自变量 : 城市(芝加哥,纽约), 性别(男,女), 就业(0=失业,1=就业), 工作类型(失业,蓝色,白色
我有一个像这样的项目布局 样本/ 一种/ 源/ 主要的/ java / java 资源/ .jpg 乙/ 源/ 主要的/ java / B.java 资源/ B.jpg 构建.gradle 设置.gr
如何循环遍历数组中的多个属性以及如何使用map函数将数组中的多个属性显示到网页 import React, { Component } from 'react'; import './App.css'
我有一个 JavaScript 函数,它进行 AJAX 调用以返回一些数据,该调用是在选择列表更改事件上触发的。 我尝试了多种方法来在等待时显示加载程序,因为它当前暂停了选择列表,从客户的 Angul
可能以前问过,但找不到。 我正在用以下形式写很多语句: if (bar.getFoo() != null) { this.foo = bar.getFoo(); } 我想到了三元运算符,但我认
我有一个表单,在将其发送到 PHP 之前我正在执行一些验证 JavaScript,验证后的 JavaScript 函数会发布用户在 中输入的文本。页面底部的标签;然而,此消息显示短暂,然后消失...
我是一名优秀的程序员,十分优秀!