Deep linking - ClassNotFound Run time Exception on path DexPathList

EmyMa341EmyMa341 USMember ✭✭
edited August 2016 in Xamarin.Android

I have edited the namespaces in Xamarin Android shared project. After changing namespaces I resolved resources error. At the moment there are no build time error compiling and running fine. In application I have feature when clicked on a URL it opens up application ( https://forums.xamarin.com/discussion/59854/url-scheme-to-open-app-using-link-in-browser-crashes#latest ). Here is code(Android.menifest) to target activity.

<activity android:name="Namespace.ActivityName" android:label="Blabla" android:theme="@style/CustomActionBarTheme"> <intent-filter> <data android:scheme="http" android:host="blabla" /> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.BROWSABLE" /> </intent-filter> </activity>

If I run the previous copy of project everything goes well and works fine. After changing namespace naming I am getting following after when user press link to pop up the target activity outside the application.

"
Java.Lang.RuntimeException: Unable to instantiate activity ComponentInfo{packageName/NameSpace.MyActivity}: java.lang.ClassNotFoundException: Didn't find class "NameSpace.MyActivity" on path: DexPathList[[zip file "/data/app/packageName-1.apk"],nativeLibraryDirectories=[/data/app-lib/packageName-1, /system/lib]]
"

Also if I try to access the activity in any other activity its accessible just directly by writing NameSpace.ActivityName that means Activity class is there. I have renamed all of the activities with new name and also updated the root namepaces. Anybody ever encountered same issue ?

I have tried cleaning the project. Also deleted bin and obj files. I want to edit the Namespaces, if I revert namespaces names everything start working fine again. Any suggestions ?

Best Answer

Answers

  • VijayPawar.0297VijayPawar.0297 USMember ✭✭

    @EmyMa341 said:
    Issue is resolved, problem was capital letter in namespace. After I changed namespaces to all small letters it worked like charm. Cheers

    Yes. I had too but following to your answer I solved mine too. But Why is it so?
    Running very charm.

  • SreeeeSreeee INMember ✭✭✭✭✭

    @EmyMa341 said:
    I have edited the namespaces in Xamarin Android shared project. After changing namespaces I resolved resources error. At the moment there are no build time error compiling and running fine. In application I have feature when clicked on a URL it opens up application ( https://forums.xamarin.com/discussion/59854/url-scheme-to-open-app-using-link-in-browser-crashes#latest ). Here is code(Android.menifest) to target activity.

    <activity android:name="Namespace.ActivityName" android:label="Blabla" android:theme="@style/CustomActionBarTheme"> <intent-filter> <data android:scheme="http" android:host="blabla" /> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.BROWSABLE" /> </intent-filter> </activity>

    If I run the previous copy of project everything goes well and works fine. After changing namespace naming I am getting following after when user press link to pop up the target activity outside the application.

    "
    Java.Lang.RuntimeException: Unable to instantiate activity ComponentInfo{packageName/NameSpace.MyActivity}: java.lang.ClassNotFoundException: Didn't find class "NameSpace.MyActivity" on path: DexPathList[[zip file "/data/app/packageName-1.apk"],nativeLibraryDirectories=[/data/app-lib/packageName-1, /system/lib]]
    "

    Also if I try to access the activity in any other activity its accessible just directly by writing NameSpace.ActivityName that means Activity class is there. I have renamed all of the activities with new name and also updated the root namepaces. Anybody ever encountered same issue ?

    I have tried cleaning the project. Also deleted bin and obj files. I want to edit the Namespaces, if I revert namespaces names everything start working fine again. Any suggestions ?

    Hi @AugustoPedroza.6033 and @VijayPawar.0297

    Me too have this same issue. When I try with small letter namespace the app didn't launching when running. If I use the same namespace in the Mainactivity.cs or packagename.activityname or packagename.namespace.activityname I am getting ClassNotFoundException.

    I am attaching a sample project of mine. Already I lost a lot of days because of this feature. Please help me to fix this issue.

Sign In or Register to comment.