我有一个库模块。它正在使用来自的库
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) 我确实按照此文档将 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
我尝试了很多片段。这就是我现在正在使用的。我知道 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) 我正在使用Drop zone flutter 包。当文件被放入小部件内时,它会返回Html.File 。我想将其转换为 Io.File 或 Uint8List 格式以便上传。