自从我更新到Android SDK工具25.1.6和Android支持存储库32.0.0(今天早上)后,我收到以下错误,我没有更改我的代码中的任何内容,它仍在我的同事计算机上运行(Android SDK工具) 25.1.1 + Android支持存储库30.0.0).
java.lang.IncompatibleClassChangeError: The method
'java.io.File android.support.v4.content.ContextCompat.getNoBackupFilesDir(android.content.Context)'
was expected to be of type virtual but instead was found to be of type direct
(declaration of 'java.lang.reflect.ArtMethod' appears in /system/framework/core-libart.jar)
at com.google.android.gms.iid.zzd.zzeb(Unknown Source)
at com.google.android.gms.iid.zzd.<init>(Unknown Source)
at com.google.android.gms.iid.zzd.<init>(Unknown Source)
at com.google.android.gms.iid.InstanceID.zza(Unknown Source)
at com.google.android.gms.iid.InstanceID.getInstance(Unknown Source)
at com.xxxxxxx.utils.RegistrationIntentService.onHandleIntent(RegistrationIntentService.java:55)
at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:145)
at android.os.HandlerThread.run(HandlerThread.java:61)
Run Code Online (Sandbox Code Playgroud)
这是一段崩溃的代码:
InstanceID instanceID = InstanceID.getInstance(this); // <-- crash here
String instanceIDToken = instanceID.getToken(getString(R.string.google_app_id),
GoogleCloudMessaging.INSTANCE_ID_SCOPE, null);
Run Code Online (Sandbox Code Playgroud)
当我尝试从Google Cloud Messaging获取令牌时.
我正在使用分割的播放服务在Gradle中导入GCM:
compile 'com.google.android.gms:play-services-analytics:9.0.0'
compile …Run Code Online (Sandbox Code Playgroud) android google-cloud-messaging android-gradle-plugin firebase-cloud-messaging
因此,我想做的是将事件侦听器添加到按钮,按下该按钮时将获取状态值并控制台记录它。但即使在多次 setState 调用之后,记录的值也永远不会更新。
useEffect(() => {
const seamCarve = document.getElementById("process");
seamCarve.addEventListener("click", (e) => {
console.log(seamValue);
});
}, []);
Run Code Online (Sandbox Code Playgroud)
然后就是触发它的按钮
<div id="seamvalue">
<Typography variant="h6" align="center">
Seams Reduction:<span id="valueOfSeam"> {seamValue} </span>
</Typography>
</div>
<Button
id="leftslider"
variant="contained"
color="primary"
onClick={() =>
seamValue - 10 > 0 ? setSeamValue(seamValue - 10) : setSeamValue(0)
}
>
<Typography>{"<"}</Typography>
</Button>
<Button
id="rightslider"
variant="contained"
color="primary"
onClick={() => setSeamValue(seamValue + 10)}
>
<Typography>{">"}</Typography>
</Button>
<Button id="process" variant="contained" color="primary">
<Typography>Carve</Typography>
</Button>
Run Code Online (Sandbox Code Playgroud)
当我单击滑块时,该值会发生变化,但是当我按下 id="process" 的按钮以及与其关联的事件侦听器时,即使在更新状态后,它也只会打印 20。
当我尝试xampp在Mac OS X Yosemeti 10.10上启动(manager-osx)时,
我收到此错误:
此应用程序需要管理员权限
它不会像以前那样询问任何密码.