0
我有一个简单的应用程序,我想使用我导入的库项目的组件。合并库的清单是在android项目中给出错误
我通过在project.properties
中添加manifestmerger.enabled=true
合并库和主项目的清单,以便我可以将库项目的组件用于主项目。
但是,当我试图从主项目,下面的代码启动库项目的活动:
Intent intent = new Intent(MainActivity.this, ScanActivity.class);
intent.putExtra("scanType", REGISTER_BARCODE);
startActivity(intent);
我得到了以下错误
02-20 01:51:46.524: E/AndroidRuntime(23675): FATAL EXCEPTION: main
02-20 01:51:46.524: E/AndroidRuntime(23675): Process: com.example.smartdna_l1, PID: 23675
02-20 01:51:46.524: E/AndroidRuntime(23675): android.content.ActivityNotFoundException: Unable to find explicit activity class {com.example.smartdna_l1/com.linksmart.smartdna6.ScanActivity}; have you declared this activity in your AndroidManifest.xml?
-
{com.example.smartdna_l1/com.linksmart.smartdna6.ScanActivity}
在哪里com.example.smartdna_l1
是主要项目包和com.linksmart.smartdna6.ScanActivity
是库的pr目标路径。
检测到的路径错误。
现在我的问题是,如何避免合并路径合适的活动路径可以正确检测到启动活动。
您是否在Android Studio中创建了库和应用程序项目?你能提供这些项目的目录结构和AndroidManifest.xml文件吗? –
不,我正在使用Eclipse而不是android studio ... @ Code-Apprentice –