问题:
我的视频没有上传到Facebook.
问题:
如何将视频上传到Facebook?
注意:
我可以从我的画廊上传一张照片.
没有Exceptions
被抛出.我认为这个问题存在问题
params.putString("filename", <selectedviedoPath> )
AsyncFacebookRunner mAsyncFbRunner = new AsyncFacebookRunner(mFacebook);
Bundle params = new Bundle();
//convert to byte stream
**FileInputStream is = new FileInputStream(new File(selectedviedoPath));**
ByteArrayOutputStream bs = new ByteArrayOutputStream();
int data = 0;
while((data = is.read()) != -1)
bs.write(data);
is.close();
byte[] raw = bs.toByteArray();
bs.close();
params.putByteArray("video", raw);
params.putString("filename", <selectedviedoPath> );
mAsyncFbRunner.request("me/videos", params, "POST", new WallPostListener());
Run Code Online (Sandbox Code Playgroud) 我在android中使用phonegap进行应用程序.我正在使用cordova 1.6.1
当我从我的javascript回调函数调用html文件时,我收到此错误:
JSCallback Server已关闭:正在停止回调
我正在使用html文件
navigator.app.loadUrl("file:///android_asset/www/html/sync.html");
Run Code Online (Sandbox Code Playgroud)
我也尝试使用html,window.location = "../html/sync.html";
但它给了我同样的错误..我拥有在清单中使用互联网所需的所有权限.
我在运行应用程序时遇到以下问题.
错误:任务':app:transformJackWithJackForDebug'的执行失败.com.android.sched.scheduler.RunnerProcessException:'MethodIdMerger'跑步'''出错:超出GC开销限制
我还在gradle文件中声明了堆大小
dexOptions {
preDexLibraries = false
javaMaxHeapSize "4g"
}
Run Code Online (Sandbox Code Playgroud)
我正在使用android studio 2.2并启用了JackOption.
更新:包含build.gradle
apply plugin: 'com.android.application'
repositories {
mavenCentral()
}
android {
compileSdkVersion 23
buildToolsVersion '24.0.2'
compileOptions.encoding = 'ISO-8859-1'
useLibrary('org.apache.http.legacy')
lintOptions{
abortOnError false
}
packagingOptions {
exclude 'META-INF/LICENSE'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/services/com.fasterxml.jackson.core.JsonFactory'
}
defaultConfig {
applicationId "appID"
minSdkVersion 14
targetSdkVersion 22
versionCode 2033
versionName "6.1"
multiDexEnabled true
ndk {
abiFilters "armeabi", "x86"
}
jackOptions {
enabled true
}
}
dexOptions {
preDexLibraries …
Run Code Online (Sandbox Code Playgroud) 我遇到名为的导航组件的问题safeargs
。
我用classpath 'androidx.navigation:navigation-safe-args-gradle-plugin:2.0.0'
在构建gradle。
在中应用插件androidx.navigation.safeargs.kotlin
时app/build.gradle
,出现以下错误:
原因:androidx.navigation.safeargs只能与androidx项目一起使用
app / build.gradle
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'androidx.navigation.safeargs.kotlin'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.test.navigationexample"
minSdkVersion 14
targetSdkVersion 28
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.1.0-alpha04'
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-alpha4'
implementation 'com.google.android.material:material:1.1.0-alpha05'
implementation 'androidx.navigation:navigation-fragment-ktx:2.0.0'
implementation 'androidx.navigation:navigation-ui-ktx:2.0.0'
}
Run Code Online (Sandbox Code Playgroud) android kotlin android-architecture-components android-architecture-navigation android-safe-args
我已经浏览了android文档,但无法清楚了解这些标签?什么时候应该使用autoRemoveFromRecents
和excludeFromRecents
?
android ×5
android-architecture-components ×1
android-architecture-navigation ×1
callback ×1
cordova ×1
facebook ×1
javascript ×1
kotlin ×1