小编Blu*_*ift的帖子

Android Studio minSdkVersion和targetSdkVersion警告

在我拥有的Android项目中,我在build.gradle文件中有这个部分:

android {
    compileSdkVersion 19
    buildToolsVersion "19.0.3"

    defaultConfig {
        minSdkVersion 16
        targetSdkVersion 19;
    }
}
Run Code Online (Sandbox Code Playgroud)

在'minSdkVersion'和'targetSdkVersion'属性中,有警告:

'minSdkVersion' cannot be applied to '(java.lang.Integer)'

'targetSdkVersion' cannot be applied to '(java.lang.Integer)`
Run Code Online (Sandbox Code Playgroud)

这是一个错误,还是其他什么?

android gradle android-studio build.gradle

8
推荐指数
1
解决办法
2489
查看次数

脚本不能在Python3.0中运行

此脚本将按预期运行并在Python 2.6中无任何错误地传递doctests:

def num_even_digits(n):
    """
      >>> num_even_digits(123456)
      3
      >>> num_even_digits(2468)
      4
      >>> num_even_digits(1357)
      0
      >>> num_even_digits(2)
      1
      >>> num_even_digits(20)
      2
    """


    count = 0
    while n:
        digit=n%10
        if digit%2==0:
            count+=1
            n/=10
        else:
            n/=10

    return count



if __name__ == '__main__':
    import doctest
    doctest.testmod()
Run Code Online (Sandbox Code Playgroud)

在Python3.0中,这是输出:

**********************************************************************
File "/home/calder/My Documents/Programming/Python Scripts/ch06.py", line 3, in                            
 __main__.num_even_digits`
Failed example:
    num_even_digits(123456)
Expected:
    3
Got:
    1
**********************************************************************
File "/home/calder/My Documents/Programming/Python Scripts/ch06.py", line 5, in                   
__main__.num_even_digits
Failed example:
    num_even_digits(2468)
Expected:
    4
Got:
    1
**********************************************************************
1 items had failures: …
Run Code Online (Sandbox Code Playgroud)

python python-3.x

4
推荐指数
2
解决办法
460
查看次数

通过 PECL 安装的 Redis PHP 扩展可以在 Mac M1 上运行吗?

Redis 服务器使用 Homebrew 成功运行brew services start redis。PECL Redis 安装程序似乎可以与 一起使用sudo pecl install redis ,并提供以下输出:

Build process completed successfully
Installing '/opt/homebrew/Cellar/php@7.4/7.4.28/pecl/20190902/redis.so'
install ok: channel://pecl.php.net/redis-5.3.7
Extension redis enabled in php.ini
Run Code Online (Sandbox Code Playgroud)

如果我使用php --ini,这就是输出:

Warning: PHP Startup: Unable to load dynamic library 'redis.so' (tried: /opt/homebrew/lib/php/pecl/20190902/redis.so (dlopen(/opt/homebrew/lib/php/pecl/20190902/redis.so, 0x0009): tried: '/opt/homebrew/lib/php/pecl/20190902/redis.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e')), '/usr/local/lib/redis.so' (no such file), '/usr/lib/redis.so' (no such file)), /opt/homebrew/lib/php/pecl/20190902/redis.so.so (dlopen(/opt/homebrew/lib/php/pecl/20190902/redis.so.so, 0x0009): tried: '/opt/homebrew/lib/php/pecl/20190902/redis.so.so' (no such file), '/usr/local/lib/redis.so.so' (no such …
Run Code Online (Sandbox Code Playgroud)

php redis apple-silicon apple-m1

4
推荐指数
1
解决办法
7468
查看次数

NotificationCompat.Builder中的setLargeIcon()不起作用

我致电时使用YouTube API:

new DownloadImageTask(activity, i, notificationDetails).execute(notificationDetails.get(i).getThumbUri())

这个班级:

public class DownloadImageTask extends AsyncTask<String, Void, Bitmap> {

private int currentIndex;
private LoginActivity activity;
private ArrayList<VideoData> notifyDetails;
private String urlDisplay;

public DownloadImageTask(LoginActivity activity, int notificationDetailsIndex, ArrayList<VideoData> notificationDetails){
    currentIndex = notificationDetailsIndex;
    this.activity = activity;
    this.notifyDetails = notificationDetails;
}

@Override
protected Bitmap doInBackground(String... urls){
        urlDisplay = urls[0];           
        Bitmap image = null;
        InputStream in = null;

        try{
            in = new java.net.URL(urlDisplay).openStream();
            image = BitmapFactory.decodeStream(in);
        } catch(Exception e){
            Log.e("Error decoding bitmap", Log.getStackTraceString(e));
        }finally{
            if (in != null) …
Run Code Online (Sandbox Code Playgroud)

java youtube api android

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