无法在 android 工作室中导入解析
Unable to import parse in android studio
我正在关注 back4app 文档以安装解析 sdk.Done 他们所说的一切,但我的应用程序 class 无法导入“Parse”。我在这里访问了有关此的旧答案(stackover 流程)但是 none 对我有用。
我的build.gradle(模块):--->
apply plugin: 'com.android.application'
android {
compileSdkVersion 29
buildToolsVersion "29.0.3"
defaultConfig {
applicationId "com.example.loginapp"
minSdkVersion 15
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation 'com.github.parse-community.Parse-SDK-Android:bolts-tasks:1.24.2'
}
build.gradle(应用程序):--->
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath "com.android.tools.build:gradle:4.0.1"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
maven { url "https://jitpack.io" }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
android 清单:--->
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.loginapp">
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<application
android:name=".App"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
申请class:--->
package com.example.loginapp;
import com.parse.Parse;
import android.app.Application;
public class App extends Application {
// Initializes Parse SDK as soon as the application is created
@Override
public void onCreate() {
super.onCreate();
Parse.initialize(new Parse.Configuration.Builder(this)
.applicationId("fif7ynkG8j1YIhqHywgbHaCgT3rZod0fzMllv8fe")
.clientKey("wpZd5EqXOPFpxrx5uZYP3dwk38ZTjZWnPODAYThS")
.server("https://parseapi.back4app.com")
.build()
);
}
}
请帮忙!
谢谢
你需要添加这个依赖:
implementation "com.github.parse-community.Parse-SDK-Android:parse:1.24.2"
我正在关注 back4app 文档以安装解析 sdk.Done 他们所说的一切,但我的应用程序 class 无法导入“Parse”。我在这里访问了有关此的旧答案(stackover 流程)但是 none 对我有用。
我的build.gradle(模块):--->
apply plugin: 'com.android.application'
android {
compileSdkVersion 29
buildToolsVersion "29.0.3"
defaultConfig {
applicationId "com.example.loginapp"
minSdkVersion 15
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation 'com.github.parse-community.Parse-SDK-Android:bolts-tasks:1.24.2'
}
build.gradle(应用程序):--->
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath "com.android.tools.build:gradle:4.0.1"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
maven { url "https://jitpack.io" }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
android 清单:--->
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.loginapp">
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<application
android:name=".App"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
申请class:--->
package com.example.loginapp;
import com.parse.Parse;
import android.app.Application;
public class App extends Application {
// Initializes Parse SDK as soon as the application is created
@Override
public void onCreate() {
super.onCreate();
Parse.initialize(new Parse.Configuration.Builder(this)
.applicationId("fif7ynkG8j1YIhqHywgbHaCgT3rZod0fzMllv8fe")
.clientKey("wpZd5EqXOPFpxrx5uZYP3dwk38ZTjZWnPODAYThS")
.server("https://parseapi.back4app.com")
.build()
);
}
}
请帮忙!
谢谢
你需要添加这个依赖:
implementation "com.github.parse-community.Parse-SDK-Android:parse:1.24.2"