- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有一个 Android 应用程序,其调试版本运行良好。然而,它的发布版本,其中包括使用 ProGuard 进行混淆(配置如下所示),无法正常工作,并且总是在启动时崩溃,并显示以下日志:
01-26 15:33:34.048 E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.alxdroiddev.cameragear, PID: 6551
co: Fragment FragmentIntro{13af572c id=0x7f100177 android:switcher:2131755383:0} did not call through to super.onAttach()
at android.support.v4.app.FragmentManagerImpl.a(SourceFile:1232)
at android.support.v4.app.FragmentManagerImpl.v(SourceFile:2323)
at android.support.v4.app.FragmentManagerImpl.a(SourceFile:2136)
at android.support.v4.app.FragmentManagerImpl.b(SourceFile:2092)
at android.support.v4.app.FragmentManagerImpl.b(SourceFile:1969)
at bu.commitNowAllowingStateLoss(SourceFile:620)
at android.support.v4.app.FragmentPagerAdapter.finishUpdate(SourceFile:143)
at android.support.v4.view.ViewPager.populate(SourceFile:1268)
at android.support.v4.view.ViewPager.populate(SourceFile:1116)
at android.support.v4.view.ViewPager.onMeasure(SourceFile:1642)
at android.view.View.measure(View.java:17430)
at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:727)
at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:463)
at android.view.View.measure(View.java:17430)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5463)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:430)
at android.support.v7.widget.ContentFrameLayout.onMeasure(SourceFile:139)
at android.view.View.measure(View.java:17430)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5463)
at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1436)
at android.widget.LinearLayout.measureVertical(LinearLayout.java:722)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:613)
at android.view.View.measure(View.java:17430)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5463)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:430)
at android.view.View.measure(View.java:17430)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5463)
at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1436)
at android.widget.LinearLayout.measureVertical(LinearLayout.java:722)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:613)
at android.view.View.measure(View.java:17430)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5463)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:430)
at com.android.internal.policy.impl.PhoneWindow$DecorView.onMeasure(PhoneWindow.java:2560)
at android.view.View.measure(View.java:17430)
at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:2001)
at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1166)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1372)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1054)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5779)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:767)
at android.view.Choreographer.doCallbacks(Choreographer.java:580)
at android.view.Choreographer.doFrame(Choreographer.java:550)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:753)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5221)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
我尝试添加所需的调用(覆盖错误 fragment 中的 onAttach()
),但这没有任何区别。有问题的 fragment 位于下面的代码中,它与库 AppIntro 一起使用。这是 FragmentIntro.java
的代码:
public class FragmentIntro extends Fragment implements ISlideBackgroundColorHolder { /* Static stuff */ private static final String ARG_LAYOUT_TITLE_ID = "titleId"; private static final String ARG_LAYOUT_MESSAGE_ID = "messageId"; private static final String ARG_LAYOUT_DRAWABLE_ID = "drawableId"; private static final String ARG_LAYOUT_COLOR_ID = "colorId"; //private static final int layoutResId = R.layout.intro_fragment; /* Private instance variables */ private int titleRedId, messageResId, drawableId, colorResId, colorCode; private RelativeLayout mainLayout; public static FragmentIntro newInstance(@StringRes int titleId, @StringRes int messageId, @DrawableRes int drawableId, @ColorRes int colorId) { FragmentIntro fragSlide = new FragmentIntro(); Bundle args = new Bundle(); args.putInt(ARG_LAYOUT_TITLE_ID, titleId); args.putInt(ARG_LAYOUT_MESSAGE_ID , messageId); args.putInt(ARG_LAYOUT_DRAWABLE_ID , drawableId ); args.putInt(ARG_LAYOUT_COLOR_ID, colorId ); fragSlide.setArguments(args); return fragSlide; } @Override public void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); if (getArguments() != null) { this.titleRedId = getArguments().getInt(ARG_LAYOUT_TITLE_ID); this.messageResId = getArguments().getInt(ARG_LAYOUT_MESSAGE_ID); this.drawableId = getArguments().getInt(ARG_LAYOUT_DRAWABLE_ID); this.colorResId = getArguments().getInt(ARG_LAYOUT_COLOR_ID); } } @Nullable @Override public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { //super.onCreateView(inflater, container, savedInstanceState); //if (container == null) return null; View view = inflater.inflate(R.layout.intro_fragment, container, false); Utils.globalAppContext = getContext().getApplicationContext(); colorCode = ContextCompat.getColor(getContext().getApplicationContext(), colorResId); mainLayout = (RelativeLayout) view.findViewById(R.id.introLayout); mainLayout.setBackgroundColor(colorCode); ((TextView) view.findViewById(R.id.textViewIntroTitle)).setText(titleRedId); ((TextView) view.findViewById(R.id.textViewIntroMessage)).setText(messageResId); ((ImageView) view.findViewById(R.id.imageViewIntro)).setImageDrawable(Utils.getDrawableFromResource(drawableId)); return view; } @Override public void onSaveInstanceState(Bundle outState) { outState.putInt(ARG_LAYOUT_TITLE_ID, titleRedId); outState.putInt(ARG_LAYOUT_MESSAGE_ID, messageResId); outState.putInt(ARG_LAYOUT_DRAWABLE_ID, drawableId); outState.putInt(ARG_LAYOUT_COLOR_ID, colorResId); super.onSaveInstanceState(outState); } @Keep @TargetApi(23) @Override public void onAttach(Context context) { super.onAttach(context); } @Keep @SuppressWarnings("deprecation") @Override public void onAttach(Activity activity) { super.onAttach(activity); } @Override public void onDestroy() { super.onDestroy(); } @Override public void onPause() { super.onPause(); } @Override public void onResume() { super.onResume(); } @Override public void onStart() { super.onStart(); } @Override public void onStop() { super.onStop(); } // Implementation of ISlideBackgroundColorHolder @Override public int getDefaultBackgroundColor() { return colorCode; } @Override public void setBackgroundColor(@ColorInt int backgroundColor) { mainLayout.setBackgroundColor(backgroundColor); } }
我正在使用的混淆器配置文件是这个(并且只有这个):
#################################################################### GENERAL OPTIONS -optimizationpasses 5 -dontusemixedcaseclassnames -dontskipnonpubliclibraryclasses -dontskipnonpubliclibraryclassmembers -verbose -dontpreverify -repackageclasses '' -allowaccessmodification -mergeinterfacesaggressively -overloadaggressively -keepattributes *Annotation*,Signature,EnclosingMethod,InnerClasses -assumenosideeffects class com.alxdroiddev.cameragear.FragmentQueryRunner { *; } -assumenosideeffects class com.alxdroiddev.cameragear.FragmentCards { *; } -assumenosideeffects class com.alxdroiddev.cameragear.db.InitialSampleData { *; } # Required for Firebase Database (Models and POJOs) -keepclassmembers class com.alxdroiddev.cameragear.models.** { *; } #################################################################### REMOVE LOGGING -assumenosideeffects class android.util.Log { public static *** e(...); public static *** w(...); public static *** wtf(...); public static *** d(...); public static *** v(...); public static *** i(...); } -assumenosideeffects class com.alxdroiddev.utils.CLog { *; } #################################################################### IMAGECROPPER -keepnames class com.theartofdev.edmodo.cropper.** { *; } #################################################################### APPINTRO -keep class com.github.paolorotolo.** {*;} -keep public class com.alxdroiddev.cameragear.utils.FragmentIntro -keepclassmembers public class com.alxdroiddev.cameragear.utils.FragmentIntro {*;} -keep public class com.alxdroiddev.cameragear.ActivityIntro -keepclassmembers public class com.alxdroiddev.cameragear.ActivityIntro {*;} #################################################################### METADATA-EXTRACTOR -keep class com.drew.imaging.** { *; } -keep class com.drew.metadata.** { *; } -keep class com.drew.lang.** { *; } #################################################################### MISC STUFF -keep class * extends java.util.ListResourceBundle { protected java.lang.Object[][] getContents(); } # Needed for Parcelable/SafeParcelable Creators to not get stripped -keepnames class * implements android.os.Parcelable { public static final ** CREATOR; } -keepclassmembers class * implements android.os.Parcelable { static ** CREATOR; } # Needed when building against pre-Marshmallow SDK. -dontwarn android.security.NetworkSecurityPolicy -keep class android.support.customtabs.** { *; } -dontwarn android.support.customtabs.** -keep class com.google.android.gms.** { *; } -dontwarn com.google.android.gms.** #################################################################### IN-APP BILLING -keep public interface com.android.vending.licensing.ILicensingService -keep public class com.google.vending.licensing.ILicensingService -keep public class com.android.vending.licensing.ILicensingService #################################################################### KEEP ANDROID SUPPORT V7 AND DESIGN -dontwarn android.support.design.** -keep class android.support.design.** { *; } -keep interface android.support.design.** { *; } -keep public class android.support.design.R$** { *; } -keep public class android.support.v7.widget.** { *; } -keep public class android.support.v7.internal.widget.** { *; } -keep public class android.support.v7.internal.view.menu.** { *; } -keep public class * extends android.support.v4.view.ActionProvider { public (android.content.Context); } -keep public class android.support.v14.preference.** { *; } -keep public class android.support.v7.app.** { *; } -keep public class android.support.v7.preference.** { *; } -keep public class android.support.v4.app.** { *; } -dontwarn android.support.** -keep interface android.support.v4.** { *; } -keep interface android.support.v7.** { *; } -keep interface android.support.v13.** {*; } -keep interface android.support.v14.** {*; } #################################################################### ORG.APACHE.HTTP -keep class org.apache.http.** { *; } -keep interface org.apache.http.** -dontwarn org.apache.** #################################################################### GOOGLE PLAY SERVICES LIB - ADS -keep public class com.google.android.gms.** { public *; } #-keep class com.google.android.gms.** # For Google Play Services -keep public class com.google.android.gms.ads.**{ public *; } #################################################################### FIREBASE -keep public class com.google.firebase.** { *; } -keep public class com.google.firebase.analytics.** { *; } -keep public class com.google.firebase.provider.** { *; } -keep public class com.google.firebase.auth.** { *; } -keep interface com.google.firebase.** {*; } -keep class com.firebase.** { *; } #################################################################### SUGGESTED OPTIMIZATIONS BY GOOGLE # For native methods, see http://proguard.sourceforge.net/manual/examples.html#native -keepclasseswithmembernames class * { native ; } # keep setters in Views so that animations can still work. # see http://proguard.sourceforge.net/manual/examples.html#beans -keepclassmembers public class * extends android.view.View { void set*(***); *** get*(); } # We want to keep methods in Activity that could be used in the XML attribute onClick -keepclassmembers class * extends android.app.Activity { public void *(android.view.View); } # For enumeration classes, see http://proguard.sourceforge.net/manual/examples.html#enumerations -keepclassmembers enum * { public static **[] values(); public static ** valueOf(java.lang.String); } -keepclassmembers class **.R$* { public static ; } # Understand the @Keep support annotation. -keep class android.support.annotation.Keep -keep @android.support.annotation.Keep class * {*;} -keepclasseswithmembers class * { @android.support.annotation.Keep ; } -keepclasseswithmembers class * { @android.support.annotation.Keep ; } -keepclasseswithmembers class * { @android.support.annotation.Keep (...); }
我已经记不清自己花了多少时间来解决这个问题,特别是因为一切都在 Debug模式下运行,并且没有对 super.onAttach()
提出任何提示。仅在使用上面的配置进行混淆后才会失败。
非常感谢您的关注,并感谢您的帮助。
致以诚挚的问候。
最佳答案
我成功了。正如多伦所说,这可能与混淆有关,而不是与代码本身有关。
我将在这里发布我的方法和最终的 proguard.cfg 文件,只是为面临同样问题的人们以及如何[可能]解决它提供引用(注意:它涉及大量的苦力!)。
因为我也怀疑它与类或代码无关,所以我做的第一件事就是删除所有不必要的覆盖,让这两个类被混淆并禁用所有优化。这是通过我的 ProGuard 配置中的这些设置完成的:
-optimizations no_optimizations
说明:no_optimizations
只是一个空占位符。这对 ProGuard 来说毫无意义。你完全可以在其中使用“ cucumber ”这个词,它会产生相同的效果。这只是意味着不会运行任何优化。它与不指定 -optimizations
指令不同,这意味着将运行所有优化。
我还注释掉了 FragmentIntro
类和 ActivityIntro
的所有 -keep
。我做了一个发布编译和测试。它跑得很优雅!上面文件(OP中)中显示的所有其他混淆选项均已打开并保持原样。
然后苦劳开始了:我创建了一条线,其中每一个 ProGuard 优化都被明确拒绝:
-optimizations !class/marking/final,!class/unboxing/enum,!class/merging/vertical,!class/merging/horizontal,!field/removal/writeonly,!field/marking/private,!field/propagation/value,!method/marking/private,!method/marking/static,!method/marking/final,!method/removal/parameter,!method/propagation/parameter,!method/propagation/returnvalue,!method/inlining/short,!method/inlining/unique,!method/inlining/tailrecursion,!code/merging,!code/simplification/variable,!code/simplification/arithmetic,!code/simplification/cast,!code/simplification/field,!code/simplification/branch,!code/simplification/string,!code/simplification/advanced,!code/removal/advanced,!code/removal/simple,!code/removal/variable,!code/removal/exception,!code/allocation/variable
然后,我开始一次允许 1 次优化,每次进行发布构建时,将其安装在模拟器上并查看应用程序是否运行。
如果该优化导致应用程序正在运行,我将其不带感叹号(!),这意味着它是允许的,否则我会将感叹号放回去并继续进行下一个优化:删除该标记,发布构建、安装、测试。
我这样做了 29 次,每次优化一次,只是为了找出哪些优化导致我的代码崩溃。
最后,我弄清楚了所有不需要的优化并得到了这个:
-optimizations class/marking/final,class/unboxing/enum,class/merging/vertical,class/merging/horizontal,!field/removal/writeonly,field/marking/private,field/propagation/value,method/marking/private,!method/marking/static,method/marking/final,!method/removal/parameter,method/propagation/parameter,method/propagation/returnvalue,method/inlining/short,method/inlining/unique,method/inlining/tailrecursion,code/merging,code/simplification/variable,code/simplification/arithmetic,code/simplification/cast,code/simplification/field,code/simplification/branch,code/simplification/string,code/simplification/advanced,!code/removal/advanced,code/removal/simple,code/removal/variable,code/removal/exception,!code/allocation/variable
上面的行经过清理并仅拒绝(感叹号)不需要的优化,相当于:
-optimizations !field/removal/writeonly,!method/marking/static,!method/removal/parameter,!code/removal/advanced,!code/allocation/variable
如果没有完成上述优化,我的代码编译并运行良好。另一方面,如果我允许上述任何优化,它将在启动时崩溃。
这就是我清理后的工作 proguard.cfg 文件的最终结果:
#################################################################### GENERAL OPTIONS
-optimizationpasses 5
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-dontskipnonpubliclibraryclassmembers
-verbose
-dontpreverify
-repackageclasses ''
-allowaccessmodification
-mergeinterfacesaggressively
-overloadaggressively
-keepattributes *Annotation*,Signature,EnclosingMethod,InnerClasses
-optimizations !field/removal/writeonly,!method/marking/static,!method/removal/parameter,!code/removal/advanced,!code/allocation/variable
-assumenosideeffects class com.alxdroiddev.cameragear.FragmentQueryRunner { *; }
-assumenosideeffects class com.alxdroiddev.cameragear.FragmentCards { *; }
-assumenosideeffects class com.alxdroiddev.cameragear.db.InitialSampleData { *; }
# Required for Firebase Database (Models and POJOs)
-keepclassmembers class com.alxdroiddev.cameragear.models.** {
*;
}
#################################################################### REMOVE LOGGING
-assumenosideeffects class android.util.Log {
public static *** e(...);
public static *** w(...);
public static *** wtf(...);
public static *** d(...);
public static *** v(...);
public static *** i(...);
}
-assumenosideeffects class com.alxdroiddev.utils.CLog { *; }
#################################################################### IMAGECROPPER
-keepnames class com.theartofdev.edmodo.cropper.** { *; }
#################################################################### APPINTRO
-keep class com.github.paolorotolo.** {*;}
#################################################################### METADATA-EXTRACTOR
-keep class com.drew.imaging.** { *; }
-keep class com.drew.metadata.** { *; }
-keep class com.drew.lang.** { *; }
#################################################################### MISC STUFF
-keep class * extends java.util.ListResourceBundle {
protected java.lang.Object[][] getContents();
}
# Needed for Parcelable/SafeParcelable Creators to not get stripped
-keepnames class * implements android.os.Parcelable {
public static final ** CREATOR;
}
-keepclassmembers class * implements android.os.Parcelable {
static ** CREATOR;
}
# Needed when building against pre-Marshmallow SDK.
-dontwarn android.security.NetworkSecurityPolicy
-keep class android.support.customtabs.** { *; }
-dontwarn android.support.customtabs.**
-keep class com.google.android.gms.** { *; }
-dontwarn com.google.android.gms.**
#################################################################### IN-APP BILLING
-keep public interface com.android.vending.licensing.ILicensingService
-keep public class com.google.vending.licensing.ILicensingService
-keep public class com.android.vending.licensing.ILicensingService
#################################################################### KEEP ANDROID SUPPORT V7 AND DESIGN
-dontwarn android.support.design.**
-keep class android.support.design.** { *; }
-keep interface android.support.design.** { *; }
-keep public class android.support.design.R$** { *; }
-keep public class android.support.v7.widget.** { *; }
-keep public class android.support.v7.internal.widget.** { *; }
-keep public class android.support.v7.internal.view.menu.** { *; }
-keep public class * extends android.support.v4.view.ActionProvider {
public <init>(android.content.Context);
}
-keep public class android.support.v14.preference.** { *; }
-keep public class android.support.v7.app.** { *; }
-keep public class android.support.v7.preference.** { *; }
-keep public class android.support.v4.app.** { *; }
-dontwarn android.support.**
-keep interface android.support.v4.** { *; }
-keep interface android.support.v7.** { *; }
-keep interface android.support.v13.** {*; }
-keep interface android.support.v14.** {*; }
#################################################################### ORG.APACHE.HTTP
-keep class org.apache.http.** { *; }
-keep interface org.apache.http.**
-dontwarn org.apache.**
#################################################################### GOOGLE PLAY SERVICES LIB - ADS
-keep public class com.google.android.gms.** { public *; }
# For Google Play Services
-keep public class com.google.android.gms.ads.**{
public *;
}
#################################################################### FIREBASE
-keep public class com.google.firebase.** { *; }
-keep public class com.google.firebase.analytics.** { *; }
-keep public class com.google.firebase.provider.** { *; }
-keep public class com.google.firebase.auth.** { *; }
-keep interface com.google.firebase.** {*; }
-keep class com.firebase.** { *; }
#################################################################### SUGGESTED OPTIMIZATIONS BY GOOGLE
# For native methods, see http://proguard.sourceforge.net/manual/examples.html#native
-keepclasseswithmembernames class * {
native <methods>;
}
# keep setters in Views so that animations can still work.
# see http://proguard.sourceforge.net/manual/examples.html#beans
-keepclassmembers public class * extends android.view.View {
void set*(***);
*** get*();
}
# We want to keep methods in Activity that could be used in the XML attribute onClick
-keepclassmembers class * extends android.app.Activity {
public void *(android.view.View);
}
# For enumeration classes, see http://proguard.sourceforge.net/manual/examples.html#enumerations
-keepclassmembers enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}
-keepclassmembers class **.R$* {
public static <fields>;
}
# Understand the @Keep support annotation.
-keep class android.support.annotation.Keep
-keep @android.support.annotation.Keep class * {*;}
-keepclasseswithmembers class * {
@android.support.annotation.Keep <methods>;
}
-keepclasseswithmembers class * {
@android.support.annotation.Keep <fields>;
}
-keepclasseswithmembers class * {
@android.support.annotation.Keep <init>(...);
}
我不知道为什么提到的标记优化会破坏我的代码,尽管我怀疑它优化了 v4.app.Fragment 相关类中的某些内容(特别是 v4.app.FragmentManager,第 1230 行,这阻止了它正确调用 onAttach() 并将 f.mCalled 设置为 true)。顺便说一句,我正在使用 Android 支持库 25.1.0。
无论如何,感谢您的时间和关注,我希望上述解决这个恼人问题的方法对某人有所帮助。
关于android - 使用 Proguard 混淆后出现 SuperNotCalledException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41877548/
我的应用程序从一个有 5 个选项卡的选项卡栏 Controller 开始。一开始,第一个出现了它的名字,但其他四个没有名字,直到我点击它们。然后根据用户使用的语言显示名称。如何在选项卡栏出现之前设置选
我有嵌套数组 json 对象(第 1 层、第 2 层和第 3 层)。我的问题是数据表没有出现。任何相关的 CDN 均已导入。该表仅显示部分。我引用了很多网站,但都没有解决我的问题。 之前我使用标准表来
我正在尝试设置要显示的 Parse PFLoginViewController。这是我的一个 View Controller 的类。 import UIKit import Parse import
我遇到了这个问题,我绘制的对象没有出现在 GUI 中。我知道它正在被处理,因为数据被推送到日志文件。但是,图形没有出现。 这是我的一些代码: public static void main(Strin
我有一个树状图,其中包含出现这样的词...... TreeMap occurrence = new TreeMap (); 字符串 = 单词 整数 = 出现次数。 我如何获得最大出现次数 - 整数,
因此,我提示用户输入变量。如果变量小于 0 且大于 10。如果用户输入 10,我想要求用户再次输入数字。我问时间的时候输入4,它说你输入错误。但在第二次尝试时效果很好。例如:如果我输入 25,它会打印
我已经用 css overflow 属性做了一个例子。在这个例子中我遇到了一个溢出滚动的问题。滚动条出现了,但没有工作意味着每当将光标移动到滚动条时,在这个滚动条不活动的时间。我对此一无所知,所以请帮
我现在正在做一个元素。当您单击一个元素时,会出现以下信息,我想知道如何在您单击下一个元素而不重新单击同一元素时使其消失....例如,我的元素中有披萨,我想单击肉披萨看到浇头然后点击奶酪披萨看到浇头和肉
我有一个路由器模块,它将主题与正则表达式进行比较,并将出现的事件与一致的键掩码链接起来。 (它是一个简单的 url 路由过滤,如 symfony http://symfony.com/doc/curr
这个问题在这里已经有了答案: 9年前关闭。 Possible Duplicate: mysql_fetch_array() expects parameter 1 to be resource, bo
我在底部有一个带有工具栏的 View ,我正在使用 NavigationLink 导航到该 View 。但是当 View 出现时,工具栏显示得有点太低了。大约半秒钟后,它突然跳到位。它只会在应用程序启
我试图在我的应用程序上为背景音乐添加一个 AVAudioPlayer,我正在主屏幕上启动播放器,尝试在应用程序打开时开始播放但出现意外行为... 它播放并立即不断创建新玩家并播放这些玩家,因此同时播放
这是获取一个数字,获取其阶乘并将其加倍,但是由于基本情况,如果您输入 0,它会给出 2 作为答案,因此为了绕过它,我使用了 if 语句,但收到错误输入“if”时解析错误。如果你们能提供帮助,我真的很感
暂停期间抛出异常 android.os.DeadObjectException 在 android.os.BinderProxy.transactNative( native 方法) 在 androi
我已经为猜词游戏编写了一些代码。它从用户输入中读取字符并在单词中搜索该字符;根据字符是否在单词中,程序返回并控制一些变量。 代码如下: import java.util.Random; import
我是自动化领域的新手。这是我的简单 TestNG 登录代码,当我以 TestNG 身份运行该代码时,它会出现 java.lang.NullPointerException,双击它会突出显示我导航到 U
我是c#程序员,我习惯了c#的封装语法和其他东西。但是现在,由于某些原因,我应该用java写一些东西,我现在正在练习java一天!我要创建一个为我自己创建一个虚拟项目,以便让自己更熟悉 Java 的
我正在使用 Intellij,我的源类是 main.com.coding,我的资源文件是 main.com.testing。我将 spring.xml 文件放入资源文件中。 我的测试类位于 test.
我想要我的tests folder separate到我的应用程序代码。我的项目结构是这样的 myproject/ myproject/ myproject.py moduleon
这个问题已经有答案了: What is a NullPointerException, and how do I fix it? (12 个回答) 已关闭 6 年前。 因此,我尝试比较 2 个值,一个
我是一名优秀的程序员,十分优秀!