我搜索了这些问题,但无法解决。请帮我解决这个问题
那是我的 mkdir 代码:
File _sdcardPath = Environment.getExternalStorageDirectory(); // sdcard path is /storage/emulate/0
File _dirPath = new File(_sdcardPath, "CreateFolder");
boolean _isCreate = _dirPath.mkdir();
if (_isCreate) {
tvResult.append(_dirPath + " mkdir success");
} else {
tvResult.append(_dirPath + " mkdir fail");
}
Run Code Online (Sandbox Code Playgroud)
我的 manifest.xml:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.createfolder"
android:versionCode="1"
android:versionName="1.0" >
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-sdk
android:minSdkVersion="11"
android:targetSdkVersion="21" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
Run Code Online (Sandbox Code Playgroud)
我的设备android版本是:5.1.1,12GB可用空间,代码在5.0下正常运行
在运行应用程序时,我遇到了这个异常: …
我在 AndroidStudio 上工作,我有一个项目的结构:
我的项目1
我想将 ModuleCommon 和 ModuleDemo 上传到我的本地 nexus 服务,我将在其他项目中使用 ModuleCommon 或(和)ModuleSocket,即我的 gradle 脚本(片段):
apply plugin: 'maven'
def isReleaseBuild() {
return VERSION_NAME.contains("SNAPSHOT") == false
}
def getRepositoryUsername() {
return hasProperty('NEXUS_USERNAME') ? NEXUS_USERNAME : ""
}
def getRepositoryPassword() {
return hasProperty('NEXUS_PASSWORD') ? NEXUS_PASSWORD : ""
}
afterEvaluate { project ->
uploadArchives {
repositories {
mavenDeployer {
pom.groupId = GROUP
pom.artifactId = "ModuleCommon"
pom.version = "0.0.1"
repository(url: RELEASE_REPOSITORY_URL) {
authentication(userName: getRepositoryUsername(), password: …Run Code Online (Sandbox Code Playgroud)