小编gow*_*672的帖子

如何在我的 android 模块的 build.gradle 中而不是在顶级(项目)的 build.gradle 中使用存储库?

我有一个库模块。它正在使用来自的库

allprojects {
    repositories {
        maven {
            url = uri("https://jitpack.io/")
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

仅当我在项目级别 build.gradle 中添加 jitpack 依赖项时,同步才会成功。现在,我不想强​​迫我的库用户在其项目级别 build.gradle 中添加 jitpack 依赖项。所以,我试图在库模块本身中添加存储库。

我在我的库中尝试了以下代码。

plugins {
    id("com.android.library")
}

repositories {
    google()
    maven {
        url = uri("https://jitpack.io/")
    }
}

android {
    // ...
}

dependencies {
    // from jitpack
    implementation("https://github.com/a914-gowtham/compose-ratingbar")
    // ...
}
Run Code Online (Sandbox Code Playgroud)

android gradle gradle-kotlin-dsl

6
推荐指数
1
解决办法
289
查看次数

Firebase 电话身份验证在 android 版本 20.0.0 中不起作用

我确实按照此文档将 firebase 依赖项更新到最新版本

旧依赖

 implementation 'com.google.firebase:firebase-core:17.5.1'
    implementation 'com.google.firebase:firebase-analytics:17.6.0'
    implementation 'com.google.firebase:firebase-crashlytics:17.2.2'
    implementation 'com.google.firebase:firebase-auth:19.4.0'
    implementation 'com.google.firebase:firebase-firestore-ktx:21.7.1'
Run Code Online (Sandbox Code Playgroud)

更新的依赖项

   //firebase
    //By using the Firebase Android BoM, your app will always use compatible versions of the Firebase Android libraries.
    implementation platform('com.google.firebase:firebase-bom:26.0.0')
    // When using the BoM, you don't specify versions in Firebase library dependencies
    implementation 'com.google.firebase:firebase-analytics-ktx'
    implementation 'com.google.firebase:firebase-auth-ktx'
    implementation 'com.google.firebase:firebase-firestore-ktx'
    //The Firebase Authentication Android library now works on devices without Google Play services.
//    implementation "com.google.android.gms:play-services-base:17.5.0"
Run Code Online (Sandbox Code Playgroud)

旧电话认证方法工作正常

   PhoneAuthProvider.getInstance().verifyPhoneNumber(
            number,
            60,
            TimeUnit.SECONDS,
            activity,
            this …
Run Code Online (Sandbox Code Playgroud)

android firebase firebase-authentication firebase-realtime-database

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

从 Google 登录对话框中打开隐私政策和服务条款链接

我想当用户单击对话框中的隐私策略时打开隐私策略链接。我在文档中找不到任何内容。目前,点击隐私政策时显示“找不到可以打开链接的浏览器”

在此输入图像描述

android google-signin

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

如何获取从 android 10 上的图库中选择的视频的路径

我尝试了很多片段。这就是我现在正在使用的。我知道 MediaStore.Video.Media.DATA 已弃用。不知何故此方法也适用于 android 10,但有时会抛出

android.database.CursorIndexOutOfBoundsException: 请求索引 0,大小为 0

public static String getvideoPath(Context context, Uri uri) {
    try {
        Cursor cursor = context.getContentResolver().query(uri, null, null, null, null);
        cursor.moveToFirst();
        String document_id = cursor.getString(0);
        LogMessage.v("Document Id:: "+document_id);
        if(document_id!=null){
        document_id = document_id.substring(document_id.lastIndexOf(":") + 1);
        cursor.close();
        cursor = context.getContentResolver().query(
                MediaStore.Video.Media.EXTERNAL_CONTENT_URI,
                null, MediaStore.Video.Media._ID + " = ? ", new String[]{document_id}, null);
        cursor.moveToFirst();
        String path = cursor.getString(cursor.getColumnIndex(MediaStore.Video.Media.DATA));
        cursor.close();
        return path;
        }else
            return getPath(context,uri);
    } catch (Exception e) {
        e.printStackTrace();
        return getPath(context,uri);
    }
}

private static String …
Run Code Online (Sandbox Code Playgroud)

java android path android-contentresolver

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

在flutter中将Html.File转换为Uint8List

我正在使用Drop zone flutter 包。当文件被放入小部件内时,它会返回Html.File 。我想将其转换为 Io.File 或 Uint8List 格式以便上传。

dart flutter flutter-web

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