我有一个日食Cordova项目,我试图导入Android Studio。 我已将其作为gradle项目导入,并使build.gradle文件正常工作。
有2个项目(种类)。我的MainActivity(com.test.example)和导入的CordovaLib。
但是,当我尝试添加模块时,它只允许我使用CordovaLib。因此,项目永远不会从主要活动中运行。我不知道如何让它运行主项目。
我的设置和项目设置在
之下由于某些原因我无法通过堆叠流程上传图像
我的root build.gradle文件
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.1'
}
}
allprojects {
repositories {
mavenCentral()
}
}
apply plugin: 'com.google.gms.google-services'
我的CordovaLib build.gradle文件
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion '25.0.2'
defaultConfig {
applicationId 'example.com.test'
minSdkVersion 21
targetSdkVersion 23
versionCode 24
versionName '1.0.2'
}
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
}
// Move the tests to tests/java, tests/res, etc...
instrumentTest.setRoot('tests')
// Move the build types to build-types/<type>
// For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ...
// This moves them out of them default location under src/<type>/... which would
// conflict with src/ being used by the main source set.
// Adding new build types or product flavors should be accompanied
// by a similar customization.
debug.setRoot('build-types/debug')
release.setRoot('build-types/release')
}
}
dependencies {
compile fileTree(dir: 'libs', include: '*.jar')
}
apply plugin: 'base'
我的设置。草根文件
// GENERATED FILE - DO NOT EDIT
include ":"
include ":CordovaLib"
当我尝试运行该项目时,我收到以下错误
Error running CordovaLib: Default Activity Not Found
知道我做错了什么吗?我不知道build.gradle文件是否混淆了,或者我是否会以完全错误的方式解决这个问题。过去几天只有麻烦
答案 0 :(得分:1)