小编use*_*426的帖子

如何设置 Android 导出为 Cordova 应用程序

我需要在 Google Play 上发布针对 Android 12 的 Cordova 应用程序。当我上传 APK 文件时,出现错误

You uploaded an APK or Android App Bundle which has an activity, activity alias, service or broadcast receiver with intent filter, but without the 'android:exported' property set. This file can't be installed on Android 12 or higher. See: developer.android.com/about/versions/12/behavior-changes-12#exported
Run Code Online (Sandbox Code Playgroud)

我在互联网上做了一些研究,发现这个配置应该添加到 config.xml 中:

    <edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application/activity">
        <activity android:exported="true"/>
    </edit-config>  
Run Code Online (Sandbox Code Playgroud)

它对于我的一些应用程序运行良好,但其中一个应用程序在上传到 Google Play 时仍然显示错误。它的 AndroidManifest.xml 如下所示:

<?xml version='1.0' encoding='utf-8'?>
  <manifest android:hardwareAccelerated="true" android:versionCode="750" android:versionName="7.5.0" package="cz.foxtrot.motoquest" xmlns:android="http://schemas.android.com/apk/res/android">
   <supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:resizeable="true" …
Run Code Online (Sandbox Code Playgroud)

android export android-manifest cordova

15
推荐指数
3
解决办法
2万
查看次数

cordova-plugin-crypt-file - requireCordovaModule error

I just upgrade Cordova to version 9. It cased plugin cordova-plugin-crypt-file to stop working - when I build the application, I get error

Using "requireCordovaModule" to load non-cordova module "path" is not supported. Instead, add this module to your dependencies and use regular "require" to load it.
Run Code Online (Sandbox Code Playgroud)

It looks like the issue is with file hooks/after_prepare.js. The code is

var path              = context.requireCordovaModule('path'),
        fs                = context.requireCordovaModule('fs'),
        crypto            = context.requireCordovaModule('crypto'),
        Q                 = context.requireCordovaModule('q'),
        cordova_util      = context.requireCordovaModule('cordova-lib/src/cordova/util'),
        platforms         = context.requireCordovaModule('cordova-lib/src/platforms/platforms'),
        Parser            = …
Run Code Online (Sandbox Code Playgroud)

module require cordova

6
推荐指数
2
解决办法
4044
查看次数

如何在 Windows PHP 7.0 上安装 Imagick 扩展

我需要在我的 Apache - PHP 7.0 服务器上安装 Imagic 扩展。我遵循了位于此处的非常好的指南:https : //herbmiller.me/2016/06/16/installing-imagick-php-7/。基于“php -i”输出:

PHP Version => 7.0.13
Compiler => MSVC14 (Visual C++ 2015)
Architecture => x86
Thread Safety => enabled
extension_dir => D:\Program Files (x86)\PHP7\ext => D:\Program Files (x86)\PHP7\ext
Run Code Online (Sandbox Code Playgroud)

我下载了文件

php_imagick-3.4.3rc4-7.0-ts-vc14-x86.zip
Run Code Online (Sandbox Code Playgroud)

来自http://windows.php.net/downloads/pecl/releases/imagick/3.4.3rc4/。我将所有 DLL 文件复制到 D:\Program Files (x86)\PHP7\ext 并添加

extension=php_imagick.dll
Run Code Online (Sandbox Code Playgroud)

到我的 PHP.INI。当我重新启动 Apache 时,未加载 Imagic 扩展并且事件查看器显示 2 个相同的错误:

The description for Event ID 4 from source PHP-7.0.13 cannot be found. Either the component that raises this event is not …
Run Code Online (Sandbox Code Playgroud)

php windows imagick

5
推荐指数
1
解决办法
1万
查看次数

如何使用JS和传单层控件更改基础层

我必须修改使用传单图层控件的现有应用程序 - 我需要在启动地图时显示基础图层之一。有没有办法,如何从 JS 脚本的图层控件中调用一些函数 - 类似于 control.select(1) ....?如果没有,如何以与控件相同的方式添加切片图层 - 当我在地图初始化期间添加新的 L.TileLayer 时,它不会被手动图层控件选择更改覆盖?

controls layer tile leaflet

3
推荐指数
1
解决办法
1万
查看次数

当主机不可访问时,fsockopen导致致命错误-“无法连接”

当我将fsockopen调用到无法访问的IP地址时,PHP会按照预期的那样以致命错误停止执行。但是对我来说,主机无法连接是正常情况。有没有办法,即使发生致命错误,如何防止停止php(如果这是预期的行为)?

我不使用任何框架,我自己处理所有错误。我注册这样的处理程序:

set_error_handler("errorHandler");
register_shutdown_function("fatalErrorHandler");
Run Code Online (Sandbox Code Playgroud)

并且处理程序的定义如下:

function fatalErrorHandler() 
{
    $error = error_get_last();

    if( $error !== NULL) {
      $errno   = $error["type"];
      $errfile = $error["file"];
      $errline = $error["line"];
      $errstr  = $error["message"];

      errorHandler($errno, "FATAL: " . $errstr, $errfile, $errline,get_defined_vars(),debug_backtrace());
    }
} 

function errorHandler($errno, $errstr, $errfile, $errline,$vars,$trace="")
{

   // some formatting and checking

   file_put_contents(dirname(__FILE__) . "/error/" . gmdate("YmdHis") . str_replace(".","",microtime(true)) . ".err"
  ,"<error_log_date>" . gmdate("YmdHis") . "</error_log_date><error_log_uid>{$uid}</error_log_uid>
   <error_log_str>{$errstr}</error_log_str>
   <error_log_file>{$errfile}</error_log_file>
   <error_log_line>{$errline}</error_log_line>
   <error_log_vars>{$vars}</error_log_vars>
   <error_log_trace>{$trace}</error_log_trace>");


 return true;
}
Run Code Online (Sandbox Code Playgroud)

php fsockopen

2
推荐指数
1
解决办法
1149
查看次数